Blame Manuals/RepoReferences/en_US/Directories/trunk/Scripts/Functions/Locale.texinfo

b32b45
@subheading Name
b32b45
b32b45
The @code{locale} functionlity is part of @command{centos-art.sh}
b32b45
script and standardizes localization tasks inside the working copy of
b32b45
CentOS Artwork Repository.
b32b45
b32b45
@subheading Synopsis
b32b45
b32b45
@command{centos-art locale [OPTIONS] path/to/dir}
b32b45
b32b45
The @file{path/to/dir} parameter specifies what directory structure
b32b45
inside the working copy of CentOS Artwork Repository you want to
b32b45
create translation messages for.
b32b45
b32b45
The @code{locale} functionality of @command{centos-art.sh} script
b32b45
accepts the following options:
b32b45
b32b45
@table @option
b32b45
@item --quiet
b32b45
b32b45
Supress all output messages except error messages.  When this option
b32b45
is passed, all confirmation requests are supressed as well and a
b32b45
possitive answer is assumed for them, just as if the
b32b45
@option{--answer-yes} option had been provided.
b32b45
b32b45
@item --answer-yes
b32b45
b32b45
Assume `yes' to all confirmation requests.
b32b45
b32b45
@item --filter="REGEX"
b32b45
b32b45
Reduce the list of files to process using @samp{REGEX} as pattern.
b32b45
You can use this option in combination with @file{path/to/dir} in
b32b45
order to control the amount of files you want to produce as
b32b45
base-rendition.  The deeper you go into the directory structure the
b32b45
more specific you'll be about the component you want to produce. When
b32b45
you cannot go deeper into the directory structure, you can use
b32b45
@option{--filter} option to reduce the list of files.
b32b45
b32b45
@item --dont-commit-changes
b32b45
b32b45
Supress all commit and update actions realized over files, before and
b32b45
after the action itself had took place over files in the working copy.
b32b45
b32b45
@item --update
b32b45
b32b45
This option extracts translatable strings from both XML-based files
b32b45
(using @command{xml2po}) and shell scripts (using @command{xgettext})
b32b45
under @file{path/to/dir}. Translatable strings are initially stored in
b32b45
portable objects templates (.pot) which are later merged into portable
b32b45
objects (.po) in order to be converted as machine objects (.mo).
b32b45
b32b45
Use this option each time you change translatable stirngs inside
b32b45
design models and script files.
b32b45
b32b45
@item --edit
b32b45
b32b45
This option edits the portable object related to @file{path/to/dir}
b32b45
location.
b32b45
b32b45
Use this option after updating portable objects (through
b32b45
@option{--update} option) in order to change the language-specific
b32b45
information of translatable strings.
b32b45
b32b45
@item --dont-create-mo
b32b45
b32b45
This option supresses the creation of machine objects.
b32b45
b32b45
@end table
b32b45
b32b45
@subheading Description
b32b45
b32b45
The CentOS Artwork Repository exists to cover the visual needs of The
b32b45
CentOS Project Corporate Identity. The CentOS Project is an
b32b45
internationl project and sometimes requires contents in different
b32b45
languages. So, in that sake, the CentOS Artwork Repository is designed
b32b45
to produce content in as many locales as supported by The CentOS
b32b45
Distribution, the platform that supports the whole CentOS Artwork
b32b45
Repository, both in workstations and server.
b32b45
b32b45
@quotation
b32b45
@strong{Tip} To know what locales are supported by The CentOS
b32b45
Distribution you are currently using, run the following command:
b32b45
b32b45
@verbatim
b32b45
locale -a | less
b32b45
@end verbatim
b32b45
@end quotation
b32b45
b32b45
The localization process is very tied to the input files we want to
b32b45
provide localized messages for. Inside the CentOS Artwork Repository,
b32b45
it is possible to localize XML files (e.g., SVG, XHTML, Docbook) and
b32b45
programs written in most popular programming languages (e.g., C, C++,
b32b45
C#, Shell Scripts, Python, Java, GNU awk, PHP, etc.).
b32b45
b32b45
@subsubheading Design models localization
b32b45
b32b45
Design models are used as input to produce most images and some other
b32b45
contents as well. Design models are always XML-based files (e.g., SVG,
b32b45
XHTML, Docbook), so the @code{locale} functionality uses the
b32b45
@command{xml2po} program to create protable objects from them under
b32b45
@file{trunk/Locales/Models} directory. Portable objects contain the
b32b45
relation between message id and message translation, as translator,
b32b45
need to take care of.
b32b45
b32b45
Thanks to @command{xml2po}, it is possible for the @code{locale}
b32b45
functionality to separate designing tasks from the translating tasks.
b32b45
It is possible for graphic designers to concentrate their efforts on
b32b45
designing models in English language while translators take care of
b32b45
their localization using the @option{--update} and @option{--edit}
b32b45
options as much as it be needed.
b32b45
b32b45
Once design models have been localized, rendering them in different
b32b45
language is a matter using the @code{render} functionality of
b32b45
@command{centos-art.sh} script. @xref{Directories trunk Scripts
b32b45
Functions Render}, for more information about it.
b32b45
b32b45
@subsubheading Shell script localization
b32b45
b32b45
The @code{locale} functionality is used to localize the
b32b45
@command{centos-art.sh} script itself. The @command{centos-art.sh}
b32b45
script is a shell script written in Bash, so the @code{locale}
b32b45
functionality uses the @command{gettext} tools to retrive translatable
b32b45
strings, create portable objects and machine objects.
b32b45
b32b45
Thanks to @command{gettext}, it is possible for the @code{locale}
b32b45
functionality to separate programming tasks from the translating
b32b45
tasks. It is possible for programmer to concentrate their efforts in
b32b45
programming output messages in English language while translators take
b32b45
care of their localization using the @option{--update} and
b32b45
@option{--edit} options as much as it be needed.
b32b45
b32b45
Once @command{centos-art.sh} script has been localized, the translated
b32b45
messages should be immediatly visible to you, the next time you
b32b45
execute the @command{centos-art.sh} script
b32b45
b32b45
@quotation
b32b45
@strong{Note} 
b32b45
In order to localize translatable strings from English language to
b32b45
another language you need to be sure the @env{LANG} environment
b32b45
variable has been already set to the locale code you want to localize
b32b45
message for or see them printed out before running the
b32b45
@command{centos-art.sh} script.  Localizing English language to itself
b32b45
is not supported.
b32b45
@end quotation
b32b45
b32b45
@subheading Examples
b32b45
b32b45
@table @command
b32b45
@item centos-art locale --update trunk/Identity/Models/Default/Distro/5/Anaconda
b32b45
b32b45
This command updates portable objects related to Anaconda default
b32b45
design models of The CentOS Distribution major release 5. The update
b32b45
action consists on adding new translatable strings or removing old
b32b45
translatable strings from portable objects in order to keep both the
b32b45
portable object and the design model consistent.
b32b45
b32b45
This command is executed by translators once the graphic designers
b32b45
have committed updates to Anaconda default design models (e.g., slide
b32b45
text changes).
b32b45
b32b45
@item centos-art locale --edit trunk/Identity/Models/Default/Distro/5/Anaconda
b32b45
b32b45
This command let translators to edit portable objects related to
b32b45
Anaconda default design models of The CentOS Distribution major
b32b45
release 5. The edit action is where the translator localize
b32b45
translatable strings in English language to another language.
b32b45
b32b45
When portable objects for XML-base files are produced, there is no
b32b45
need to retain the machine object format, so we the
b32b45
@option{--dont-create-mo} is automatically assumed.
b32b45
b32b45
@item centos-art locale --update trunk/Scripts
b32b45
b32b45
This command updates portable objects related to
b32b45
@command{centos-art.sh} script. The update action consists on adding
b32b45
new translatable strings or removing old translatable strings from
b32b45
portable objects in order to keep both the portable object and the
b32b45
@command{centos-art.sh} script to be consistent one another.
b32b45
b32b45
This command is executed by translators once the programmers have
b32b45
committed updates @command{centos-art.sh} script.
b32b45
b32b45
@item centos-art locale --edit trunk/Scripts
b32b45
b32b45
This command edits portable objects related to @command{centos-art.sh}
b32b45
script in your prefered language.
b32b45
b32b45
@item centos-art locale --update trunk/Manual/repository.xhtml
b32b45
b32b45
This command updates portable objects for the XHTML output of the
b32b45
repository documentation manual. The portable objects are created in
b32b45
your prefered language and can be used to produced localized versions
b32b45
of the manual in XHTML format.
b32b45
b32b45
The update action consists on adding new translatable strings to or
b32b45
removing old translatable strings from the portable objects in order
b32b45
to keep both the portable object and the manual XHTML output
b32b45
consistent one another.
b32b45
b32b45
People execute this command after committing changes to the repository
b32b45
documentation manual.
b32b45
b32b45
@item centos-art locale --edit trunk/Manual/repository.xhtml
b32b45
b32b45
This command takes all the repository documentation manual XHTML
b32b45
output files, which have not been translated yet inside the
b32b45
@file{trunk/Manual/repository.xhtml} directory, as input to produce
b32b45
portable objects from them so as for you to localize translatable
b32b45
strings to your prefered language (e.g., as specified by the
b32b45
@env{LANG} environment variable).
b32b45
b32b45
Once the portable objects have been created they are used to produce
b32b45
the translated version of the manual in XHTML format under the
b32b45
@file{trunk/Manual/repository.xml/LANG} directory, where @samp{LANG}
b32b45
refers your prefered language. The translated version of the XHTML
b32b45
files is produced using the @code{render} functionality of
b32b45
@command{centos-art.sh} script (@pxref{Directories trunk Scripts
b32b45
Functions Render}).
b32b45
b32b45
When your prefered language is other but English, the
b32b45
@command{centos-art.sh} script takes care of updating both the
b32b45
portable objects and the translated version of files after you've
b32b45
edited a manual documentation entry, using the @code{help}
b32b45
functionality of @command{centos-art.sh} script (@pxref{Directories
b32b45
trunk Scripts Functions Help}). In other situations, you need to do
b32b45
these actions by yourself.
b32b45
b32b45
@end table
b32b45
b32b45
@subheading Author
b32b45
b32b45
Written by Alain Reguera Delgado.
b32b45
b32b45
@subheading Reporting bugs
b32b45
b32b45
Report bugs to @email{centos-artwork@@centos.org} mailing list.
b32b45
b32b45
@subheading Copyright
b32b45
b32b45
Copyright @copyright{}  2009, 2010, 2011 The CentOS Project.
b32b45
b32b45
This is free software.  You may redistribute copies of it under the
b32b45
terms of the GNU General Public License (@pxref{GNU General Public
b32b45
License}).  There is NO WARRANTY, to the extent permitted by law.
b32b45
b32b45
@subheading See also
b32b45
b32b45
@itemize
b32b45
@item The GNU @command{gettext} tools documentation (@command{info gettext})
b32b45
@item The @command{xml2po} command documentation (@command{man xml2po})
b32b45
@item @ref{Directories trunk Scripts Functions}
b32b45
@item @ref{Directories trunk Scripts}
b32b45
@item @ref{Directories trunk}
b32b45
@end itemize