GNU Rush |
|
Restricted User Shell |
Sergey Poznyakoff |
You need to write a localization file for your configuration script if it implements exit rules (see Exit) and changes user locale (see locale).
Preparing localization consists of three stages: extracting exit messages and forming a PO file, editing this file, compiling and installing it. The discussion below describes these stages in detail.
A PO (Portable Object) file is a plain text file, containing original messages and their translations for a particular language. See The Format of PO Files in GNU gettext utilities, for a description of its format.
The script rush-po
extracts translatable messages from the
configuration file and produces a valid PO file. It takes
the name of the rush configuration file as its argument and produces
the PO file on the standard output, or in the file given with the
-o (--output) option. E.g., to create a PO file
from your configuration file, run:
rush-po -o myconf.po /usr/local/etc/rush.rc
Open the created PO file with your favorite editor and supply
message translations after msgstr
keywords. Although you can
use any editor, capable of handling plain text files, we recommend to
use GNU Emacs, which provides a special po-mode. See PO Files and PO Mode Basics in GNU gettext utilities, for guidelines
on editing PO files and using the po-mode.
When ready, the PO file needs be compiled into a
MO (Message Object) file, which is directly readable
by rush
. This is done using msgfmt
utility from
GNU gettext:
msgfmt -o myconf.mo myconf.po
See msgfmt Invocation in GNU gettext utilities, for a
detailed description of the msgfmt
utility.
After creating the MO file, copy it into appropriate directory. It is important that the installed MO file uses the naming scheme described in localization file naming.
This document was generated on June 29, 2019 using makeinfo.
Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.