All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----multilizer.Dictionary | +----multilizer.BundleDictionary | +----multilizer.FileDictionary | +----multilizer.BinaryDictionary
An example:
BinaryDictionary dictionary = new BinaryDictionary(); dictionary.setFileName("dictionary.mld"); dictionary.open();
You can also set the dictionary read the dictionary data from a stream. Write the getTranslationStream event. Create the stream in the event. The stream must contain MLD data.
An example:
public class SampleFrame implements TranslationStreamListener ... BinaryDictionary dictionary = new BinaryDictionary(); dictionary.addTranslationStreamListener(new TranslationStreamListener() { public void getTranslationStream(StreamEventObject e) throws Exception { dictionary_getTranslationStream(e); } }); dictionary.open(); ... void getTranslationStream(StreamEventObject e) throws Exception { e.setStream(new FileInputStream(e.getFileName())); }
"<name>.languages"
.
The translation file name is "<name>_<locale>.mld"
.
The language code is the Java's standard locale code (e.g. "en" and "en_UK").
Language File format
MLD File format
An example that uses a MLD file bundle (e.g. dictionary.languages, dictionary_en.mld, dictionary_fi.mld, etc):
BinaryDictionary dictionary = new BinaryDictionary(); 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 MLD_FILE_EXTENSION
public BinaryDictionary()
protected Language readLanguage() throws IOException
public int getLanguageCount()
public Language getLanguageData(int index)
public Language[] getLanguageDatas()
protected void loadTranslation(Vector translations, String fileName)
All Packages Class Hierarchy This Package Previous Next Index