Translated messages and 'gettext' API (was Re: [I18n-sig] Literal strings)

M.-A. Lemburg
Fri, 02 Jun 2000 21:05:18 +0200

Brian Takashi Hooper wrote:
> Hi there,
> [snip]
> > [M.-A. Lemburg]:
> > > I'm currently using my own scheme for solving the NLS problem,
> > > but it currently only work on a per-process basis. What I am
> > > looking for now, is a way to be able to set the language
> > > on a per user (of a single server process) basis.
> > >
> > > Is the gettext approach useful for this too, i.e. does it
> > > allow fast switching of the target language ?
> >
> > Not as is.
> I also ran into this same problem and made a slightly expanded Python
> implementation of gettext (based on Peter's!) that adds a few
> calls to allow the language to explicitly be set for each call, which
> makes it a little more appropriate for applications where each thread,
> or perhaps even each call, might have a different language preference.
> I've also experimentally used interpositioning with a hacked version of
> gettext, compiled as a .so, to enable a C version of the same stuff
> (basically, just allowing an explicit language argument to dcgettext,
> which if supplied is used instead of getting the language from the
> environment).
> Does this seem useful to anyone?  If so, I'll put the code up somewheres
> (actually, even if not, what the heck.)

If I understand this right, Peter's version does not need the
GPLed gettext lib, right ? What are the license terms for
the Python gettext version and your modified one ?

Marc-Andre Lemburg
Python Pages: