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