mkmsgs and gettxt (UnixWare-specific)
You use the mkmsgs command to
store the strings for a given locale in a file that
can be read by the message retrieval function gettxt.
mkmsgs accepts an input file consisting
of text strings separated by newlines.
If the file fr.str contains
Votre choix (o/n)
oui
non
the command
$ mkmsgs -o -i fr fr.str progmsgs
will generate a file called progmsgs that, when installed in
the directory /usr/lib/locale/fr/LC_MESSAGES,
can be read by gettxt such that
puts(gettxt("progmsgs:1", "Choose (y/n)"));
will display
Votre choix (o/n)
in a French locale.
gettxt takes as its first argument
the name of the file created by mkmsgs and
the number of the string in the file, counting from 1.
You hard-code the second argument, not necessarily in English,
in case gettxt fails to retrieve
the message string from the current locale, or the ``"C"'' locale.
Next topic:
exstr and srchtxt (UnixWare-specific)
Previous topic:
Message handling
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004