Blame Manuals/Repository/trunk/Translations.texi

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