![]() ![]() ![]() ![]() |
This appendix describes setting the language displayed in the J2ME Wireless Toolkit and the localization setting of the emulation environment.
A locale is a geographic or political region or community that shares the same language, customs, or cultural conventions. In software, a locale is represented by a collection of files, data, and code, which contains the information necessary to adapt software to a specific location.
Some software uses a locale to tailor information for users, such as:
By default, all KToolbar strings, that is, the entire User Interface (UI), are displayed in the language of the supported platform’s locale.
For example, Japanese characters can be displayed in KToolbar running on a Japanese Windows machine, provided that the correct localized J2ME Wireless Toolkit has been downloaded and installed.
You can set the wtk.locale
property to have the KToolbar displayed in a specified locale’s language. For example, you can have the toolkit running on a Japanese machine but still have the KToolbar display shown in English by setting the locale property to en-US
, and making sure that the proper supplement has been downloaded and installed over the J2ME Wireless Toolkit. The wtk.locale
property should be placed in the {toolkit}\wtklib\
{platform}\ktools.properties
file, where {platform} is the name of the underlying platform (Windows
or Linux
, for example).
The microedition.locale
property is the MIDP system property that defines the current locale of the device, which is null
by default. For the J2ME Wireless Toolkit emulator, this value is automatically set to the default locale for the J2SE environment you are running. For example:
microedition.locale
is set to en-US
.microedition.locale
is set to fr-FR
.
For information on microedition.locale
, consult the MIDP specification.
You can override the default value by adding the microedition.locale
property to the file {toolkit}\wtklib\
{platform}\ktools.properties
file and define the property as desired, as shown in the following examples:
For details on setting a default locale, see the J2ME Wireless Toolkit Basic Customization Guide.
The CLDC system property, microedition.encoding,
defines the default character encoding name of the MIDP environment. In the J2ME Wireless Toolkit emulator, this property is set according to the underlying window system you are using. The property’s value is set to the default encoding for the J2SE environment running on the same window system. For example, in an English window system, the encoding setting is
You can override the default value by adding the microedition.encoding
property to the {toolkit}\wtklib\
{platform}\ktools.properties
file. For example, if you want to use UTF-8 as the default setting on Windows, you can set the property in the {toolkit}\wtklib\Windows\ktools.properties
file as follows:
For more information on character encoding, see the CLDC specification.
The javac.encoding
property determines the encoding used by the javac compiler to compile your source files. The property’s value is set to the default encoding for the J2SE environment running on the same window system.
You can override the default value by adding the javac.encoding
property to the {toolkit}\wtklib\
{platform}\ktools.properties
file, where {platform} is the name of the underlying platform, like Windows
or Linux
. For example, if you are running in an English system but find you need to compile a Japanese resource bundle, you can specify a Japanese character set, such as:
The default fonts that are used in the emulated environment are set according to the underlying window system locale. By default, the MIDP environment fonts are mapped to the default J2SE environment Java fonts. These fonts usually support all the characters that are required by the current window’s locale.
You can override these fonts to support other characters that are not supported by the default fonts. See the J2ME Wireless Toolkit Basic Customization Guide for information on how to configure them.
![]() ![]() ![]() ![]() |
J2ME Wireless Toolkit User's Guide J2ME Wireless Toolkit 2.2 |
Copyright © 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to the license terms.