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

M.-A. Lemburg mal@lemburg.com
Mon, 04 Sep 2000 21:39:07 +0200

Martin von Loewis wrote:
> > 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 _?

That was just an example of how you could add the decoding
functionality to the _ function.

You would of course also add a gettext.gettext call
somewhere in there which translates the string first
(possibly recoding it to some other encoding for the
table lookup first).

Marc-Andre Lemburg
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/