An Example: InternationalizationTest

To better understand how all this fits together, take a look at this simple Java application that makes use of several of the features discussed in this chapter.

The simple application takes up to three command-line parameters that specify a locale and uses this information to

  • Display some information about the default locale and the one entered.

  • Try to load a ResourceBundle corresponding to the specified locale and print out what the Bundle contains.

  • Display the date, localized to the specified locale.

Besides the main application class called, the program requires three other files. The three files are .properties files that correspond to three supported locales. They will get ...

Get Special Edition Using Java 2 Standard Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.