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/share/fotoxx/locales/lc/fotoxx.po
   /usr/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/share/fotoxx/locales/lc_RC/fotoxx.po
   /usr/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.

REVISE AN EXISTING LANGUAGE AND TRANSLATION

   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).

ADD A NEW LANGUAGE AND TRANSLATION

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/share/fotoxx/locales/lc
6. Move the two .po files into the installation location:
       /usr/share/fotoxx/locales/lc/fotoxx.po
       /usr/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.

INTERACTIVE TRANSLATIONS

Use the fotoxx menu "Edit Translations" to start revising translations 
interactively as the application is being used. The advantage is that 
you can better understand the context, making translation easier and 
more accurate. The updated translations are also immediately seen in 
the application dialogs. The starting point is the two .po files as 
described above, which must be installed to start with. The translations 
may be partly or entirely missing at this point - it is only important 
that all the English strings are present in the .po files. This method
is best suited for updating the translations after a new release of
fotoxx, or to improve the translations. 

Use the menu to start the process. A popup text window is created and 
displays all english strings and their present translations as they are 
being used in the application. The format is like the .po files. Missing
translations will repeat the English phrase in place of the translation.
The translations may be edited in the window as soon as they appear. 
When the [apply] button is pressed, the original .po file(s) are copied 
and updated from the edit window. These edited versions are placed in 
/home/<user>/.fotoxx/locales/lc and .../lc_RC. Each time this process
is started, a new popup text window is created for new translations, 
and these are accumulated in the .po files. A choice can be made to show 
only missing translations or all translations. Normally only missing 
translations are needed, but revisions in existing translations can also 
be made. Once a translation is edited and the [apply] button is used, 
the translation is no longer missing and will not appear again in the 
edit window if 'only missing' was chosen. The function can be started 
again (using the application's menu) to change the mode to show no 
translations, all translations, or only missing translations.

When finished, replace the installation .po files in 
  /usr/share/fotoxx/locales/lc  and .../lc_RC
with the edited .po files in
  /home/<user>/.fotoxx/locales/lc  and .../lc_RC).
Delete the edited .po files to stop fotoxx from using them.

When fotoxx is started from a terminal window, any missing translations 
will be listed in the window. Be sure to send the finished .po files to 
me for inclusion in future releases (kornelix2@googlemail.com).

USER GUIDE TRANSLATION

The user guide is named as follows (assuming a default installation):
   /usr/share/doc/fotoxx/userguide-lc.html
   /usr/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 future releases (kornelix2@googlemail.com).


