default gettext localedir on windows

Thorsten Kampe thorsten at thorstenkampe.de
Sat May 17 08:39:09 EDT 2008


* ZeeGeek (Sun, 4 May 2008 10:56:52 -0700 (PDT))
> On May 5, 1:16 am, Thorsten Kampe <thors... at thorstenkampe.de> wrote:
> > * ZeeGeek (Sun, 4 May 2008 08:59:05 -0700 (PDT))
> >
> > > Hi, what's the default localedir for gettext module on windows? In
> > > Linux, it's /usr/share/locale. Where should I put the *.mo file in
> > > order to make the translation work?
> >
> > %PYTHONHOME%\share\locale
> 
> I tried moving the *.mo file into %PYTHONHOME%\share\locale\zh_CN
> \LC_MESSAGES, but still no luck. The following is the code snippet I
> use:
> 
> import gettext
> gettext.install('testprogram', unicode = True)

The syntax is correct. Is the test program localised under Linux or 
Cygwin? If not then the error is somewhere in your application.

How did you try to set the language on Windows? It works for me on Vista 
with "set LANG=de" or "set LANGUAGE=de" while I think under XP it had to 
be "set LANG=de_DE" (LANGUAGE or de alone did not work if I remember 
correctly).

Thorsten



More information about the Python-list mailing list