Name
----

The locale functionlity is part of centos-art.sh script and standardizes localization tasks inside the working copy of CentOS Artwork Repository.

Synopsis
--------

centos-art locale [OPTIONS] path/to/dir

The path/to/dir parameter specifies what directory structure inside the working copy of CentOS Artwork Repository you want to create translation messages for.

The locale functionality of centos-art.sh script accepts the following options:

--quiet

     Supress all output messages except error messages.  When this option is passed, all confirmation requests are supressed as well and a possitive answer is assumed for them, just as if the --answer-yes option had been provided.

--answer-yes

     Assume `yes' to all confirmation requests.

--filter="REGEX"

     Reduce the list of files to process using REGEX as pattern. You can use this option in combination with path/to/dir in order to control the amount of files you want to produce as base-rendition.  The deeper you go into the directory structure the more specific you'll be about the component you want to produce. When you cannot go deeper into the directory structure, you can use --filter option to reduce the list of files.

--dont-commit-changes

     Supress all commit and update actions realized over files, before and after the action itself had took place over files in the working copy.

--update

     This option extracts translatable strings from both XML-based files (using xml2po) and shell scripts (using xgettext) under path/to/dir. Translatable strings are initially stored in portable objects templates (.pot) which are later merged into portable objects (.po) in order to be converted as machine objects (.mo).

     Use this option each time you change translatable stirngs inside design models and script files.

--edit

     This option edits the portable object related to path/to/dir location.

     Use this option after updating portable objects (through --update option) in order to change the language-specific information of translatable strings.

--dont-create-mo

     This option supresses the creation of machine objects.

Description
-----------

The CentOS Artwork Repository exists to cover the visual needs of The CentOS Project Corporate Identity. The CentOS Project is an internationl project and sometimes requires contents in different languages. So, in that sake, the CentOS Artwork Repository is designed to produce content in as many locales as supported by The CentOS Distribution, the platform that supports the whole CentOS Artwork Repository, both in workstations and server.

     Tip To know what locales are supported by The CentOS Distribution you are currently using, run the following command:

     locale -a | less

The localization process is very tied to the input files we want to provide localized messages for. Inside the CentOS Artwork Repository, it is possible to localize XML files (e.g., SVG, XHTML, Docbook) and programs written in most popular programming languages (e.g., C, C++, C#, Shell Scripts, Python, Java, GNU awk, PHP, etc.).

Design models localization
..........................

Design models are used as input to produce most images and some other contents as well. Design models are always XML-based files (e.g., SVG, XHTML, Docbook), so the locale functionality uses the xml2po program to create protable objects from them under trunk/Locales/Models directory. Portable objects contain the relation between message id and message translation, as translator, need to take care of.

Thanks to xml2po, it is possible for the locale functionality to separate designing tasks from the translating tasks. It is possible for graphic designers to concentrate their efforts on designing models in English language while translators take care of their localization using the --update and --edit options as much as it be needed.

Once design models have been localized, rendering them in different language is a matter using the render functionality of centos-art.sh script. See Directories trunk Scripts Functions Render, for more information about it.

Shell script localization
.........................

The locale functionality is used to localize the centos-art.sh script itself. The centos-art.sh script is a shell script written in Bash, so the locale functionality uses the gettext tools to retrive translatable strings, create portable objects and machine objects.

Thanks to gettext, it is possible for the locale functionality to separate programming tasks from the translating tasks. It is possible for programmer to concentrate their efforts in programming output messages in English language while translators take care of their localization using the --update and --edit options as much as it be needed.

Once centos-art.sh script has been localized, the translated messages should be immediatly visible to you, the next time you execute the centos-art.sh script

     Note In order to localize translatable strings from English language to another language you need to be sure the LANG environment variable has been already set to the locale code you want to localize message for or see them printed out before running the centos-art.sh script.  Localizing English language to itself is not supported.

Examples
--------

centos-art locale --update trunk/Identity/Models/Default/Distro/5/Anaconda

     This command updates portable objects related to Anaconda default design models of The CentOS Distribution major release 5. The update action consists on adding new translatable strings or removing old translatable strings from portable objects in order to keep both the portable object and the design model consistent.

     This command is executed by translators once the graphic designers have committed updates to Anaconda default design models (e.g., slide text changes).

centos-art locale --edit trunk/Identity/Models/Default/Distro/5/Anaconda

     This command let translators to edit portable objects related to Anaconda default design models of The CentOS Distribution major release 5. The edit action is where the translator localize translatable strings in English language to another language.

     When portable objects for XML-base files are produced, there is no need to retain the machine object format, so we the --dont-create-mo is automatically assumed.

centos-art locale --update trunk/Scripts

     This command updates portable objects related to centos-art.sh script. The update action consists on adding new translatable strings or removing old translatable strings from portable objects in order to keep both the portable object and the centos-art.sh script to be consistent one another.

     This command is executed by translators once the programmers have committed updates centos-art.sh script.

centos-art locale --edit trunk/Scripts

     This command edits portable objects related to centos-art.sh script in your prefered language.

centos-art locale --update trunk/Manual/repository.xhtml

     This command updates portable objects for the XHTML output of the repository documentation manual. The portable objects are created in your prefered language and can be used to produced localized versions of the manual in XHTML format.

     The update action consists on adding new translatable strings to or removing old translatable strings from the portable objects in order to keep both the portable object and the manual XHTML output consistent one another.

     People execute this command after committing changes to the repository documentation manual.

centos-art locale --edit trunk/Manual/repository.xhtml

     This command takes all the repository documentation manual XHTML output files, which have not been translated yet inside the trunk/Manual/repository.xhtml directory, as input to produce portable objects from them so as for you to localize translatable strings to your prefered language (e.g., as specified by the LANG environment variable).

     Once the portable objects have been created they are used to produce the translated version of the manual in XHTML format under the trunk/Manual/repository.xml/LANG directory, where LANG refers your prefered language. The translated version of the XHTML files is produced using the render functionality of centos-art.sh script (see Directories trunk Scripts Functions Render).

     When your prefered language is other but English, the centos-art.sh script takes care of updating both the portable objects and the translated version of files after you've edited a manual documentation entry, using the help functionality of centos-art.sh script (see Directories trunk Scripts Functions Help). In other situations, you need to do these actions by yourself.

Author
------

Written by Alain Reguera Delgado.

Reporting bugs
--------------

Report bugs to centos-artwork@centos.org mailing list.

Copyright
---------

Copyright ©  2009, 2010, 2011 The CentOS Project.

This is free software.  You may redistribute copies of it under the terms of the GNU General Public License (see GNU General Public License).  There is NO WARRANTY, to the extent permitted by law.

See also
--------

  * The GNU gettext tools documentation (info gettext)

  * The xml2po command documentation (man xml2po)

  * Directories trunk Scripts Functions

  * Directories trunk Scripts

  * Directories trunk