The IlvMessageDatabase Class
Rogue Wave Views provides a simple mechanism to help you manipulate multilingual applications. This mechanism is called the messages mechanism and is based on the
IlvMessageDatabase class.
It uses a database that stores different translations of the same message. Depending on the current language, the appropriate message is accessed. Each instance of the
IlvDisplay class creates its own message database. It reads the database description from the file name provided in the environment variable
ILVDB, or
views .dbm if this variable is not set. This file is searched for in the display path. You can access this database by calling the member function
IlvDisplay::getDatabase.
Each string that you plan to show in different languages can be stored in the database with its different possible translations; that is, you associate a message identifier with different message strings, depending on the language you target. The language is specified in a symbol object (IlSymbol class). Following is some sample code:
IlvMessageDatabase database;
IlSymbol* en_US = IlGetSymbol("en_US);
IlSymbol* fr_FR = IlGetSymbol("fr_FR");
database.putMessage("&cancel", en_US, "Cancel");
database.putMessage("&cancel", fr_FR, "Annuler");
The Rogue Wave Views environment variable ILVLANG lets you override your current language (for example, English, French, or Japanese).
Note: Although Rogue Wave Views does not support multilingual applications, you can use multiple languages in the same application if they use compatible encodings. |
Version 6.3
Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.