TRANSLATIONS OF FOTOXX

The instructions here apply to the GUI interface (menus and dialogs).

There are two GUI translation files (assuming a default installation):
   /usr/local/share/fotoxx/locales/xx/fotoxx.po
   /usr/local/share/fotoxx/locales/xx/zfuncs.po

"fotoxx" is the main program and "zfuncs" is a collection of utility 
programs. "xx" is the 2-character language code: de, es, fr, etc.  
These two .po files contain the English phrases used by fotoxx and 
zfuncs with their corresponding translations. They can be edited with 
any text editor or one of the special editors for .po files.

To change or add-to existing translation files:

1. Edit fotoxx.po and zfuncs.po to add or update translations.
2. Open a terminal window and go to the location of these files.
3. Compile the .po files to check for errors:
   $ msgfmt -v --check-format  -o /dev/null  fotoxx.po
   $ msgfmt -v --check-format  -o /dev/null  zfuncs.po
4. Run fotoxx and check how the translations look.
5. Send the modified .po files to me (kornelix@yahoo.de) so they
   can be included in future releases.

NOTE: 
Steps 2 and 3 are optional. The usual binary translation files (.mo)
that are output by msgfmt are not needed by fotoxx. The translation 
source files (.po) are read directly by fotoxx, and changes made to
a .po file are immediately effective.

To add a new language:

1. Move the source program files fotoxx-N.N.cpp and zfuncs.cpp from 
   the release tarball into some convenient directory.
2. Create template files (.pot) from the source programs (.cpp)
      $ xgettext -s --keyword=ZTX -o fotoxx.pot fotoxx-N.N.cpp
      $ xgettext -s --keyword=ZTX -o zfuncs.pot zfuncs.cpp
3. Create translation files (.po) from the template files (.pot)
      $ msginit -l xx -o fotoxx.po -i fotoxx.pot
      $ msginit -l xx -o zfuncs.po -i zfuncs.pot
   "xx" is the 2-character code for the new language.
   If asked for an e-mail address, reply with Enter to ignore this.
4. Edit the two .po files to insert translations for all text.
5. Create an installation directory for the translation files:
      /usr/local/share/fotoxx/locales/xx
6. Move the two .po files into the installation location:
       /usr/local/share/fotoxx/locales/xx/fotoxx.po
       /usr/local/share/fotoxx/locales/xx/zfuncs.po
7. Run fotoxx and check how the translations look.
8. Send the new .po files to me (kornelix@yahoo.de) so they can be 
   included in future releases.

Problems with long translations:

English can be terse compared to other languages (e.g. "undo" becomes 
"Rückgängig machen" in German), and this can cause ugliness in the 
GUI layouts. Therefore try to make dialog labels and buttons short.

Context-dependent translations:

Sometimes the same English text will need multiple translations that
depend on context. A simple example is "save file" when used on a
toolbar button or in a menu. On the button the translation should be
short, but there is no limit for the menu. In German, this could be
"speichern" for the button and "in Datei speichern" for the menu.
The standard method to do this in Gnu gettext is fairly horrible, but
since fotoxx reads the source translations (.po files) instead of
the binaries (.mo files), a simpler method is available. The English
text may include an extra string to distinguish different contexts.
This context string is removed from the GUI output, so the user does 
not see it. The context string is any short string followed with the
special marker "::". To continue our example, the fotoxx.po file
might look like this:
   msgid "save file"
   msgstr "in Datei speichern"
   msgid "toolbar::save file"
   msgstr "speichern"
In English, fotoxx would show "save file" for both cases, and in 
German "in Datei speichern" or "speichern". Context strings may be
present in the .po files distributed with fotoxx, and also in a
newly created language .po file.


