Foundation > Internationalization > Localized Message Database Files in Rogue Wave Views > .dbm File Format
 
.dbm File Format
In the .dbm format, each supported language is stored in a separate database in order to deal with multiple languages using different encoding methods.
A .dbm file has the following format:
// IlvMessageDatabase ...
// Language: <ll_TT>
// Encoding: <encoding>
“&message” “message translation...”
The first line is an information line containing information about IlvMessageDatabase, with the Rogue Wave® Views version and the creation date.
The language is represented using the ll_TT naming convention of Rogue Wave Views where ll is the two-letter abbreviation for the language name and TT is the two-letter abbreviation for the territory name.
The encoding method must be one of the methods supported by Rogue Wave Views. See the section Reference: Encoding Listings for a list of supported encoding methods.
The following example shows part of a message database file for French:
// IlvMessageDatabase
// Language: fr_FR
// Encoding: ISO-8859-1
"&AlignmentLabelPicture" "Alignement texte / image"
"&Appearance" "Apparence"
"&April" "avril"
If you are translating your .dbm files to your local language, make sure your files are in this .dbm format.
Note: It is recommended that you do the following for localized database message files for American English. Do not create an en_US.US-ASCII subdirectory in the locale directory for your files. Put your files directly in your data directory; for example, views.dbm located in <$ILVHOME>/data/ilviews/. Set the contents of the files as shown in the following example, even if the encoding that you are running for American English is not US-ASCII. You can do this because US-ASCII is the weakest encoding and can be read by any other encoding that Rogue Wave Views supports.
 
// IlvMessageDatabase
// Language: en_US
// Encoding: US-ASCII
"&AlignmentLabelPicture" "Alignment text / picture"
"&Appearance" "Appearance"
"&April" "April"
 
.dbm File Format in Versions Before 3.0
In Rogue Wave Views version 3.0, the .dbm file format was enhanced to support different languages that use different and incompatible encoding methods. In the.dbm file format of versions before 3.0, a message database contains the translation of each message to each of the supported languages. In other words, all supported language translations are found in the same database. Although files in the old .dbm format can still be read using Rogue Wave Views 3.0 and later, new files are generated in the new format.
If you have database files in the old .dbm format, it is a good idea to split your databases into several files, one for each supported language. Not only will this make maintenance easier, but it will also avoid encoding incompatibilities.
To split your database files with the old format, use the following program:
$ILVHOME/bin/src/splitdbm.cpp
This program finds the various languages in your .dbm file and suggests a new language name for each one of them (we recommend that you use the Rogue Wave Views naming convention ll_TT), an encoding method (the selected encoding method must be compatible with the current one), and a name for the file with the new format.
Note:  You should run the splitdbm program using the strongest encoding. The strongest encoding is the one that encompasses the others. For example, if you want to split a file that contains English (US-ASCII) and Japanese (Shift_JIS), you should run splitdbm using a Japanese locale. Shift_JIS contains US-ASCII, but the opposite is not true. Therefore, Shift_JIS is the strongest encoding and should be used for running the program.
Note: It is recommended that you do the following when you are splitting a file containing American English messages. When the splitdbm program prompts you for information, choose the US-ASCII encoding and store the localized file in your data directory, not under a locale subdirectory.
Example
This example shows how to split a database message file.
The following file called your_data_dir/testall.dbm contains the message text for three languages, American English, French, and Italian:
// IlvMessageDatabase 3 Web Jun 3 11:50:35 1998
"&Hello" 3
"en_US" "Hello"
"fr_FR" "Bonjour"
"it_IT" "Buongiórno"
"&Goodbye" 3
"en_US" "Goodbye"
"fr_FR" "Au revoir"
"it_IT" "Ciao"
To split this file into three files, one file for each language, you should run the splitdbm program in the French or Italian locale. When you run the program, you will be prompted for the information the program needs to complete its run. When the run finishes, you should have three files, each file containing the message text for a single language. On a UNIX system, the resulting files would be:
your_data_dir/test.dbm
locale/fr_FR.ISO-8859-1/test.dbm
locale/it_IT.ISO-8859-1/test.dbm
The contents of each file would be as follows:
// IlvMessageDatabase
// Language: en_US
// Encoding: US-ASCII
"&Goodbye" "Goodbye"
"&Hello" "Hello"
 
// IlvMessageDatabase
// Language: fr_FR
// Encoding: ISO-8859-1
"&Goodbye" "Au revoir"
"&Hello" "Bonjour"
 
// IlvMessageDatabase
// Language: it_IT
// Encoding: ISO-8859-1
"&Goodbye" "Ciao"
"&Hello" "Buongiórno"
Encoding Compatibility of .dbm Files
Note that a Rogue Wave Views application will only load .dbm files that were written using an encoding that is compatible with the system environment. Encodings are compatible if they share the same character set. If you load .dbm files that still use the old format and that do not contain encoding information, these files are supposed to be in the encoding of the current locale. Otherwise, information might be improperly or incompletely loaded.

Version 6.1
Copyright © 2016, Rogue Wave Software, Inc. All Rights Reserved.