Internationalisation of bzr cli

jbowtie at amathaine.com jbowtie at amathaine.com
Fri Apr 29 00:28:08 UTC 2011


On Fri, Apr 29, 2011 at 12:16 PM, Martin Pool <mbp at canonical.com> wrote:
> As soon as you feel you're sufficiently on the right track, please
> propose your branch for merging and we can have a look in more detail.
>  You don't have to have i18d everything, or even one whole command,
> just enough to show the approach will basically work.
>

One of the issues is that docstrings don't interact well with gettext
- you need to monkey-patch inspect.getdoc to actually get those to
display correctly. Which might be where you start to see performance
issues.

import inspect
def getdoc(object):
    try:
        doc = object.__doc__
    except AttributeError:
        return None
    if not isinstance(doc, basestring):
        return None

    return inspect.cleandoc(_(doc))

inspect.getdoc = getdoc



More information about the bazaar mailing list