Because NlsMessageCatalog is intended for use at runtime and debugging facilities might not be available, error codes are employed to provide an error tracing mechanism. The value of the current error code should be examined after each operation to determine if an error occurred during the last operation. Alternatively, the hasErrorOccurred message can be used to check if an error occurred during the last operation.
The following list includes all error codes and their corresponding messages. Each error code is associated with a descriptive error string and an error object, which is typically related to the current error or the cause of the current error. This error object can be obtained by sending the currentErrorObject message to an instance of NlsMessageCatalog. Similarly, the descriptive error string can be obtained by sending the currentErrorString to an instance of NlsMessageCatalog. The interpretation of the error object for each error is provided below.
Error object: nil
Error object: Locale name for which messages could not be found.
Error object: A set of the keys missing translations.
Error object: The pathname of the file that could not be opened.
Error object: The message strings that are not portable.
Error object: An instance of NlsMessageCatalogHeader.
Error object: Object for which size estimation failed.
Error object: An instance of NlsMessageCatalogHeader.
Error object: The invalid indexed message identifier.
Error object: Locale name for which messages could not be found.
Error object: Locale name for which messages could not be found.
Error object: Locale name for which messages could not be found.
Error object: An instance of ObjectLoader.
Error object: An instance of ObjectDumper.
The NlsMessageCatalog function described in the previous sections is partitioned between the applications NlsExternalizationRuntime and NlsExternalizationTools to support packaging.
NlsExternalizationRuntime provides the necessary class definitions for NlsMessageCatalog, its support classes, and all protocols required for reading and querying message catalog files. NlsExternalizationTools defines extensions to the basic NlsMessageCatalog and its support classes to enable creation of message catalog files. If the application being packaged has no requirement to create message catalog files at runtime, only the NlsExternalizationRuntime application should be included in the packaged image.
The NlsExternalizationTools application also defines the RCConverter class that assists in converting localized message dictionaries to Microsoft Windows and OS/2 resource file formats. The RCConverter class is intended primarily for use in a development image and should most likely be excluded from a runtime image.