HP 9000 User Manual page 109

Computers
Hide thumbs Also See for 9000:
Table of Contents

Advertisement

Creating and Using a Message Catalog System
The HP -UX message catalog system allows program messages to be stored
separately from the logic of the program, to be translated into different
languages, and to be retrieved at run-time, according to the language
requirements of each user.
Program messages might be:
• Information to the user, e.g.
file not found.
• Responses from the user, e.g.
tomorrow
as used by the
at
command.
• Strings used to format other messages, e.g.
~l$d
Y.2$s\n.
These messages would ordinarily appear in the source program as quoted
strings, such as:
prin~f(lIfile
not found\n");
if (.strcmp(s, "tomorrow")
==
0) ...
To produce a program that is internationalized for messages, do the following:
1. Separate the program logic from program messages by using message routine
calls in place of quoted messages in the source program. The message
routines will retrieve message text at run-time.
7
2. Create a message text source file for localization. This file contains messages
that would ordinarily appear as quoted strings in the source program.
3. Generate a message catalog from the message text source file. This file
contains messages that are retrieved by the message routines.
Localized messages can then be provided by translating the strings in the
message text source file into another native language and then generating the
native language message catalog.
7 -2
The Message Catalog System

Advertisement

Table of Contents
loading

Table of Contents