Blame Manuals/Repository/trunk/Translations.texi

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