# 11 Adapting the Program to a Different Language

VIEWMOL has been written to take full advantage of the language independence of the X Window System. All program messages, menus, dialog box texts etc. are stored outside of the program in resource files. Therefore it is possible that different users can run the same VIEWMOL executable in different languages on the same computer. Currently, eight languages are supported: English, French5, German, Hungarian6, Polish7, Russian8, Spanish9, and (partly) Turkish9. To adapt VIEWMOL to another language only the `Viewmol` file in `$VIEWMOLPATH/locale/en_US` has to be translated and copied into the corresponding language directory under `$VIEWMOLPATH/locale`. For a native speaker of the language this will take between 45 and 60 minutes.

The `Viewmol` files provided with VIEWMOL have three sections. The first section is related to the installation of external support programs, the second section contains default settings (see p. ). The third section contains all language dependent messages and this is the only section which needs translation. To translate, translate everything right of the colon. The strings '%s', '%d', or '%f' mark the position of names or numbers which are filled in by the program and must remain in the translated version at the appropriate position. After translation install the new `Viewmol` file as described in the Installation section (cf. p. ) and VIEWMOL will talk in your language. The author would appreciate to get a copy of the translated resource file for inclusion in the next public release.

The internationalization of Python scripts is handled using the `gettext` facility available with Python. Messages for Python scripts are stored in the `$VIEWMOLPATH/locale/X/LC_MESSAGES/Viewmol.po` file where `X` is an abbreviation indicating the language. All lines starting with `msgstr` need to be translated. After the translation the corresponding binary files can be created by executing `make translations` in the `$VIEWMOLPATH/source` directory.

#### Footnotes

... French 5
  Many thanks to Ludovic Douillard (douillard@DRECAM.cea.fr).
... Hungarian 6
  Many thanks to Gábor Magyarfalvi (gmagyarf@para.chem.elte.hu).
... Polish 7
  Many thanks to Nikodem Kuznik (nikodem@zeus.polsl.gliwice.pl).
... Russian 8
  My Russian is a little bit rusty. Apologies for any grammar mistakes and/or unrecognizable meanings. I would appreciate a check by a native speaker.
... Spanish 9
  Many thanks to Jose R. Valverde (jrvalverde@cnb.uam.es).
... Spanish 9
  Many thanks to Murat Guner (muratguner1982@hotmail.com).