[I18n-sig] Re: gettext in the standard library

François Pinard pinard@iro.umontreal.ca
04 Sep 2000 17:32:54 -0400

[Martin von Loewis]

> > You could wrap the decoding processing into the _ function:

> > def _(s):
> >     return unicode(s, "utf-8")

> > This would allow you not only to use translatable strings,
> > but also any unicode string encoding you like, e.g. utf-8
> > or latin1.

> Maybe I'm missing something here.  How does the catalog come into play
> in this definition of _?

The conversion to Unicode strings would be done from within the translating
function.  This one might be a bound method from a class instance knowing a
few things besides the textual domain.  In particular, the instance would
know the encoding to use from the PO file header, and so, the translating
function should be able to do the proper conversion, transparently.

François Pinard   http://www.iro.umontreal.ca/~pinard