GNU Rush – a restricted user shell (split by node):   Section:   Chapter:FastBack: Configuration File   Up: Localization   FastForward: Default Configuration   Contents: Table of ContentsIndex: Concept Index

4.2.10.2 Writing Your Localization

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.

  1. Creating a ‘po’ file.

    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.awk serves for extracting messages from the configuration file and forming a PO file. This script is installed in the prefix/share/rush directory7, where prefix stands for your installation prefix.

    Supposing the package is installed in the default prefix, the following command will create a PO file from your configuration file:

      awk -f /usr/local/share/rush/rush-po.awk \
             /usr/local/etc/rush.rc > myconf.po
    

    Please note, that rush-po.awk does not handle include directives (see Include). If your configuration file uses these directives, you need to specify each include file in the rush-po.awk command line, e.g.:

      awk -f /usr/local/share/rush/rush-po.awk \
             /usr/local/etc/rush.rc /home/*/.rush > myconf.po
    
  2. Editing the PO file

    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.

  3. Compiling the PO file

    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.

Footnotes

(7)

To be precise, it is installed in dataroot/rush, where dataroot is a directory for read-only architecture-independent data, which is set by the --datarootdir option to configure. Unless that option is used, this directory defaults to prefix/share/rush

GNU Rush – a restricted user shell (split by node):   Section:   Chapter:FastBack: Configuration File   Up: Localization   FastForward: Default Configuration   Contents: Table of ContentsIndex: Concept Index