TRANSLATIONS OF FOTOXX

The instructions here apply to the GUI interface (menus and dialogs).
For user guide translations, see below.

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

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

In addition to these "lc" translation files, files for regional 
languages or dialects may also be installed. These file names include 
the region code as follows:
   /usr/local/share/fotoxx/locales/lc_RC/fotoxx.po
   /usr/local/share/fotoxx/locales/lc_RC/zfuncs.po

"lc_RC" is a combined language and region code, e.g. "de_AT" for 
Austrian German, or "zh_TW" for Taiwan Chinese. This is also the
locale of the target computer system, as shown by the following
command: $ echo $LANG

If both standard and regional translation files are present, BOTH
are read and processed. If the same English text is translated in
both files, the regional translation will be used. Thus you can make
a regional .po file that contains only the exceptions to standard 
translations.

To change or add-to an existing translation file:

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 (kornelix2@googlemail.com) 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. Steps 2 and 3 are useful to 
find errors (e.g. format codes in a translated string do not match 
those in the English string).

To add a new language:

1. Move the source program files fotoxx-N.N.cc and zfuncs.cc from 
   the release tarball into some convenient directory.
2. Create template files (.pot) from the source programs (.cc)
      $ xgettext -s --keyword=ZTX -o fotoxx.pot fotoxx-N.N.cc
      $ xgettext -s --keyword=ZTX -o zfuncs.pot zfuncs.cc
3. Create translation files (.po) from the template files (.pot)
      $ msginit -l lc -o fotoxx.po -i fotoxx.pot
      $ msginit -l lc -o zfuncs.po -i zfuncs.pot
   "lc" 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/lc
6. Move the two .po files into the installation location:
       /usr/local/share/fotoxx/locales/lc/fotoxx.po
       /usr/local/share/fotoxx/locales/lc/zfuncs.po
7. Run fotoxx and check how the translations look.
8. Send the new .po files to me (kornelix2@googlemail.com) 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.

User Guide translations:

The user guide is named as follows (assuming a default installation):
   /usr/local/share/doc/fotoxx/userguide-lc.html
   /usr/local/share/doc/fotoxx/userguide-lc_RC.html

The file is a text HTML file, which may be edited with any HTML editor.
"lc" is a standard language code, and "lc_RC" is a language and region 
code combination. The user locale in $LANG or $LANGUAGE is used to find 
"lc_RC". If a file with the region code is present, this file is used, 
otherwise the standard language version is used. If this is not found, 
the english file (userguide-en.html) is used.

If you make a new or revised translation, please send it to me so that
it can be included in the source distribution (kornelix2@googlemail.com).


