Chapter 5. Localization

5.1.  Describe the advantages of localizing an application

[Note]

Internationalization is the process of designing an application so that it can be adapted to various languages and regions without engineering changes.

An internationalized program has the following characteristics:

  • With the addition of localized data, the same executable can run worldwide.

  • Textual elements, such as status messages and the GUI component labels, are not hardcoded in the program. Instead they are stored outside the source code and retrieved dynamically.

  • Support for new languages does not require recompilation.

  • Culturally-dependent data, such as dates and currencies, appear in formats that conform to the end user's region and language.

  • It can be localized quickly.

Localization is the process of adapting software for a specific region or language by adding locale-specific components and translating text.

The primary task of localization is translating the user interface elements and documentation. Localization involves not only changing the language interaction, but also other relevant changes such as display of numbers, dates, currency, and so on. Other types of data, such as sounds and images, may require localization if they are culturally sensitive. The better internationalized an application is, the easier it is to localize it for a particular language and character encoding scheme.

An internationalized program can display information differently throughout the world. For example, the program will display different messages in Paris, Tokyo, and New York. If the localization process has been fine-tuned, the program will display different messages in New York and London to account for the differences between American and British English. An internationalized program references a Locale object to identify the appropriate language and region of its end users.

A java.util.Locale object is an identifier for a particular combination of language and region. If a class varies its behavior according to Locale, it is said to be locale-sensitive. For example, the java.text.NumberFormat class is locale-sensitive; the format of the number it returns depends on the Locale. Thus NumberFormat may return a number as 14 092 011 (France), or 14.092.011 (Germany), or 14,092,011 (United States).

int i = 14_092_011;
Locale l3 = new Locale("en", "US");
System.out.print(l3 + " uses ");
System.out.println(NumberFormat.getInstance(l3).format(i));
					

en_US uses 14,092,011
					

Locale objects are only identifiers. The real work, such as formatting and detecting word boundaries, is performed by the methods of the locale-sensitive classes.

Professional hosting         Free 'Oracle Certified Expert Web Services Developer 6' Guide     Free SCDJWS 5.0 Guide