<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<html>
<!--This manuals documents relevant information regarding the deployment,
organization, and administration of CentOS Artwork Repository.
Copyright C 2009-2011 Alain Reguera Delgado
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with no
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A
copy of the license is included in the section entitled GNU Free
Documentation License.
-->
<!-- Created on March, 2 2011 by texi2html 1.76 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
Karl Berry <karl@freefriends.org>
Olaf Bachmann <obachman@mathematik.uni-kl.de>
and many others.
Maintained by: Many creative people <dev@texi2html.cvshome.org>
Send bugs and suggestions to <users@texi2html.cvshome.org>
-->
<head>
<title>CentOS Artwork Repository: 2.37 The trunk/Locales Directory</title>
<meta name="description" content="CentOS Artwork Repository: 2.37 The trunk/Locales Directory">
<meta name="keywords" content="CentOS Artwork Repository: 2.37 The trunk/Locales Directory">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2html 1.76">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
<!--
@import "/home/centos/artwork/trunk/Identity/Models/Css/Texi2html/common.css";
a.summary-letter {text-decoration: none}
pre.display {font-family: serif}
pre.format {font-family: serif}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: serif; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: serif; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.sansserif {font-family:sans-serif; font-weight:normal;}
ul.toc {list-style: none}
-->
</style>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="repository_40.html#SEC203" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="repository_42.html#SEC205" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="repository_4.html#SEC4" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="repository_4.html#SEC4" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="repository_68.html#SEC357" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="repository.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="repository_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="repository_68.html#SEC357" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="repository_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Filesystem-trunk-Locales"></a>
<a name="SEC204"></a>
<h2 class="section"> 2.37 The <tt>`trunk/Locales'</tt> Directory </h2>
<p>The <tt>`trunk/Locales'</tt> directory exists to store the translation
messages used to produce content in different languages.
</p>
<p>Translation messages are organized using the directory structure of
the component being translated. For example, if we want to provide
translation messages for <tt>`trunk/Manuals/Filesystem'</tt>, then the
<tt>`trunk/Locales/Manuals/Filesystem'</tt> directory needs to be created.
</p>
<p>Once the locale directory exists for the component we want to provide
translation messages for, it is necessary to create the translation
files where translation messages are. The translation files follows
the concepts of <code>xml2po</code> and GNU <code>gettext</code> tools.
</p>
<p>The basic translation process is as follow: first, translatable
strings are extracted from files and a portable object template (.pot)
is created or updated with the information. Using the portable object
template, a portable object (.po) is created or updated for translator
to locale the messages retrived. Finally, a machine object (.mo) is
created from portable object to sotore the translated messages.
</p>
<p>Inside the repository there are two ways to retrive translatable
strings from files. The first one is through <code>xml2po</code> command
and the second through <code>xgettext</code> command. The <code>xml2po</code>
is used to retrive translatable strings from XML files (e.g., Scalable
Vector Graphics, DocBook, etc.) and the <code>xgettext</code> command is
used to retrive translatable strings from shell scripts files (e.g.,
the files that make the <code>centos-art.sh</code> command-line
interface).
</p>
<p>When translatable strings are retrived from XML files, using the
<code>xml2po</code> command, there is no need to create the machine
object as we do when translatable strings ar retrived from shell
files, using the <code>xgettext</code> command. The <code>xml2po</code>
produces a temporal machine object in order to create a translated XML
file. Once the translated XML file has been created the machine object
is no longer needed. On the other hand, the machine object produced by
the <code>xgettext</code> command is required by the system in order for
the show shell script localized messages.
</p>
<p>Another difference between <code>xml2po</code> and <code>xgettext</code> we
need to be aware of is the directory structure used to store machine
objects. In <code>xml2po</code>, the machine object is created in the
current working directory as <tt>`.xml2po.mo'</tt> and can be safetly
removed once the translated XML file has been created. In the case of
<code>xgettext</code>, the machine object needs to be stored in the
<tt>`$TEXTDOMAIN/$LOCALE/LL_MESSAGES/$TEXTDOMAIN.mo'</tt> file in order
for the system to interpret it and should not be removed since it is
the file that contain the translation messages themselves.
</p>
<p>Automation of localization tasks is achived through the <code>locale</code>
functionality of command-line interface.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="repository_59.html#SEC293">2.55 The <tt>`trunk/Scripts/Bash/Cli/Functions/Locale'</tt> Directory</a></td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="repository_40.html#SEC203" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="repository_42.html#SEC205" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="repository_4.html#SEC4" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="repository_4.html#SEC4" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="repository_68.html#SEC357" title="Next chapter"> >> </a>]</td>
</tr></table>
<p>
<font size="-1">
This document was generated on <i>March, 2 2011</i> using <a class="www" href="http://texi2html.cvshome.org/"><i>texi2html 1.76</i></a>.
</font>
<br>
</p>
</body>
</html>