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 convention. In software, a locale is a collection of files, data, and code, which contains the information necessary to adapt software to a specific geographical location.
Some operations are locale-sensitive and require a specified 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 the KToolbar running on a Japanese Windows 2000 machine, provided that the correct localized J2ME Wireless Toolkit supplement has been downloaded and installed over the Wireless Toolkit.
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 Windows NT 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 {
j2mewtk.dir}\wtklib\Windows\ktools.properties
file.
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 Default 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
, see section 4.2, System Properties, in the JSR-37 Mobile Information Device Profile specification at
http://jcp.org/aboutJava/communityprocess/final/jsr037/index.html.
You can override the default value by adding the microedition.locale
property to the file {
j2mewtk.dir}\wtklib\Windows\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 device MIDP environment. In the J2ME Wireless Toolkit Default Emulator environment, 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.locale
property to the {
j2mewtk.dir}\wtklib\Windows\ktools.properties
file. For example, if you want to use UTF-8 as the default setting, you can set the property in the {
j2mewtk.dir}\wtklib\Windows\ktools.properties
file as follows:
For more information on character encoding, see section 6.9.2, Property support in the JSR-30 J2ME Connected, Limited Device Configuration specification at
http://jcp.org/aboutJava/communityprocess/final/jsr030/index.html.
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 {
j2mewtk.dir}\wtklib\Windows\ktools.properties
file. 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.
User's Guide Java™ 2 Platform, Micro Edition, Wireless Toolkit, Version 2.1 |
Copyright © 2003 Sun Microsystems, Inc. All rights reserved.