Blame Manuals/Filesystem/trunk/Locales.texi

010b2d
The @file{trunk/Locales} directory exists to store the translation
010b2d
messages used to produce content in different languages.
010b2d
010b2d
Translation messages are organized using the directory structure of
010b2d
the component being translated. For example, if we want to provide
010b2d
translation messages for @file{trunk/Manuals/Filesystem}, then the
010b2d
@file{trunk/Locales/Manuals/Filesystem} directory needs to be created.
010b2d
010b2d
Once the locale directory exists for the component we want to provide
010b2d
translation messages for, it is necessary to create the translation
010b2d
files where translation messages are. The translation files follows
010b2d
the concepts of @command{xml2po} and GNU @command{gettext} tools.
010b2d
010b2d
The basic translation process is as follow: first, translatable
010b2d
strings are extracted from files and a portable object template (.pot)
010b2d
is created or updated with the information. Using the portable object
010b2d
template, a portable object (.po) is created or updated for translator
010b2d
to locale the messages retrived.  Finally, a machine object (.mo) is
010b2d
created from portable object to sotore the translated messages.
010b2d
010b2d
Inside the repository there are two ways to retrive translatable
010b2d
strings from files. The first one is through @command{xml2po} command
010b2d
and the second through @command{xgettext} command. The @command{xml2po}
010b2d
is used to retrive translatable strings from XML files (e.g., Scalable
010b2d
Vector Graphics, DocBook, etc.) and the @command{xgettext} command is
010b2d
used to retrive translatable strings from shell scripts files (e.g.,
010b2d
the files that make the @command{centos-art.sh} command-line
010b2d
interface).
010b2d
010b2d
When translatable strings are retrived from XML files, using the
010b2d
@command{xml2po} command, there is no need to create the machine
010b2d
object as we do when translatable strings ar retrived from shell
010b2d
files, using the @command{xgettext} command. The @command{xml2po}
010b2d
produces a temporal machine object in order to create a translated XML
010b2d
file. Once the translated XML file has been created the machine object
010b2d
is no longer needed. On the other hand, the machine object produced by
010b2d
the @command{xgettext} command is required by the system in order for
010b2d
the show shell script localized messages.
010b2d
010b2d
Another difference between @command{xml2po} and @command{xgettext} we
010b2d
need to be aware of is the directory structure used to store machine
010b2d
objects. In @command{xml2po}, the machine object is created in the
010b2d
current working directory as @file{.xml2po.mo} and can be safetly
010b2d
removed once the translated XML file has been created. In the case of
010b2d
@command{xgettext}, the machine object needs to be stored in the
010b2d
@file{$TEXTDOMAIN/$LOCALE/LL_MESSAGES/$TEXTDOMAIN.mo} file in order
010b2d
for the system to interpret it and should not be removed since it is
010b2d
the file that contain the translation messages themselves.
010b2d
dd9fb7
Automation of localization tasks is achived through the @code{locale}
fd83ec
functionality of command-line interface.
fd83ec
fd83ec
@menu
462b4d
* trunk Scripts Bash Cli Functions Locale::
fd83ec
@end menu
6a10bd