Dictionaries

The dictionary contains the translation of the application. There exist two kind of dictionaries:

Combined dictionaries

A combined dictionary contains all strings of the application or applet is a single dictionary. The dictionary data is stored in files, in database tables, or in a dictionary server.

Text Dictionary

The text dictionary contains the dictionary data in Unicode files. A text dictionary is pretty much like PropertyResourceBundle. However the text dictionary has several advantages over the property files.

This example application has to source code files: Main.java and Sample.java, and it uses the compined text dictionary format. The dictionary contains three languages: English, Finnish and French.

Source files Dictionary files
(all languages in a single file)
Dictionary files
(each language on its own file)
Main.java
Sample.java
dictionary.languages (list of languages)
dictionary.translations (translations in English, Finnish and French)
dictionary.languages
dictionary_en.translations (English)
dictionary_fi.translations (Finnish)
dictionary_fr.translations (French)

Add the TextDictionary and the Translator components to the Main frame and the Translator component to the Sample frame.

Binary Dictionary

The binary dictionary contains the dictionary data is a binary MLD file. A binary dictionary is a little bit faster and more compact than the text dictionary.

The same sample application using the flat binary dictionary format.

Source files Dictionary files
(all languages in a single file)
Dictionary files
(each language on its own file)
Main.java
Sample.java
dictionary.mld (translations in English, Finnish and French) dictionary_en.mld (English)
dictionary_fi.mld (Finnish)
dictionary_fr.mld (French)

Add the BinaryDictionary and the Translator components to the Main frame and the Translator component to the Sample frame.

Server Dictionary

The server dictionary contains all dictionary data is a Dictionary Server.

The same sample application using the server dictionary format.

Source files Dictionary
Main.java
Sample.java
dictionary (translations in English, Finnish and French)

Add the ServerDictionary and the Translator components to the Main frame and the Translator component to the Sample frame.

Database Dictionary

The database dictionary contains all dictionary data is two database tables: the language and translation tables.

The same sample application using the database dictionary format.

Source files Dictionary tables
Main.java
Sample.java
LanguageTable (list of languages)
TranslationTable (translations in English, Finnish and French)

Add the DatabaseDictionary and the Translator components to the Main frame and the Translator component to the Sample frame.

Distributed dictionaries

Distributed dictionary contains several dictionaries: the main dictionary and several sub dictionaries. There is one sub dictionary for each Java file. Only text and binary dictionaries can be distributed. The database and server dictionaries are always combined.

Text Dictionary

This example application has to source code file: Main.java and Sample.java, and using the distributed text (Unicode) dictionary format. The dictionary contains three languages: English, Finnish and French.

Source files Dictionary files
(all languages in a single file)
Dictionary files
(each language on its own file)
Main.java
Sample.java
dictionary.languages (list of languages)
dictionary.translations (common translations in English, Finnish and French)
Main.translations (translations of Main in English, Finnish and French)
Sample.translations (translations of Sample in English, Finnish and French)
dictionary.languages
dictionary_en.translations (English)
dictionary_fi.translations (Finnish)
dictionary_fr.translations (French)
Main_en.translations (English)
Main_fi.translations (Finnish)
Main_fr.translations (French)
Sample_en.translations (English)
Sample_fi.translations (Finnish)
Sample_fr.translations (French)

Add the TextDictionary and the Translator components to the Main frame and the Translator component to the Sample frame. Do not add a dictionary component to the Sample frame.

Binary Dictionary

The same sample application using the distributed binary dictionary format.

Source files Dictionary files
(all languages in a single file)
Dictionary files
(each language on its own file)
Main.java
Sample.java
dictionary.mld (translations in English, Finnish and French)
Main.mld (translations of Main in English, Finnish and French)
Sample.mld (translations of Sample in English, Finnish and French)
dictionary_en.mld (English)
dictionary_fi.mld (Finnish)
dictionary_fr.mld (French)
Main_en.mld (English)
Main_fi.mld (Finnish)
Main_fr.mld (French)
Sample_en.mld (English)
Sample_fi.mld (Finnish)
Sample_fr.mld (French)

Add the BinaryDictionary and the Translator components to the Main frame and the Translator component to the Sample frame. Do not add a dictionary component to the Sample frame.

Components

MULTILIZER contains several dictionary components, some of them are abstract, some ready to use. However the following four dictionary components are most commonly used:

Dictionary Component Combined Distributed
Binary dictionary BinaryDictionary yes yes
Text dictionary TextDictionary yes yes
Server dictionary ServerDictionary yes -
Database dictionary DatabaseDictionary yes -
Test dictionary TestDictionary * *

*) Test dictionary does not use any dicitonary data but changes the native string on the fly to test translations.