All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----multilizer.Dictionary | +----multilizer.BundleDictionary | +----multilizer.FileDictionary | +----multilizer.TextDictionary
Language File format
Translation File format
An example:
TextDictionary dictionary = new TextDictionary(); dictionary.setFileName("dictionary.languages"); dictionary.setTranslationFileName("dictionary.translations"); dictionary.open();You can also set the dictionary read data from streams. Write the getLanguageStream and getTranslationStream events. Create the streams in the events. The streams must contain the same Unicode data as the text files.
Language File format
Translation File format
An example:
public class SampleFrame implements TranslationStreamListener ... TextDictionary dictionary = new TextDictionary(); dictionary.addLanguageStreamListener(new LanguageStreamListener() { public void getLanguageStream(StreamEventObject e) throws Exception { dictionary_getLanguageStream(e); } }); dictionary.addTranslationStreamListener(new TranslationStreamListener() { public void getTranslationStream(StreamEventObject e) throws Exception { dictionary_getTranslationStream(e); } }); dictionary.open(); ... void dictionary_getLanguageStream(StreamEventObject e) throws Exception { e.setStream(new FileInputStream(e.getFileName())); } void dictionary_getTranslationStream(StreamEventObject e) throws Exception { e.setStream(new FileInputStream(e.getFileName())); }
"<name>.languages"
),
one translation file for each supported language ("<name>_<locale>.translations"
),
and an optional locale file ("<name>.locales"
).
Language File format
Translation File format
An example that uses "dictionary.languages"
as a language file,
"dictionary_en.translations"
and "dictionary_fi.translations"
as the translations files (supposing that the dictionary contains two languages, English and Finnish):
TextDictionary dictionary = new TextDictionary(); dictionary.setFileName("dictionary"); dictionary.open();
You can also set the dictionary read the dictionary data from streams using the events desribed above.
public static final String TRANSLATION_FILE_EXTENSION
public TextDictionary()
protected UnicodeInputStream getLanguageStream() throws Exception
public void setTranslationFileName(String value)
public String getTranslationFileName()
public void setConvert(boolean value)
public boolean getConvert()
protected void loadTranslation(Vector translations, String fileName)
All Packages Class Hierarchy This Package Previous Next Index