This MIDlet suite demonstrates the JSR 238 Mobile Internationalization API. The MIDlets String Comparator and Formatter show how to sort strings and display numbers appropriately for different locales. The third MIDlet, MicroLexicon, is a small phrase translator that comes in handy if you need to ask for a beer in Prague, Herzliya, Beijing, Milan, or several other locations.
Note - The default fonts for the Java ME Platform SDK do not support Chinese and Japanese. To use these languages, follow these steps before running this demo: 1. Install a True Type font that supports Chinese or Japanese. 2. Modify installdir\toolkit-lib\devices\skin-directory\conf\skin.properties to specify that font.
To run a MIDlet, highlight the MIDlet, then use the Launch soft button to run the MIDlet.
The String Comparator MIDlet demonstrates how strings (city names) are sorted differently depending on locale. Launch the MIDlet. Use the Menu soft button to view the menu. Click or Type 2 to select Sort - default, and the list is sorted alphabetically. Click or Type 3 to select Sort - slovak. It’s easy to see the difference in the cities that begin with the letter Z, with and without the mark on top. Click Exit to return to the list of MIDlets.
The second MIDlet, Formatter, simply displays times and numbers formatted for different locales. Click next to view all four screens. Click Exit to return to the list of MIDlets.
The final MIDlet, MicroLexicon, translates phrases from one language to another language. To set the source language, follow the steps in Setting the Emulator's Locale.
To select the target language from the list, use the navigation arrows to highlight Choose Language. Click the Select button to view the language drop down. Use the navigation arrows to choose a language and then click Select. Click the Next soft button.
MicroLexicon displays a list of phrases. Highlight one and press the Select button on the emulator.
MicroLexicon displays the flag of the target language and the translated phrase.
MicroLexicon is powered by MIDlet resources. To understand how you can use the Java ME Platform SDK to localize an application, choose Tools > i18n Resources Manager. All the resources, both text and images, used by MicroLexicon, appear. You can edit the resources and run MicroLexicon again to see what happens.
To practice creating and editing resources, see Working With Resource Files.
The resources are stored in the project’s JAR file.