
INTERNATIONALIZATION AND LOCALIZATION OF SHELL SCRIPTS

4 - Localization, usage and maintenance processes
-------------------------------------------------

*** Localization process ***

Once the POT file is available, the 'msginit' command writes a PO file
for each target language.

In PO files the "msgid" strings should never be modified, otherwise the
translation won't occur at run time.

The 'msgcmp' command allow to checks each PO file against the POT after
translation, to make sute all messages are translated.

The translator can use the 'msgfmt' command to check the layout of the
translated text.

The PO file should be carefully saved somewhere, as it will be needed for
subsequent maintenance (it is still possible to 'msgunfmt' a MO file to
re-create a PO file but then you would loose the context, which would make
it almost useless).

The checked PO file is handed over to the maintainer, who runs 'msgfmt' to
produce the MO file, then installs it. 


*** Usage process ***

The only thing the user will have to take care of is set up his preferred
language(s).

The primary way to do that is setting the LANG environment variable.

This can be done at run time, preceding the command used to run the script
with LANG=<locale>, but usually the user will set it up permanently.

For instance in Slackware Linux this will be done in editing the file(s)
/etc/profile.d/lang.sh and/or /etc/profile.d/lang.csh (see these files).

The changes will be effective at next reboot.

I suggest to use an UTF-8 locale, as for reading this document.

If the user is polyglot, another option is to set gettext's specific
LANGUAGE environment variable to specify a priority list of languages.
For instance, if LANGUAGE is set to 'de:fr' then a Deutsch translation
will be used if available, else a French translation will be used if
available, else messages will be displayed in the original language,
usually English. See gettext's manual for details.

*** Maintenance process ***

In most cases the maintenance process will be triggered by a script's
creation, modification or deletion.

In such a case the maintainer will generate a new POT file with 'xgettext'
then hand it hover to the translators.

The translators will use the new POT file to update their respective
(saved) PO files with the 'msgmerge --update' command.

Then they will edit/complete the translations, focusing on the
messages marked as "fuzzy" in the PO files, using a PO editor.

After that the PO file will be checked against the POT file with 'msgcmp',
carefully saved, handed over to the maintainer who will generate the new
MO file with 'msgfmt' and install it as in the initial localization
process.

The maintenance process triggered by a needed modification of a PO file
for a specific language is similar, only shorter: it will begin with the
update of the relevant PO file by the translator. To minimize the workload
caused by this type of maintenance, I suggest that the maintainer demand
that he or she be provided only with complete and well reviewed
translations.


Didier Spaier
