Blame Manuals/Texinfo/Directories/trunk/Scripts/Functions/Locale.texinfo

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