Basic Internationalization in a Java Application

Internationalization is usually referred to as i18n, because there are eighteen letters between the initial i and the final n. Here is a simple example of the type of code that might benefit from being internationalized:

public GUI()
     {
       Label nameLabel = new Label("Name");
        TextField greeting = new TextField("Hello");
        ...
        }

The user interface this type of code generates works fine in the U.S., but it might not work well in other countries where English is either not the primary language, such as Japan or France, or in a country where English has different idioms than in the U.S. It is important to be able to modify this English text to a more appropriate language for a given locale.

Note

To support ...

Get PURE Java™ 2 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.