Appendix 4 : Internationalization

– how to add a new translation –

Goozzee uses the gettext system to automatically translate its interface into other languages. For now, only three languages are supported (English, French and Dutch). But it's fairly easy to add support for other languages.

Translation files

At startup, Goozzee searches for a directory named 'locale'. The location of this directory varies according to the operating system :
  • on Windows : in Program Files\Goozzee\bin
  • on Linux : in /use/share/goozzee/
  • on Mac OSX : in gozzee.app/Contents/Resources
This directory contains the following subdirectories / files :
  • en
    • goozzee.po
    • goozzee.mo
    • wxstd.po
    • wxstd.mo
  • fr
    • goozzee.po
    • goozzee.mo
    • wxstd.po
    • wxstd.mo
  • nl
    • goozzee.po
    • goozzee.mo
    • wxstd.po
    • wxstd.mo
As you can see, each subdirectory is named with a two letters language code, and always contains four files :
  • goozzee.po and goozzee.mo contain messages specific to Goozzee
  • wxstd.po and wxstd.mo contain generic wxWidgets messages.
The interesting one are the goozzee.* file. goozzee.po is a source file, used to generate goozzee.mo (which will be read by the program at execution time.)

Creating a PO file

To add support for a new language (for example Norwegian),
  • either the directory for your language already exists, and you'll just have to fill the goozzee.po file with your translated messages.
  • or the directory for your language doesn't exit yet, so you must first create the directory structure for that language :
    • Create a directory named after the two letters identifying your language.
    • Copy the .po files from the 'en' directory into your new directory.
    • Edit the goozzee.po file and translate all the messages into your language. Don't touch the lines starting with 'msgid', just modify the ones starting with 'msgstr'
You can then edit the goozzee.po file using a simple text editor such as Notepad, Textedit or vi, or with some specialized tool such as Poedit.

Generating an MO file

Once your goozzee.po file is ready, generate the corresponding goozzee.mo file. If you use Poedit, it will do it automatically for you. If you use a simple text editor, you have to run the msgfmt command to generate the .mo file.

When the goozee.mo file is ready, just launch Goozzee, and you new language will automatically be available in the Preferences window.

Beware that, on Linux, you must first install the operating system language files corresponding to the language you want to use. Otherwise, you'll get many warning at execution time.

And if you make such a translation, please post your goozzee.po file on the Goozzee forum, so that other people can use it... :-)