DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Constructing and using message catalogs

Combining the message catalog and the application program

This section describes how to compile the message catalog and how to locate it so that the application can use it.

Setup program

  1 set -x
  2 NLSPATH=./%l/%N
  3 export NLSPATH

4 gencat english/hello.cat english/hello.text 5 gencat french/hello.cat french/hello.text

6 cc hello.c -o hello 7 set +x


line 2
Defines the NLSPATH variable which contains the path where the message catalogs are contained. The ``%l'' extracts the string defined in the LANG environment variable and the ``%N'' extracts the string from the name argument from the catopen(S) routine. If the value in the LANG variable is ``english'', the message catalog file in in our example would be ./english/hello.cat

line 3
Exports this definition so that the NLSPATH variable is defined permanently in this shell session.

lines 4-5
Creates the .cat files for both the French and English message. The source files are compiled into binary files understood by the cataloging routines.

line 6
Compiles the source for the main application program using the message catalogs.

Next topic: Running the application program
Previous topic: Code example using a message catalog

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003