The subclasses of NlsPlatformResourceConverter are provided to enable pool dictionaries containing localized messages to be stored in and retrieved from platform resource file formats.
Immediately following the first comment is a series of define statements that describe the pool dictionary from which the file was created. Localized messages stored as VA Smalltalk pool variables are identified by string keys in a pool dictionary; however, when these messages are stored in dynamic link libraries they must be identified by ordinal constants. The conversion of string identifiers to ordinal values is accomplished by associating each string identifier with an ordinal value using a
define statement in the resource compiler input file. For example:
RCConverter provides the convertMessages:toResourceFile: and
convertMessages:comments:toResourceFile: methods to convert a dictionary containing localized messages into a resource compiler input file. The dictionary containing localized messages must be keyed by string identifiers, and can contain only messages conforming to the conditions described in
RCConverter limitations. An attempt to convert a dictionary containing messages that are not valid generates an error.
In addition to a file name and a dictionary containing localized messages, the convertMessages:comments:toResourceFile: method accepts a dictionary containing comments to be written into the resource compiler input file. The dictionary containing comments should have the same keys as the dictionary that contains localized messages. The comment dictionary must conform to the same limitations that apply to message dictionaries, but need not contain a comment for every message in the dictionary being converted.
RCConverter provides the
indexFrom: and
messagesFromDLL:index: methods to rebuild a dictionary containing localized messages from messages stored in a dynamic link library (DLL).
The messagesFromDLL:index: protocol answers a reconstructed dictionary of localized messages based upon the contents of a dynamic link library and an index provided by the developer.
messagesFromDLL:index: accepts any dictionary that provides mappings between strings and integers as its index parameter, although the
indexFrom: method is the recommended mechanism for generating the index. The
messagesFromDLL:index: method does not require a resource compiler input file to function. The following example illustrates the reconstruction of a dictionary containing localized messages from a dynamic link library:
The resource file representation of a single Character can range from 1 to 4 bytes. Characters expanded in this manner are the special or nonprinting characters whose values are 1 through 31, 34, and 127. For example, (Character value: 7) has a resource file representation of: '\007.'
Copyright 2005, 2020 Instantiations, Inc. All rights reserved.