Overview of message catalogs
Applications that are expected to function in several locales must display localized messages, and therefore require some facility to store and retrieve these messages for a particular locale and character set. The POSIX.1 standard does not define any mechanism for storing or retrieving localized messages; however, VAST Platform supports a mechanism for storing and retrieving localized messages modeled after the message catalogs described by the X/Open Portability Guide.
An X/Open message catalog consists of a disk file, external to application code, that can be translated to support a variety of locales and character sets. The X/Open message catalog identifies each message numerically and provides protocols for opening and closing message catalogs, and for retrieving localized messages. Message catalogs are specified using a portable C-like text file, and are compiled into a machine-specific (non-portable) message file.
In VAST Platform, the basic mechanism for maintaining localized messages external to the application is the NlsMessageCatalog class. Instances of NlsMessageCatalog use the VAST Swapper as the basis of a platform-independent mechanism for writing and retrieving messages to and from secondary storage. The NlsMessageCatalog class provides protocols and a file structure designed specifically for storing localized messages.
Unlike an X/Open message catalog, the NlsMessageCatalog allows localized messages for several locales to be maintained in a single file. The NlsMessageCatalog provides protocols for storing and retrieving Indexed External Messages that are identified by numeric constants, and are used to reduce memory requirements of an application. The NlsMessageCatalog also provides extended capabilities for storing and retrieving External Message Dictionaries, which provide an efficient mechanism for loading large numbers of messages.
The NlsMessageCatalog uses the following keys to identify localized messages:
language
A variable-length, lowercase, single-byte string defining the language of a given locale. This value is taken from the VAST locale naming conventions described in
Table 53. For example,
'english,' 'french.' territory
A variable-length, lowercase, single-byte string defining the region of a given locale. This value is taken from the VAST locale naming conventions described in
Table 53. For example,
'us,' 'arabic.' coded character set
A variable-length, single-byte string describing the character set of the font that is used by widgets to display the localized messages. This value is platform dependent and is provided by the Common Graphics subsystem. For example, 'ibm-437,' 'iso8859-1.'
Last modified date: 02/21/2021