Blame Manuals/centos-art.sh/trunk/Scripts/Bash/Functions/Locale.texi

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