Previous | Next | Up | Table of Contents

8. Translating Installers

The contents of the Available Languages list in the IPF GUI is generated dynamically by IPF at startup. The IPF installation folder (typically C:\Program Files\IPF contains a subfolder locale. Subfolders of the locale folder determine the items displayed in the IPF available languages list.

To add a new language to IPF it is necessary to add a folder to the locale subdirectory. The name of this directory must contain a two letter language code - en for English, for example. The list of language codes is set by the ISO 639 standard (it is usual to use lower case, however). The directory can also contain a 2 letter country code suffix. The list of 2 letter country codes is contained in the ISO 3166-1-alpha-2 standard. As a full example, pt_BR would be the correct folder name for Brazilian Portuguese.

Inside the language folder, a subfolder LC_MESSAGES must be created, and inside this subfolder the translated messages file must be copied. See the existing language folders for an example. Producing a file is described below.

Producing a Language Translation

A language translation is made by editing a file containing the English messages to add translations, and then using a tool to compile the human readable file of translations into a more efficient binary format. By convention, the human readable file has a .po file suffix, and the compiled file has a .mo suffix. For this application, the compiled file must be called as mentioned above.

The untranslated messages for the installer are contained in the messages template file driver.pot, located in the folder locale_src of the IPF installation folder. Before editing anything, first copy the driver.pot file to driver.po so that the master POT file does not get changed. The recommended tool to then use for editing the PO file is poEdit. poEdit makes managing the PO file structure easier than a regular text editor, and it can perform also some checks for likely formatting errors in the translation text. poEdit also can automatically produce the MO file for you when you save the PO file.

Other standard tools that may be of interest are the GNU gettext command line tools, including the program msgfmt for converting a PO file to a MO file.