Blob Blame History Raw
<?xml version="1.0"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>

    <title>CentOS Artwork Repository: 2.65 The trunk/Scripts/Functions/Locale Directory</title>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <meta name="description" content="CentOS Artwork Repository: 2.65 The trunk/Scripts/Functions/Locale Directory" />
    <meta name="keywords" content="CentOS Artwork Repository: 2.65 The trunk/Scripts/Functions/Locale Directory" />
    <meta name="resource-type" content="document" />
    <meta name="distribution" content="global" />
    <meta name="generator" content="texi2html 1.76" />
    <meta name="copyright" content="2009-2011 Alain Reguera Delgado" />

    <link href="/home/centos/artwork/trunk/Identity/Manual/repository.css" rel="stylesheet" type="text/css" media="screen projection" />

</head>

<body>

<a name="top" />

<div id="wrap">

    <div id="page-body">

        <div id="content">

<!-- Created on March, 30 2011 by texi2html 1.76 -->
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="repository_71.xhtml#SEC356" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC358" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="repository_7.xhtml#SEC12" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="repository_7.xhtml#SEC12" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="repository_80.xhtml#SEC416" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="repository.xhtml#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="repository_toc.xhtml#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="repository_80.xhtml#SEC416" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="repository_abt.xhtml#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Directories-trunk-Scripts-Functions-Locale"></a>
<a name="SEC357"></a>
<h2 class="section"> 2.65 The <tt>`trunk/Scripts/Functions/Locale'</tt> Directory </h2>

<div class="page-line white"><hr style="display:none;" /></div>
<a name="SEC358"></a>
<h3 class="subsection"> 2.65.1 Goals </h3>

<ul class="toc">
<li> ...
</li></ul>

<div class="page-line white"><hr style="display:none;" /></div>
<a name="SEC359"></a>
<h3 class="subsection"> 2.65.2 Description </h3>

<p>This command looks for <samp>`.sh'</samp> files inside Bash directory and
extracts translatable strings from files, using <code>xgettext</code>
command, in order to create a portable object template
(<tt>`centos-art.sh.pot'</tt>) file for them.
</p>
<p>With the <tt>`centos-art.sh.pot'</tt> file up to date, the
<code>centos-art</code> command removes the temporal list of files sotred
inside <tt>`/tmp'</tt> directory and checks the current language of your
user's session to create a portable object file for it, in the
location <tt>`$CLI_LANG/$CLI_LANG.po'</tt>. 
</p>
<p>The <var>CLI_LANG</var> variable discribes the locale language used to
output messages inside <code>centos-art</code> command. The locale
language used inside <code>centos-art</code> command is taken from the
<code>LANG</code> environment variable.  The <var>CLI_LANG</var> variable has the
<samp>`LL_CC'</samp> format, where <samp>`LL'</samp> is a language code from the
ISO-639 standard, and <samp>`CC'</samp> a country code from the ISO-3166
standard.
</p>
<p>The <code>LANG</code> environment variable is set when you do log in to your
system. If you are using a graphical session, change language to your
native language and do login. That would set and exoprt the <code>LANG</code>
environment variable to the correct value. On the other side, if you
are using a text session edit your <tt>`~/.bash_profile'</tt> file to set
and export the <code>LANG</code> environment variable to your native locale
as defines the <code>locale -a</code> command output; do logout, and do
login again.
</p>
<p>At this point, the <code>LANG</code> environment variable has the appropriate
value you need, in order to translate <code>centos-art.sh</code> messages
to your native language (the one set in <code>LANG</code> environment
variable). 
</p>
<p>With the <tt>`$CLI_LANG/$CLI_LANG.po'</tt> file up to date, the
<code>centos-art</code> opens it for you to update translation strings.
The <code>centos-art</code> command uses the value of <var>EDITOR</var>
environment variable to determine your favorite text editor. If no
value is defined on <var>EDITOR</var>, the <tt>`/usr/bin/vim'</tt> text editor
is used as default.
</p>
<p>When you finishd PO file edition and quit text editor, the
<code>centos-art</code> command creates the related machine object in the
location <tt>`$CLI_LANG/LC_MESSAGES/$TEXTDOMAIN.mo'</tt>.
</p>
<p>At this point, all translations you made in the PO file should be
available to your language when runing <code>centos-art.sh</code> script. 
</p>
<p>In order to make the <code>centos-art.sh</code> internationalization, the
<code>centos-art.sh</code> script was modified as described in the
<code>gettext</code> info documentation (<code>info gettext</code>).  You
can find such modifications in the following files:
</p>
<ul class="toc">
<li> <tt>`trunk/Scripts/Bash/initFunctions.sh'</tt>
</li><li> <tt>`trunk/Scripts/Bash/Functions/Help/cli_localeMessages.sh'</tt>
</li><li> <tt>`trunk/Scripts/Bash/Functions/Help/cli_localeMessagesStatus.sh'</tt>
</li></ul>

<ul class="toc">
<li> ...
</li></ul>

<div class="page-line white"><hr style="display:none;" /></div>
<a name="SEC360"></a>
<h3 class="subsection"> 2.65.3 Usage </h3>

<dl compact="compact">
<dt> <samp>`centos-art locale --edit'</samp></dt>
<dd><p>Use this command to translate command-line interface output messages
in the current system locale you are using (as specified in <code>LANG</code>
environment variable).
</p></dd>
<dt> <samp>`centos-art locale --list'</samp></dt>
<dd><p>Use this command to see the command-line interface locale report.
</p></dd>
</dl>

<div class="page-line white"><hr style="display:none;" /></div>
<a name="SEC361"></a>
<h3 class="subsection"> 2.65.4 See also </h3>


<div class="page-line white"><hr style="display:none;" /></div>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC360" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="repository_73.xhtml#SEC362" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="repository_7.xhtml#SEC12" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC357" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="repository_80.xhtml#SEC416" title="Next chapter"> &gt;&gt; </a>]</td>
</tr></table>

            <div class="page-line"><hr style="display:none;" /></div>

        </div>

    </div>

    <div class="page-line white"><hr style="display:none;" /></div>

</div>

</body>

</html>