Translating NVDA

You must have the NVDA's source version installed and working fine on your machine. For these instructions, I assume you have Python 2.5 installed in c:\python25, and NVDA's source files installed in c:\source. It might be any directory, but that's the way it is on my machine.

Making a Translation for NVDA

Open a command prompt and change to NVDA's source directory by typing:

cd \source

Now enter the following command:

\python25\tools\i18n\pygettext.py -d nvda *.py *\*.py *\*\*.py

This will generate a file called "nvda.pot" in your current directory, \source. This generated file is a plain text which contains all of the specified strings to be translated.

Each line beginning with "msgid" contains an original English message surrounded by quotes. Each line beginning with "msgstr" contains empty quotes which should be filled in with the translation that corresponds to the original English message at the above line or lines. You should also fill in the first lines of the file, which hold the program's title, author, translator, language, etc. You should put an iso 639 alpha2 code of your language , e.g. de, en, fr, it. If the language is used in various countries and you would like to specify that you shal append an underscore and country code E.G. pt_BR, pt_PT, es_ES etc. You can look up your language code here if you are not sure. In addition, don't forget to specify UTF-8 in the charset field and 8bit in the Content-Transfer-Encoding field.

Once you have prepared the file, save it with the name "nvda.po" in the NVDA's source directory.

Enter a command prompt, change to source directory and type this:

\python25\tools\i18n\msgfmt.py nvda

This will generate a file called "nvda.mo" in your current directory, \source.

Change to the locale directory under \source and create a directory. Its name must correspond with the language code discussed above. Here it is pt-BR.

Inside this new xxx directory, create another one called "LC_MESSAGES" and place nvda.mo into it. Note that "LC_MESSAGES" must be capitalized.

To run NVDA in your language go to the user interface settings and change the language. You will be asked to restart NVDA. Alternatively you can edit nvda.ini within the source directory, search for the line beginning with "language", and change the language letters from "enu" to the language code of your translation.

Now you are ready to run nvda.py and it should present the translated messages already.

Updating an Existing Translation

To merge an old translation with a new one, first generate an updated nvda.pot file.

Then download msgmerge.py from: http://www.jantrid.net/misc_files/msgmerge.py and Place it in any directory. Here I have put it into \python25\tools\i18n.

Then go to a command prompt, change to the source directory and type:

\python25\tools\i18n\msgmerge.py -U nvda.po nvda.pot

You may like to create a batch file including these commands to speed it up.

This will update the translated nvda.po with the new messages from nvda.pot which are not translated yet of course.

Edit nvda.po and check it for misupdated lines, especially the first lines at the header, where MSGMerge doesn't do a perfect work, at least for me. Then look for untranslated messages and translate them. Also make sure the strings which are translated properly don't have #, fuzzy comment in fromt of them.