The NlsMessageCatalog has been designed to efficiently support these two predominant uses of display text in applications through the following two mechanisms.
External message dictionaries are designed for use when all localized messages are to be retrieved at once and stored in a pool dictionary within Smalltalk. External message dictionaries are identified by locale and character set, and for this reason only one message dictionary can be stored in an
NlsMessageCatalog for a given locale and character set.
An external message dictionary is a
Dictionary keyed by a message identifier (pool dictionary variable name) containing localized messages.
NlsMessageCatalog provides protocols specifically tailored for storing and retrieving pool dictionaries containing localized messages.
Indexed external messages are designed for use when messages are maintained on secondary storage and loaded individually, as needed. Indexed external messages are identified by locale, character set, and a numeric message identifier.
Messages externalized using a NlsMessageCatalog (both external message dictionaries and indexed external messages) typically contain only strings, but can contain any Smalltalk object that can be dumped by the Swapper without special dumping options. (Refer to the
Smalltalk User's Guide for a complete description of limitations.)
Although the NlsMessageCatalog is capable of storing Smalltalk objects other than strings, the developer should be aware that platform resource files cannot store arbitrary Smalltalk objects. If the message catalog is to be converted to a platform resource format, it must only contain strings.
Instances of NlsMessageCatalog are associated with a single disk file.
NlsMessageCatalog instances are created using
NlsMessageCatalog>>#on:, which takes a single
String argument that specifies the absolute or relative pathname of the new or existing message catalog file.
Copyright 2005, 2020 Instantiations, Inc. All rights reserved.