TRANSLATIONS OF FOTOXX

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

Translation files are normally as follows:
   /usr/share/fotoxx/locales/fotoxx-lc.po

"lc" is a standard 2-character language code, e.g. "de" for German, 
or a combination language and region code formatted "lc_RC", 
e.g. "de_AT" for Austrian German.

"lc" or "lc_RC" is also the locale of the target computer system, 
as shown by the following command: $ echo $LANG

The .po file contains the English phrases used by fotoxx, with the
corresponding translations for language "lc" or language and region
"lc_RC". It can be edited with any text editor or one of the special
editors for .po files (e.g. poedit).

REVISE AN EXISTING LANGUAGE AND TRANSLATION

   1. Edit fotoxx-lc.po to add or update translation strings.
   2. Open a terminal window and go to the location of the .po file.
   3. Compile the .po file to check for errors:
      $ msgfmt -v --check-format  -o /dev/null  fotoxx-lc.po
   4. Run fotoxx and check how the translations look.
   5. Send the modified .po file to me (kornelix2@gmail.com) 
      so it can be included in future releases.

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 *.cc and *.h from the release 
      tarball into some convenient directory.
   2. Create template files (.pot) from the source programs
         $ xgettext -s --keyword=ZTX -o fotoxx.pot *.cc *.h
   3. Create translation files (.po) from the template files (.pot)
         $ msginit -l lc -o fotoxx-lc.po -i fotoxx.pot
      "lc" is the language and region code for the new language.
      If asked for an e-mail address, reply with Enter to ignore.
   4. Edit the .po file to insert translations for all text.
   5. Move the .po file to the installation directory:
         /usr/share/fotoxx/locales/fotoxx-lc.po
   6. Run fotoxx and check how the translations look.
   7. Send the new .po file to me (kornelix2@gmail.com) 
      so it 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-lc.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".

INTERACTIVE TRANSLATIONS

Use the fotoxx menu "Edit Translations" to revise 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 fotoxx-lc.po file 
as described above, which must be installed to start with. Translations 
may be partly or entirely missing at this point - it is only important 
that all the English strings are present in the .po file. This method
is best suited for updating the translation after a new release of
fotoxx, or to improve the translation. 

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 is copied 
and updated from the edit window. This edited .po file is placed in 
/home/<user>/.fotoxx/locales/fotoxx-lc.po. Each time this process
is started, a new popup text window is created for new translations, 
and these are accumulated in the .po file. 

When the interactive translation function is started, you can choose to 
show only the 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 at startup. If the function
is started again later, the option to show all translations or only the
missing translations can be set again.

When finished, replace the installation .po file in 
  /usr/share/fotoxx/locales/fotoxx-lc.po 
with the edited .po file in
  /home/<user>/.fotoxx/locales/fotoxx-lc.po
Delete the edited .po file 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 file to 
me for inclusion in future releases (kornelix2@gmail.com).

USER GUIDE TRANSLATION

The user guide is normally found here:
   /usr/share/doc/fotoxx/userguide-lc.html

The file is a text HTML file, which may be edited with any HTML editor.
"lc" (or "lc_RC") is the language code or language and region code. 
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@gmail.com).


