All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class multilizer.TextDictionary

java.lang.Object
   |
   +----multilizer.Dictionary
           |
           +----multilizer.BundleDictionary
                   |
                   +----multilizer.FileDictionary
                           |
                           +----multilizer.TextDictionary

public class TextDictionary
extends FileDictionary
A dictionary component that gets translation data from a bundle of Unicode files.

Set the DictionaryName property to contain the name of the resource bundle. The bundle contains one language file (e.g. ".languages") and one translation file for each supported language (e.g. "_.translations").

You can also set the dictionary read data from streams. Implement the LanguageStreamListener and TranslationStreamListener interfaces and set them to listen the dictionary by calling the addLanguageStreamListener and addTranslationStreamListener methods. The streams must contain the same Unicode data as the text files.

It is a Unicode text file (UCS-2, UTF-16, little-endian 16-bit coded format) where every line contains translations of a string The format of the row is:

Native<tab> Translation<cr><lf>

Where

Native is the native string.
Translation is the translated string.
<tab> is the Tab character, 0x0009
<cr> is the Carriage return, 0x000D
<lf> is the Line feed, 0x000A

Use Multilizer Language Manager or any Unicode text editor to create and edit the translation tables.


An example:
 TextDictionary dictionary = new TextDictionary();
dictionary.setDictionaryName("dictionary"); try { dictionary.open(); } catch (Exception e) { }

See Also:
BinaryDictionary, ResourceDictionary

Constructor Index

 o TextDictionary()

Method Index

 o loadTranslation()
Loads the translation data from the file to the array.

Constructors

 o TextDictionary
 public TextDictionary()

Methods

 o loadTranslation
 protected void loadTranslation() throws Exception
Loads the translation data from the file to the array.

Overrides:
loadTranslation in class FileDictionary

All Packages  Class Hierarchy  This Package  Previous  Next  Index