Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Introduction to HydraExpress
Rogue Wave web site:  Home Page  |  Main Documentation Page

7.3 Building a Message Catalog

Message catalogs for each supported language are stored in the locale directory (Section 7.2), under their respective locale names. For example:

Note that there are multiple files per locale -- one for each HydraExpress component.

Each message catalog consists of a simple XML document containing a collection of localized strings. For example:

When a message catalog is loaded, each message identifier is converted into a constant variable named <component>_<messageIdentifier>. For example, the catalog sample above creates constant variables RWSF_CORE_INVALID_BASE64 and RWSF_CORE_UNEXPECTED ERROR. You can use these variables when constructing localized strings (Section 7.4) to get compile time checks against typographical errors.


The identifier strings must only contain characters consistent with C++ identifiers [A-Za-z0-9_]. These strings should not be localized, and instead are used as keys for locating the localized message strings.

The message format also supports inserting dynamic content into messages. A %-delimited string is used to identify where named substitutions can occur. For example:

When constructing a rwsf::LocalizedMessage to represent this message (Section 7.4), you can specify the values that should be associated with %1% and %2%. Note that since this mechanism uses numbered substitutions, you are free to re-order the substitution elements in localized strings. For instance:



Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved. All Rights Reserved. Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. HydraExpress is a trademark of Rogue Wave Software, Inc. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.