default gettext localedir on windows

Z

ZeeGeek

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?

Thanks.
 
T

Thorsten Kampe

* 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

Thorsten
 
Z

ZeeGeek

* ZeeGeek (Sun, 4 May 2008 08:59:05 -0700 (PDT))


%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)
 
T

Thorsten Kampe

* ZeeGeek (Sun, 4 May 2008 10:56:52 -0700 (PDT))
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
 
Z

ZeeGeek

* ZeeGeek (Sun, 4 May 2008 10:56:52 -0700 (PDT))




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

Yes, it's localized under linux.
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).

I'm using Simplified Chinese Windows, so I didn't set anything
specifically before firing up the program. I found that if I use
gettext.GNUTranslations to read in the .mo file, then it's localized.
But gettext.install doesn't work.
 
T

Thorsten Kampe

* ZeeGeek (Tue, 20 May 2008 09:31:27 -0700 (PDT))
Yes, it's localized under linux.


I'm using Simplified Chinese Windows, so I didn't set anything
specifically before firing up the program. I found that if I use
gettext.GNUTranslations to read in the .mo file, then it's localized.
But gettext.install doesn't work.

Well, then why don't you set the environment variable for testing!?

T.
 
Z

ZeeGeek

* ZeeGeek (Tue, 20 May 2008 09:31:27 -0700 (PDT))






Well, then why don't you set the environment variable for testing!?

Yes, it works for the program strings by setting LANG to zh_CN. But
glade strings are not localized. I did call gtk.glade.bindtextdomain
and gtk.glade.textdomain, and it works in Linux.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top