Previous | Next | Trail Map | Writing Java Programs | Writing Global Programs


What Is a Global Program?

Simply put, a global program is one that tailors its presentation of information to the user according to the user's preferred language and customs and therefore can be used comfortably by anyone, anywhere in the world.
Definition: A global program is a program that tailors the presentation of information to the user according to the user's preferred language and customs.

To better understand what a global program is, let's begin with a "myopic" program and watch its transformation into a global program. Along the way, this section will highlight the features of a global program.

What are the features of a myopic program? All of the language-dependent code and text are buried in the code alongside language-independent code and text. Text elements, such as labels for GUI elements and error messages, are written in "hacker-eze" (usually grammatically incorrect American English peppered with curses). The program is an amorphous blob of code and text with all sorts of language dependencies buried in the code:

At this point, some sales person in Europe says that the company could make millions if the program "spoke French and German". The programmers kick into high gear and create two new versions of the program: One that speaks French and the other that speaks German:

Modifying a program for use in a specific locale is called localization. Localization includes the obvious translation of GUI labels and error messages, but it also includes the customization of any feature for the target locale.


Definition: Localization is the process of adapting a program for use in a specific locale.

Often, when people think of localization, they think of creating a new version of a program on a per-country basis. However, country is not a good enough distinction. Consider Canada: English Canada and French Canada share many of the same laws, but a different language (and some very different language based laws). Thus, we use the term locale to mean some geographic or political region that shares the same language and customs.


Definition: A Locale is a geographic or political region that shares the same language and customs.

Localizing a myopic program in this manner has several problems:

There must be a better way! Yes. There is.

Before localizing a program, the programmer should internationalize it. That is, the programmer should isolate the language-dependent parts of the program and separate them from the language-indepedent parts.


Definition: Internationalization is the process of isolating the language-dependent code in a computer program from the language-independent code.
Once internationalized, the program can be easily localized for each target locale. This is a truly global program:


Definition: A global program is one that has been internationalized and localized.

The Global Features of the JDK

When writing a program for the global market, programmers have many issues to consider: Character handling, bundling language-dependent resources, sorting (collation), text boundaries, and date and number formatting. Fortunately, the 1.1 release of the JDK contains many features that help programmers create global programs.


Previous | Next | Trail Map | Writing Java Programs | Writing Global Programs