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.4.12.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 a 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 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
    
  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.

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