A localizable program contains no text (prompts, commands, messages)
stored in the code itself. This allows the text to be translated
without modifying or recompiling the program source code.
The Application Message Facility is an NLS tool that provides a
programmer with the flexibility needed to create application catalogs
for localized applications. Text such as prompts, commands, and
messages intended for the user's interaction with an application can
be stored in separate ASCII editor files. This allows the programmer
to maintain files and localize applications without changing the program
code.
The NLS Application Message Facility contains the GENCAT utility program
and the CATOPEN, CATREAD, and CATCLOSE intrinsics as shown in Figure 3-1 “GENCAT Utility Program”. The GENCAT utility creates and maintains message catalogs that meet the NLS requirements for efficient storage and retrieval
of messages. For more information, refer to Message Catalogs Programmer's Guide (32650-90021).
Figure 3-1 GENCAT Utility Program
The GENCAT program is used to convert an ASCII source file containing
messages into a binary application catalog that can be accessed by the
intrinsics. Application programs use the message catalog intrinsics
to retrieve messages from it. An application message catalog consists
of a file containing character strings (messages), each uniquely
identifiable by a set number and a message number within a set. Key
features of the Application Message Facility include:
Each message in a catalog can allow up to five parameters
which may be specified by position or number.
An editor is used to create an MPE XL ASCII file (source catalog).
The GENCAT program is used to read the source catalog and create a
formatted catalog. The formatted catalog has an internal directory
for efficient access and is compacted (for example, it deletes
trailing blanks) to optimize storage space.
GENCAT has a facility to merge two message source files, a master
file and a maintenance file. The maintenance file contains changes
to be made in the master file. Updates of a localized version of an
application may be made by translating the maintenance file, then
merging it with the localized source file.
Multiple localized versions of an application can be supported with
translations of the original source catalog. If a naming convention
is established, the application program can determine which localized
catalog to open at run time (using the CATOPEN intrinsic).
A suggested naming convention is discussed in chapter 7.