Localization Support for Java Utilities

This section describes the mechanisms used to localize the following programs and tools:

  • RMI sample programs

  • RMI client framework

  • scriptgen

  • apdutool

  • converter

  • normalizer

  • maskgen

  • capdump

  • exp2text

  • off-card verifier

These Java utilities and programs can be localized in a similar fashion. Each uses the Java language resource bundle mechanism. This mechanism allows the user to customize locale-sensitive data for a new locale without rebuilding the application. Refer to the Java SE platform java.util.ResourceBundle class for more information regarding resource bundles.

The development kit also provides localization support for Java Card RMI sample applications and client framework. Localizing the client framework and the sample applications can be done in the same way as the Java Card technology-based utilities.

Since none of the Java Card platform reference implementation utilities or programs require a graphical user interface (GUI) and are not dependent on user input, the majority of the locale-specific data consists of static strings. Localization consists of customizing these strings for the intended locale. Locale-sensitive strings are grouped into .properties files (for example, MessagesBundle.properties). Localizing an application entails creating a new version of the properties file that contains the translated strings.

Localizing a Java Program

To localize a Java program:

  1. Create a new version of the property file which contains the set of strings customized for the intended locale.
  2. Rename the property file with the appropriate locale identifier appended to the file name (for example, the French version of the MessagesBundle.properties file would be MessagesBundle_fr.properties).
  3. Include the location of the property file in the CLASSPATH for the cref utility.

    When the Java utility is executed in an environment with the same locale as the properties file, the strings contained in that properties file are used for output.