Blame Manuals/Repository/trunk/Scripts/Bash/Functions/Locale.texi

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