Status of internationalization

Thomas Arendsen Hein thomas at intevation.de
Thu Jun 30 12:30:47 UTC 2005


* vseguip at gmail.com <vseguip at gmail.com> [20050630 13:00]:
> Thomas Arendsen Hein:
> >     user = u'Vicent Segu\xed Pascual'
> >     ui.write(_("Author for this: %(author)s\n"), author=user)
> > 
> > With _ = lgettext this would be:
> > 
> >     user = u'Vicent Segu\xed Pascual'
> >     ui.write(_("Author for this: %(author)s\n"), author=user.encode(encoding))
> 
> Hadn't thought of that possibility. Summarising a bit since it's
> getting a bit confused:
> 
> * We use lgettext (backport it from python 2.4 since it's easy):
> * Any Unicode string must be encoded when joining them with the translatable:
> 
> Am I correct or have I missed something?

Don't use lgettext. Having the foo.encode() statements everywhere is
too much, just extend ui.write and pass only UTF-8 strings to it. It
sounds reasonable that the ui module does the reencoding for the UI.

Thomas

-- 
Email: thomas at intevation.de
http://intevation.de/~thomas/



More information about the Mercurial mailing list