Blame Manuals/Repository/trunk/Locales.texi

066aaa
@subsection Goals
066aaa
066aaa
The @file{trunk/Translations} directory exists to:
066aaa
066aaa
@itemize
066aaa
@item Organize translation files.
066aaa
@item Organize translation templates used to produce translation files.
066aaa
@end itemize
066aaa
066aaa
@subsection Description
066aaa
066aaa
When you create artwork for CentOS distribution you find that some
066aaa
artworks need to be created for different major releases of CentOS
066aaa
distribution and inside each major release that needs to be created for
066aaa
different locales. To get an approximate idea of how many files we are
066aaa
talking about, consider the followig approximate statistic:
066aaa
066aaa
@itemize
066aaa
@item Inside CentOS distribution, there are around 30 images to
066aaa
rebrand.@footnote{This number is an approximate value and may change.
066aaa
It is mainly based on CentOS 5 rebranding experience.}
066aaa
066aaa
@item There are near to four major releases of CentOS distribution to
066aaa
rebrand in parallel development.@footnote{This value was taken from
066aaa
CentOS release schema.} 
066aaa
066aaa
@item Each CentOS distribution in parallel development supports more
066aaa
than two hundreds locales.@footnote{This value was taken from the
066aaa
output of @command{locale -a} command.}
066aaa
@end itemize
066aaa
066aaa
In order to aliviate maintainance of artwork production for such
066aaa
environment, we divided artwork production in three production lines:
066aaa
066aaa
@enumerate
066aaa
@item @xref{trunk Identity Themes Models}, to define artworks
066aaa
characteristics (e.g., dimensions, position on the screen, etc.).
066aaa
@item @xref{trunk Identity Themes Motifs}, to define artworks visual
066aaa
styles (e.g., the look and feel).
066aaa
@item Translations, to define which major releases and locales
066aaa
artworks are produced for. 
066aaa
@end enumerate
066aaa
066aaa
Inside CentOS Artwork Repository, the artworks' translation production
066aaa
line is stored under @file{trunk/Translations} directory.
066aaa
066aaa
Inside @file{trunk/Translations} directory, we use ``translation
066aaa
entries'' to organize artworks' ``translation files'' and artworks'
066aaa
``translation templates''.
066aaa
066aaa
@subsubsection Translation Entries
066aaa
@cindex Translation paths
066aaa
@cindex Translation entries
066aaa
066aaa
Translation entries exists for each artwork you want to produce.
066aaa
Translation entries can be empty directories, or directories
066aaa
containing translation files and translation templates.  
066aaa
066aaa
When translation entries are empty directories, the identity entry is
066aaa
used as reference to create file names and directories layout for
066aaa
rendered files.  In this case, the @command{centos-art} script takes
066aaa
one design template and outputs one non-translated file for each
066aaa
design template available.  This configuration is mainly used to
066aaa
produce non-translatable artworks like themes' backgrounds.
066aaa
066aaa
When translation entries contain translation files, the translation
066aaa
entry implements the CentOS release schema and is used as reference to
066aaa
create file names and directories layout for translated artworks. In
066aaa
this case, the @command{centos-art} script applies one translation
066aaa
file to one design template to create one translated instance which is
066aaa
used to output one translated file. When the translated file is
066aaa
rendered, the @command{centos-art} script remove the previous instance
066aaa
and takes the next file in the list of translation files to repate the
066aaa
whole process once again, and so on for all files in the list. This
066aaa
configuration is mainly used to produce translatable artworks like
066aaa
Anaconda progress slide images.
066aaa
066aaa
To find out correspondence between translation entries and identity
066aaa
entries, you need to look the path of both translation entries and
066aaa
identity entries. For example, if you are using the @emph{Modern}
066aaa
artisitic motif, the identity entry for Anaconda progress artwork is:
066aaa
066aaa
@verbatim
066aaa
trunk/Identity/Themes/Motifs/Modern/Distro/Anaconda/Progress
066aaa
@end verbatim
066aaa
066aaa
and its translation entry is:
066aaa
066aaa
@verbatim
066aaa
trunk/Translations/Identity/Themes/Distro/Anaconda/Progress
066aaa
@end verbatim
066aaa
066aaa
Note how the @file{Translations/} directory prefixes @file{Identity/}
066aaa
directory, also how static values (e.g., Identity, Themes, Distro,
066aaa
etc.) in the identity entry path remain in translation entry path, and
066aaa
how variable values like theme names (e.g., @emph{Modern}) are stript
066aaa
out from translation entry path. The same convenction can be applied
066aaa
to other identity entries in order to determine their translation
066aaa
entries, or to other translation entries to determine their identity
066aaa
entries.
066aaa
066aaa
@quotation
066aaa
@strong{Note} Translation entries related to identity entries under
066aaa
@file{trunk/Identity/Themes/Motifs} do not use @file{Motifs/} in the
066aaa
path.  We've done this because @file{trunk/Identity/Themes/Models}
066aaa
structure, the other structure under @file{trunk/Identity/Themes},
066aaa
doesn't require translation paths so far. So in the sake of saving
066aaa
characters space when building translation entries for
066aaa
@file{trunk/Identity/Themes/Motifs} structure, we organize Motifs
066aaa
translation entries under @file{trunk/Translations/Identity/Themes/}
066aaa
directly. 
066aaa
066aaa
If for some reason @file{trunk/Identity/Themes/Models} structure
066aaa
requires translation entries, we need to re-oraganize the current
066aaa
directory structure accordingly.
066aaa
@end quotation
066aaa
066aaa
Translation entries, as described above, can be re-used by similar
066aaa
identity entries. For example the following identity entries:
066aaa
066aaa
@verbatim
066aaa
trunk/Identity/Themes/Motifs/Modern/Distro/Anaconda/Progress/
066aaa
trunk/Identity/Themes/Motifs/TreeFlower/Distro/Anaconda/Progress/
066aaa
trunk/Identity/Themes/Motifs/Mettle/Distro/Anaconda/Progress/
066aaa
@end verbatim
066aaa
066aaa
are all valid identity entries able to re-use translation files inside
066aaa
Anaconda progress translation entry (the one shown in our example
066aaa
above). This way, you can create several identity entries and maintain
066aaa
just one translation entry for all of them.  Once you change the
066aaa
translation files inside the common translation entry, changes inside
066aaa
identity entries will take effect inside the next you render them.
066aaa
066aaa
Trying to make things plain and simple: inside CentOS Artwork
066aaa
Repository, graphic designers can concentrate their efforts in
066aaa
artworks look and feel (the identity entries), and translators in
066aaa
artworks translations (the translation entries).
066aaa
066aaa
@subsubsection Translation Markers
066aaa
@anchor{trunk:Translations:TranslationMarkers}
066aaa
@cindex Translation markers
066aaa
066aaa
Translation markers are used in ``Theme Model Designs'' and
066aaa
``Translation Files'' as replacement patterns to commit content
066aaa
translation.  When you are rendering content using
066aaa
@command{centos-art} script inisde @file{trunk/Identity} structure,
066aaa
artistic motifs and translation files are applied to model designs to
066aaa
produce translated content as result. In order to have the appropriate
066aaa
translation in content rendered, markers defintion in translation
066aaa
files should match markers in model designs exactly. 
066aaa
066aaa
Translation markers can be whatever text you want, but as convenction
066aaa
we use the following to represent releases of CentOS distribution:
066aaa
066aaa
@table @samp
066aaa
@item =MINOR_RELEASE=
066aaa
Replace with minor release of CentOS distribution. In the schema M.N, the minor
066aaa
release is represented by the N letter.
066aaa
@item =MAJOR_RELEASE=
066aaa
Replace with major release of CentOS distribution. In the schema M.N,
066aaa
the major release is represented by the M letter.
066aaa
@item =RELEASE=
066aaa
Replace the full release of CentOS distribution. It is
066aaa
@samp{=MAJOR_RELEASE=.=MINOR_RELEASE=} basically. 
066aaa
@end table
066aaa
066aaa
Specific translation markers convenctions are described inside
066aaa
specific translation entries. Read translation entries documentation
066aaa
to know more about supported translation markers.
066aaa
066aaa
Translation markers standardization creates a common point of
066aaa
reference for translators and graphic designers. To have translation
066aaa
markers well defined makes possible that translators and graphic
066aaa
designers can work together but independently one another.
066aaa
066aaa
@subsubsection Translation Files
066aaa
@cindex Translation files
066aaa
066aaa
Translation files are text files with @command{sed} commands inside,
066aaa
replacement commands mainly. As convenction, translation file names
066aaa
end in @samp{.sed}. Translation files are used by @command{centos-art}
066aaa
script to produce translated artworks for specific major releases of
066aaa
CentOS Distribution. There are common translation files, specific
066aaa
translation, and template translation files.
066aaa
066aaa
For example, the Firstboot artwork of CentOS distribution uses the
066aaa
images @file{splash-small.png} and @file{firstboot-left.png} as based
066aaa
to control its visual style. The @file{splash-small.png} image
066aaa
contains, in its graphic design, the release number information of
066aaa
CentOS distribution. So the @file{splash-small.png} is
066aaa
release-specific. In the other hand, the @file{firstboot-left.png}
066aaa
doesn't contain release number information. So the
066aaa
@file{firstboot-left.png} is not release-specific.
066aaa
066aaa
If we want to produce Firstboot artwork for different major releases
066aaa
of CentOS distribution, using a monolithic visual identity, all
066aaa
Firstboot images should have the same visual style and, at the same
066aaa
time, the release-specific information in the release-specific images. 
066aaa
066aaa
@quotation
066aaa
@strong{Note} The monolithic visual identity is implemented using
066aaa
theme models (@pxref{trunk Identity Themes Models}) and artistic
066aaa
motifs (@pxref{trunk Identity Themes Motifs}).
066aaa
@end quotation
066aaa
066aaa
Assuming that both theme models and theme motifs are ready for using,
066aaa
the initial translation entry to produce Firstboot artworks would look
066aaa
like the following:
066aaa
066aaa
@verbatim
066aaa
trunk/Translations/Identity/Themes/Distro/BootUp/Firstboot/
066aaa
|-- Tpl
066aaa
|   `-- splash-small.sed
066aaa
`-- firstboot-left.sed
066aaa
@end verbatim
066aaa
066aaa
With the translation entry above, @command{centos-art} command is able
066aaa
to produce the image @file{firstboot-left.png} only. To produce
066aaa
@file{splash-small.png} images for major releases (e.g., 3, 4, 5, and
066aaa
6) of CentOS distribution we need to produce the release-specific
066aaa
translation files using the @command{centos-art} script as following:
066aaa
066aaa
@verbatim
066aaa
centos-art render --entry=/home/centos/artwork/trunk/Translations/Identity/Themes/BootUp/Firstboot --filter='3,4,5,6'
066aaa
@end verbatim
066aaa
066aaa
The above command produces the following translation entiry:
066aaa
066aaa
@verbatim
066aaa
trunk/Translations/Identity/Themes/Distro/BootUp/Firstboot/
066aaa
|-- 3
066aaa
|   `-- splash-small.sed
066aaa
|-- 4
066aaa
|   `-- splash-small.sed
066aaa
|-- 5
066aaa
|   `-- splash-small.sed
066aaa
|-- 6
066aaa
|   `-- splash-small.sed
066aaa
|-- Tpl
066aaa
|   `-- splash-small.sed
066aaa
`-- firstboot-left.sed
066aaa
@end verbatim
066aaa
066aaa
At this point @command{centos-art} is able to produce the Firstboot
066aaa
artwork images for major releases of CentOS distribution. To add new
066aaa
release-specific translation files, run the translation rendering
066aaa
command with the release number you want to produce translation files
066aaa
for in the @samp{--filter='release-number'} argument.
066aaa
066aaa
@subsubsection Template Translation Files
066aaa
@cindex Template translation files
066aaa
066aaa
Template translation files are translation files stored inside
066aaa
translation template directory. Template translation files are used by
066aaa
@command{centos-art} script to produce specific translation files
066aaa
only. Template translation files may be empty or contain @command{sed}
066aaa
replacement commands. If template translation files are empty files,
066aaa
the final specifc translation file built from it contains
066aaa
release-specific replacement commands only. For example, see the
066aaa
following translation entry:
066aaa
066aaa
@verbatim
066aaa
trunk/Translations/Identity/Themes/Distro/BootUp/Firstboot/
066aaa
|-- 3
066aaa
|   `-- splash-small.sed
066aaa
|-- 4
066aaa
|   `-- splash-small.sed
066aaa
|-- 5
066aaa
|   `-- splash-small.sed
066aaa
|-- 6
066aaa
|   `-- splash-small.sed
066aaa
|-- Tpl
066aaa
|   `-- splash-small.sed    <-- template translation file.
066aaa
`-- firstboot-left.sed
066aaa
@end verbatim
066aaa
066aaa
In the above exmaple, the @file{splash-small.sed} file is a template
066aaa
translation file and looks like:
066aaa
066aaa
@verbatim
066aaa
# -------------------------------------
066aaa
# $Id: splash-small.sed 94 2010-09-18 10:59:42Z al $
066aaa
# -------------------------------------
066aaa
@end verbatim
066aaa
066aaa
In the above template translation file there are three comments lines,
066aaa
but when you render it, the @command{centos-art} adds the
066aaa
release-specific replacement commands. In our Firstboot example, after
066aaa
rendering Firstboot translation entry, the @file{splash-small.sed}
066aaa
translation file specific to CentOS 5, looks like the following:
066aaa
066aaa
@verbatim
066aaa
# Warning: Do not modify this file directly. This file is created
066aaa
# automatically using 'centos-art' command line interface.  Any change
066aaa
# you do in this file will be lost the next time you update
066aaa
# translation files using 'centos-art' command line interface. If you
066aaa
# want to improve the content of this translation file, improve its
066aaa
# template file instead and run the 'centos-art' command line
066aaa
# interface later to propagate your changes.
066aaa
# -------------------------------------
066aaa
# $Id: splash-small.sed 94 2010-09-18 10:59:42Z al $
066aaa
# -------------------------------------
066aaa
066aaa
# Release number information.
066aaa
s!=RELEASE=!=MAJOR_RELEASE=.=MINOR_RELEASE=!g
066aaa
s!=MINOR_RELEASE=!0!g
066aaa
s!=MAJOR_RELEASE=!5!g
066aaa
@end verbatim
066aaa
066aaa
If template translation files are not empty, replacement commands
066aaa
inside template translation files are preserved inside
066aaa
release-specific translation files.  For example, consider the English
066aaa
template translation file of Anaconda progress welcome slide.  The
066aaa
translation template directory structure looks like the following:
066aaa
066aaa
@verbatim
066aaa
trunk/Translations/Identity/Themes/Distro/Anaconda/Progress/
066aaa
`-- Tpl
066aaa
    `-- en
066aaa
        `-- 01-welcome.sed
066aaa
@end verbatim
066aaa
066aaa
and if we render translation files for CentOS 4 and CentOS 5 major
066aaa
releases, the translation entry would look like the following:
066aaa
066aaa
@verbatim
066aaa
trunk/Translations/Identity/Themes/Distro/Anaconda/Progress/
066aaa
|-- 4
066aaa
|   `-- en
066aaa
|       `-- 01-welcome.sed
066aaa
|-- 5
066aaa
|   `-- en
066aaa
|       `-- 01-welcome.sed
066aaa
`-- Tpl
066aaa
    `-- en
066aaa
        `-- 01-welcome.sed
066aaa
@end verbatim
066aaa
066aaa
@quotation
066aaa
@strong{Note} Release-specific translation directories preserve
066aaa
template translation directory structure and file names.
066aaa
@end quotation
066aaa
066aaa
In the example above, the template translation file looks like the
066aaa
following:
066aaa
066aaa
@verbatim
066aaa
# ------------------------------------------------------------
066aaa
# $Id: 01-welcome.sed 94 2010-09-18 10:59:42Z al $
066aaa
# ------------------------------------------------------------
066aaa
s/=TITLE=/Welcome to CentOS =MAJOR_RELEASE= !/
066aaa
s/=TEXT1=/Thank you for installing CentOS =MAJOR_RELEASE=./
066aaa
s/=TEXT2=/CentOS is an enterprise-class Linux Distribution derived from sources freely provided to the public by a prominent North American Enterprise Linux vendor./
066aaa
s/=TEXT3=/CentOS conforms fully with the upstream vendors redistribution policy and aims to be 100% binary compatible. CentOS mainly changes packages to remove upstream vendor branding and artwork./
066aaa
s/=TEXT4=//
066aaa
s/=TEXT5=//
066aaa
s/=TEXT6=//
066aaa
s!=URL=!http://www.centos.org/!
066aaa
@end verbatim
066aaa
066aaa
and, after render the translation entry, specific translation files
066aaa
look like the following:
066aaa
066aaa
@verbatim
066aaa
# Warning: Do not modify this file directly. This file is created
066aaa
# automatically using 'centos-art' command line interface.  Any change
066aaa
# you do in this file will be lost the next time you update
066aaa
# translation files using 'centos-art' command line interface. If you
066aaa
# want to improve the content of this translation file, improve its
066aaa
# template file instead and run the 'centos-art' command line
066aaa
# interface later to propagate your changes.
066aaa
# ------------------------------------------------------------
066aaa
# $Id: 01-welcome.sed 94 2010-09-18 10:59:42Z al $
066aaa
# ------------------------------------------------------------
066aaa
066aaa
s/=TITLE=/Welcome to CentOS =MAJOR_RELEASE= !/
066aaa
s/=TEXT1=/Thank you for installing CentOS =MAJOR_RELEASE=./
066aaa
s/=TEXT2=/CentOS is an enterprise-class Linux Distribution derived from sources freely provided to the public by a prominen t North American Enterprise Linux vendor./
066aaa
s/=TEXT3=/CentOS conforms fully with the upstream vendors redistribution policy and aims to be 100% binary compatible. Cent OS mainly changes packages to remove upstream vendor branding and artwork./
066aaa
s/=TEXT4=//
066aaa
s/=TEXT5=//
066aaa
s/=TEXT6=//
066aaa
s!=URL=!http://www.centos.org/!
066aaa
066aaa
# Release number information.
066aaa
s!=RELEASE=!=MAJOR_RELEASE=.=MINOR_RELEASE=!g
066aaa
s!=MINOR_RELEASE=!0!g
066aaa
s!=MAJOR_RELEASE=!5!g
066aaa
@end verbatim
066aaa
066aaa
In the example above, relevant lines begin with the @samp{s} word
066aaa
followed by a separation character (e.g., @samp{/}, @samp{!}, etc.).
066aaa
These lines have the following format:
066aaa
066aaa
@verbatim
066aaa
s/REGEXP/REPLACEMENT/FLAGS
066aaa
@end verbatim
066aaa
066aaa
The @samp{/} characters may be uniformly replaced by any other single
066aaa
character within any given @command{s} command.  The @samp{/}
066aaa
character (or whatever other character is used in its stead) can
066aaa
appear in the REGEXP or REPLACEMENT only if it is preceded by a
066aaa
@samp{\} character.
066aaa
066aaa
The @command{s} command is probably the most important in
066aaa
@command{sed} and has a lot of different options.  Its basic concept
066aaa
is simple: the @command{s} command attempts to match the pattern space
066aaa
against the supplied REGEXP; if the match is successful, then that
066aaa
portion of the pattern space which was matched is replaced with
066aaa
REPLACEMENT.
066aaa
066aaa
In the context of our translation files, the REGEXP is where you
066aaa
define translation markers and REPLACEMENT where you define the
066aaa
translation text you want to have after artworks rendering.  Sometimes
066aaa
we use the FLAG component with the @samp{g} command to apply the
066aaa
replacements globally.
066aaa
066aaa
@quotation
066aaa
@strong{Tip} More information about how to use @command{sed}
066aaa
replacement commands and flags is available in @command{sed}
066aaa
documentation manual. To read @command{sed} documentation manual type
066aaa
the following command: 
066aaa
@verbatim
066aaa
info sed
066aaa
@end verbatim
066aaa
@end quotation
066aaa
066aaa
Inside translation files, you can use translation markers not only
066aaa
inside the REGEXP but in the REPLACEMENT too. In order for this
066aaa
configuration to work, the REPLACEMENT of translation markers needs to
066aaa
be define @emph{after} its definition. For example, see in the
066aaa
release-specific translation file above, how the
066aaa
@samp{s!=MAJOR_RELASE=!5!g} replacement command is defined
066aaa
@emph{after} @samp{=MAJOR_RELASE=} translation marker definition in
066aaa
the REPLACEMENT of @samp{=TITLE=} translation marker replacement
066aaa
command.
066aaa
066aaa
@subsubsection Common Translation Files
066aaa
@cindex Common translation files
066aaa
066aaa
Common translation files contain common translations or no
066aaa
translation at all for their related artworks.  They are in the root
066aaa
directory of the translation entry. Common translation files create
066aaa
common artworks for all major releases of CentOS Distribution. 
066aaa
066aaa
Translation entries, with common translation files inside, look like
066aaa
the following:
066aaa
066aaa
@verbatim
066aaa
trunk/Translations/Identity/Themes/Distro/BootUp/Firstboot/
066aaa
|-- 3
066aaa
|   `-- splash-small.sed
066aaa
|-- 4
066aaa
|   `-- splash-small.sed
066aaa
|-- 5
066aaa
|   `-- splash-small.sed
066aaa
|-- 6
066aaa
|   `-- splash-small.sed
066aaa
|-- Tpl
066aaa
|   `-- splash-small.sed
066aaa
`-- firstboot-left.sed      <-- common translation file.
066aaa
@end verbatim
066aaa
066aaa
@subsubsection Specific Translation Files
066aaa
@cindex Specific translation files
066aaa
066aaa
Specific translation files contain specific translations for their
066aaa
related artworks. Specific translation files are not in the root
066aaa
directory of the translation entry, but inside directories which
066aaa
describe the type of translation they are doing. Specific translation
066aaa
files are produced automatically using the @command{centos-art}
066aaa
script.
066aaa
066aaa
@verbatim
066aaa
trunk/Translations/Identity/Themes/Distro/BootUp/Firstboot/
066aaa
|-- 3
066aaa
|   `-- splash-small.sed    <-- CentOS 3 specific translation file.
066aaa
|-- 4
066aaa
|   `-- splash-small.sed    <-- CentOS 4 specific translation file.
066aaa
|-- 5
066aaa
|   `-- splash-small.sed    <-- CentOS 5 specific translation file.
066aaa
|-- 6
066aaa
|   `-- splash-small.sed    <-- CentOS 6 specific translation file.
066aaa
|-- Tpl
066aaa
|   `-- splash-small.sed
066aaa
`-- firstboot-left.sed
066aaa
@end verbatim
066aaa
066aaa
@subsubsection Translation Rendering
066aaa
@cindex Translation rendering
066aaa
066aaa
When rendering translations, the @command{centos-art} script checks
066aaa
the translation entry to verify that it has a translation template
066aaa
directory inside. The translation template directory (@file{Tpl/})
066aaa
contains common translation files used to build release-specific
066aaa
translation files. If the translation template directory doesn't exist
066aaa
inside the translation entry the translation rendering fails. In this
066aaa
case the @command{centos-art} script outputs a message and quits
066aaa
script execution.
066aaa
066aaa
@subsubsection Translation (Pre-)Rendering Configuration Scripts
066aaa
@cindex Translation configuration scripts
066aaa
@cindex Translation pre-rendering configuration scripts
066aaa
066aaa
When the @command{centos-art} script finds a translation template
066aaa
directory inside translation entry, it looks for translations
066aaa
pre-rendering configuration scripts for that translation entry.
066aaa
Translation pre-rendering configuration scripts let you extend
066aaa
translation default functionality (described below). 
066aaa
066aaa
Translation pre-rendering configuration scripts are stored under
066aaa
@file{trunk/Scripts} directory, specifically under the appropriate
066aaa
language implementation. If you are using @command{centos-art} Bash
066aaa
implementation, the translation pre-rendering scripts are store in the
066aaa
@file{trunk/Scripts/Bash/Config} location; if you are using
066aaa
@command{centos-art} Python implementation, then translation
066aaa
pre-rendering scripts are stored in the
066aaa
@file{trunk/Scripts/Python/Config} location, and so on for other
066aaa
implementations.
066aaa
066aaa
Bash translation pre-rendering configuration scripts look like the
066aaa
following:
066aaa
066aaa
@verbatim
066aaa
#!/bin/bash
066aaa
#
066aaa
# render_loadConfig.sh -- brief description here.
066aaa
#
066aaa
# Copyright (C) YEAR YOURNAME
066aaa
# 
066aaa
# This program is free software; you can redistribute it and/or modify
066aaa
# it under the terms of the GNU General Public License as published by
066aaa
# the Free Software Foundation; either version 2 of the License, or
066aaa
# (at your option) any later version.
066aaa
# 
066aaa
# This program is distributed in the hope that it will be useful, but
066aaa
# WITHOUT ANY WARRANTY; without even the implied warranty of
066aaa
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
066aaa
# General Public License for more details.
066aaa
#
066aaa
# You should have received a copy of the GNU General Public License
066aaa
# along with this program; if not, write to the Free Software
066aaa
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
066aaa
# USA.
066aaa
# 
066aaa
# ----------------------------------------------------------------------
066aaa
# $Id: render_loadConfig.sh 94 2010-09-18 10:59:42Z al $
066aaa
# ----------------------------------------------------------------------
066aaa
066aaa
function render_loadConfig {
066aaa
...
066aaa
}
066aaa
@end verbatim
066aaa
066aaa
Translation pre-rendering scripts are function scripts loaded and
066aaa
executed when rendering a translation entry. Translation pre-rendering
066aaa
scripts are loaded using the translation entry being rendered as
066aaa
reference. For example, suppose you are using the
066aaa
@command{centos-art} Bash implementation, and you are rendering
066aaa
translations for CentOS brands, in this situation the translation
066aaa
entry would be:
066aaa
066aaa
@verbatim
066aaa
trunk/Translations/Identity/Brands
066aaa
@end verbatim
066aaa
066aaa
and the entry inside the translation pre-rendering configuration
066aaa
structure would be:
066aaa
066aaa
@verbatim
066aaa
trunk/Scripts/Bash/Config/Identity/Brands
066aaa
@end verbatim
066aaa
066aaa
Once the @command{centos-art} script detects that translation
066aaa
pre-rendering configuration directory exists, the @command{centos-art}
066aaa
script looks for the translation pre-rendering configuration file.  If
066aaa
the translation pre-rendering configuration file exists, it is loaded
066aaa
and executed.  Once the translation pre-rendering configuration file
066aaa
has been executed the translation rendering process is over, and so
066aaa
the script execution.
066aaa
066aaa
@quotation
066aaa
@strong{Note} Translation pre-rendering configuration files have the
066aaa
following form:
066aaa
@verbatim
066aaa
render.conf.extension
066aaa
@end verbatim
066aaa
where @samp{extension} refers the programming language implementation
066aaa
you are using. For example, @samp{sh} for Bash, @samp{py} for Python,
066aaa
@samp{pl} for Perl, and so on for other implementations.
066aaa
@end quotation
066aaa
066aaa
As we are using Bash implementation to describe the translation
066aaa
pre-rendering configuration example, the translation pre-rendering
066aaa
configuration file that @command{centos-art} looks for, inside the
066aaa
above translation pre-rendering configuration directory, is
066aaa
@file{render.conf.sh}.
066aaa
066aaa
@subsubsection Translation Rendering Default Functionality
066aaa
@cindex Translation rendering default functionality
066aaa
066aaa
In the other hand, if the translation pre-rendering configuration file
066aaa
doesn't exist, or it isn't written as function script, the
066aaa
@command{centos-art} script ignore translation pre-rendering
066aaa
configuration functionality and passes to render translation using
066aaa
default functionality instead.
066aaa
066aaa
The translation rendering default functionality takes template
066aaa
translation directory structure, duplicates it for each release number
066aaa
specified in the @samp{--filter='release-number'} argument and
066aaa
produces release-specific directories. As part of template translation
066aaa
duplication process take place, the @command{centos-art} script adds
066aaa
release-specific replacement commands for each specific translation
066aaa
file inside release-specific directories. As result, specific
066aaa
translation files, inside release-specific directories, contain
066aaa
template translation replacement commands @emph{plus},
066aaa
release-specific replacement commands.
066aaa
066aaa
@quotation
066aaa
@strong{Note} Release-specific replacement commands are standardized
066aaa
inside @command{centos-art} script using predifined release
066aaa
translation markers. Release translation markers are described in the
066aaa
translation marker section
066aaa
(@pxref{trunk:Translations:TranslationMarkers, Translation Markers}).
066aaa
@end quotation
066aaa
066aaa
@c --- figure required to illustrate this section.
066aaa
066aaa
@subsection Usage
066aaa
@cindex How to render translation files
066aaa
066aaa
@table @samp
066aaa
@item centos-art render --entry='path/to/dir' 
066aaa
066aaa
When @samp{path/to/dir} refers one directory under
066aaa
@samp{trunk/Translations}, this command orverwrites available
066aaa
translation files using translation templates.
066aaa
066aaa
@item centos-art render --entry='path/to/dir' --filter='pattern' 
066aaa
066aaa
When @samp{path/to/dir} refers one directory under
066aaa
@file{trunk/Translations}, this command renders release-specific
066aaa
translation files as you specify in the @samp{--filter='pattern'}
066aaa
argument. In this case, @samp{pattern} not a regular expression but an
066aaa
number (e.g., @samp{5}) or a list of numbers separated by commas
066aaa
(e.g., @samp{3,4,5,6}) that specify the major release of CentOS
066aaa
distribution you want to render translations for.  
066aaa
@end table
066aaa
066aaa
@subsection See also
066aaa
066aaa
@menu
bbfdc0
@comment --- Removed(* trunk Translations Identity Brands::) ---
bbfdc0
@comment --- Removed(* trunk Translations Identity Fonts::) ---
bbfdc0
@comment --- Removed(* trunk Translations Identity Models::) ---
bbfdc0
@comment --- Removed(* trunk Translations Identity Release::) ---
bbfdc0
@comment --- Removed(* trunk Translations Identity Themes::) ---
066aaa
* trunk Identity::
066aaa
@end menu