Blame Manuals/RepoReference/en_US/Directories/trunk/Locales.texinfo

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