![]() |
MULTILIZERTM 1.1.2 |
MULTILIZER is a JavaBeans component library that makes your Java application and applets multilingual.
A multilingual application or applet can support multiple languages. The user can also change the language on run-time. You do not need to have a separate frame class for each language, you do not have to change the property value of every component using the getString method of the resource bundle, or you do not have to use cryptic keys (e.g "this_is_a_text") when coding but you can use plain and simple English (e.g. "This is a text"). Only thing you have to done is it drop a translator component to every frame, and a dictionary component to the main frame. After you have created a multilingual application, you do not have to change your code to add a new language.
MULTILIZER uses Innoview's Multilizer-Dictionary-Translator-architecture (MDTATM). Typically you will have one dictionary per application and one translator per frame. The dictionary contains translations of every user interface string of the application. Each translator translates its frame to the active language just before the frame becomes visible. You can consider ther dictionary as a sophisticated resource bundle (in fact ResourceDictionary uses Java's property file format). Translator does automatically the job that you had to do when working directly on Java's resource bundle. Using MULTILIZER you do not have to rewrite your monolingual application again to localize it. Only thing you have to do is to drop one dictionary component on your main frame and one translator component on every frame. MULTILIZER takes care about the rest.
MULTILIZER can detect the default locale of your system and switch on the language that supports the locale. For example, if you run the application in Germany the initial language will be German. In France if will be French.
Java makes it possible to write once, run everywhere. MULTILIZER goes beyond that. It makes it possible to write once, run everywhere, on any language.
All MULTILIZER components are 100% Java (we expect to have the Pure Java certificate in June). MULTILIZER is small. Its overhead can be as low as 30 kBytes.
Learn more from the Introduction to Multilizer manual.
JDK 1.1 or 1.2
The installation of MULTILIZER varies depending on your system and development tool. The following list contains the installations information for the most common Java development environments:
This chapter describes how to use MULTILIZER.
Your first job is to create the dictionary. The dictionary contains all the user interface string of your application. You can create the dictionary manually, but it can be quite laborous. An easer way is to use MULTILIZER Language ManagerTM. It is an applications that scans your source codes, extracts all the user interface strings, and let your or your translator easily translate each string. You will need Language Manager only when creating the dictionaries for the application.
Language Manager is a Windows application. It works only on Windows NT and Windows 95. We will release a pure Java version of Language Manager in 1998.
Each application must have one dictionary. It contains the translation data of the application. The dictionary component must be available all the time. That's why you should place it on the application or on the main frame. The following example contains a main frame that has a binary dictionary.
public class MainFrame extends JFrame
{
BinaryDictionary dictionary = new BinaryDictionary();
public MainFrame()
{
dictionary.setDictionaryName("binary");
try
{
dictionary.open();
}
catch (Exception e)
{
MessageDialog.messageBox(
this,
"Could not open the dictionary",
e.getMessage(),
MessageDialog.OK,
null);
}
}
}
The translator component translates the host component from the native language to the active language of the dictionary. Add a translator component to every frame that you want to be multilingual. Set the following properties of the translator:
Finally call the translate method to translate the host component.
This example adds a translator component to the main frame.
public class MainFrame extends JFrame
{
BinaryDictionary dictionary = new BinaryDictionary();
Translator translator = new Translator();
public MainFrame()
{
dictionary.setDictionaryName("binary");
translator.setDictionary(dictionary);
translator.setHost(this);
translator.addDefaultTargets();
try
{
translator.translate();
}
catch (Exception e)
{
MessageDialog.messageBox(
this,
"Could not open the dictionary or translate the frame",
e.getMessage(),
MessageDialog.OK,
null);
}
}
}
You could use multiple dictionaries, even one dictionary per each frame, but this would slow your application and waste memory a lot. A much better approach is to use the dictionary component of the main frame for every other frames as well. The following example demonstrates the usage of translator on a secondary frame (abount box).
public class AboutBox extends JDialog
{
Translator translator = new Translator();
public AboutBox(Dictionary dictionary)
{
translator.setDictionary(dictionary);
translator.setHost(this);
translator.addDefaultTargets();
try
{
translator.translate();
}
catch (Exception e)
{
MessageDialog.messageBox(
this,
"Could not translate the frame",
e.getMessage(),
MessageDialog.OK,
null);
}
}
}
Learn more about translating the user interface.
MULTILIZER contains a full JavaDoc based documentation.
The samples sub directory contains sample applications and applets:
Deploying multilingual applications and applets
All MULTILIZER users (even evaluatiors) can benefit our free technical support. To get support send email to mailto:java@multilizer.com. If you can demonstate the problem in an application, please attach the application with your support mail.