Blame Manuals/centos-art.sh/trunk/Translations.texi

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