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

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