Internationalisation of bzr cli
INADA Naoki
songofacandy at gmail.com
Mon May 2 11:38:04 UTC 2011
Preceding _ means "private" by tradition. So I prefer another name
like "N_()" as
pass through function. T_() for example.
BTW, should we use ngettext?
pygettext doesn't support ngettext, so my i18n-implementation
<lp:~songofacandy/bzr/i18n-fromhg>
uses both custom script ported from hg and xgettext.
If we will not use ngettext, I can remove dependency for xgettext.
It is good for users on Windows.
On Mon, May 2, 2011 at 5:16 PM, Martin Pool <mbp at canonical.com> wrote:
> 2011/4/30 Stephen J. Turnbull <stephen at xemacs.org>:
>> Jelmer Vernooij writes:
>> > On Sat, 2011-04-30 at 09:24 +1000, Ben Finney wrote:
>> > > Martin Ueding <list at martin-ueding.de> writes:
>> > >
>> > > > What kind of alias should I use when wrapping strings?
>> > > >
>> > > > The underscore might be a little troublesome with its special value in
>> > > > the Python interpreter as the last return value.
>> > >
>> > > That exists only in the interactive interpreter.
>> > >
>> > > Using ‘_’ for the ‘gettext’ alias is common practice in a lot of Python
>> > > code; I don't see a good reason not to use it here.
>> > When working on bzr at least some of the Bazaar developers often break
>> > into the debugger where e.g. exceptions occur. Not being able to use _
>> > there is a pain.
>>
>> if __debug__:
>> _i18n = _
>>
>> No?
>
> No. There is some special magic behaviour in the Python repl where _
> gets rebound during each evaluation, and this interferes with its use
> as a variable in the code under inspection (or vice versa).
>
> As bzr-gtk uses _i18n() that sounds like a pretty good precedent.
> People can always set up an editor macro that changes _( into _i18n(
> as they type.
>
> Martin
>
>
--
INADA Naoki <songofacandy at gmail.com>
More information about the bazaar
mailing list