[nvda] Re: Where went the messages files to?

Just did some further research on this. Merging message files is actually pretty simple:
msgmerge -U language_file.po template.pot
Obsolete strings (strings that no longer exist in the template) get commented out and new strings get added with a null translation. Thus, you can easily find strings that need translating by searching for
msgstr ""
So it's just a matter of getting the header correct at the top of the .po file (you can specify the charset, etc. to use there) and making sure Python getttext actually will pull in the correct language file in Windows and we should be good to go. We need to specify a directory in which to find the .mo files, too. Python also needs to know what language to use, which it generally gets from one of several environment variables, one of which is LANG. Thus, we need to do something like the following:
import os
os.environ["LANG"] = "blah" # Get this from Windows somehow
import gettext
gettext.install("nvda", "locale")
"locale" is the locale directory (i.e. under the NVDA current directory). Now, gettext will look for a .mo file in locale/LANG/lc_messages.mo, where LANG is the LANG environment variable from earlier.

Jamie

--
James Teh
Email: jamie@xxxxxxxxxxx
WWW: http://www.jantrid.net/
MSN Messenger: jamie@xxxxxxxxxxx
Jabber: jteh@xxxxxxxxxx
Yahoo: jcs_teh
To post messages to the list send email to
nvda@xxxxxxxxxxxxx
To unsubscribe from the list send a blank message to:
nvda-request@xxxxxxxxxxxxx
with 'unsubscribe' in the Subject field.
Thank you for your continued support of Nonvisual Desktop Access, an open 
source free screen reader for Microsoft Windows:
http://www.kulgan.net/nvda/

Other related posts: