Software Internationalization Guide

POSIX and XPG Internationalization Model
Software Internationalization Guide526225-002
3-10
Accessing Message Catalogs
Accessing Message Catalogs
An internationalized program must be able to retrieve message text from a message
catalog. Three XPG-defined message catalog functions access localized messages:
catopen() opens a message catalog. The current locale setting determines the
catalog to be opened, based on the message catalog name.
catgets() retrieves messages from the opened message catalog and returns the
localized messages to the calling program.
catclose() closes the message catalog.
The locale environment variables define the current locale setting and are used by
catopen() to determine which message catalog to open. The environment variable
Figure 3-2. Generating Message Catalogs
English Message
Source File
(Numeric Constants)
English Message
Source File
(Symbolic Identifiers)
Spanish
Message
Source FIle
Localize
English to Spanish
Localization Process
Message Source File
Message Source File
gencat gencat
gencat
Spanish
Message
Catalog
English
Message
Catalog
English
Message
Catalog
Message
Catalog
Message
Catalog
Message
Catalog
mkcatdefs
VST013.vsd