Package examples.i18n

This example demonstrates how to internationalize an application using simple message catalogs.


  i18n Examples Summary

simple This example shows various ways of internationalizing an application using simple message catalogs.
 

Package i18n Description

This example demonstrates how to internationalize an application using simple message catalogs. Message catalogs are XML files that contain a description of a collection of text messages, each indexed by a unique idenifier. You compile these XML files into classes during the weblogic.i18ngen utility build process. The methods of the resulting classes are the objects used to log messages at runtime.

Message catalogs support multiple locales or languages. For a specific message catalog there is exactly one default version, known as the top-level catalog. Then there are corresponding locale-specific catalogs, one for each additional supported locale. The top-level catalog includes all the information necessary to define the message. The locale-specific catalogs contain only the message ID, the date changed, and the translation of the message for the specific locale.

The message catalog files are defined by an XML document type definition (DTD). The DTDs are stored in the weblogic/msgcat directory of WL_HOME/server/lib/weblogic.jar. You can also download the DTDs at:

Detailed instructions for building and running the example is included on the example pages.

 

Before You Begin

When running these examples or testing for correct internationalization, change the locale of WebLogic server. One way you can do this is to change the locale of the server's host computer. On Windows systems, you can easily accomplish this using the "Regional Settings" control panel. However, you can also change the locale of your WebLogic Server by using command-line options when the server's JVM is started. This method may be more desirable, for example, on UNIX systems.

java -Duser.language=ll -Duser.region=CC weblogic.Server

where

ll = two-character language code

CC = two-character country code, or blank if none

For example:

To set only the language code: java -Duser.language=fr -Duser.region= weblogic.Server

To set the language and country codes: java -Duser.language=fr -Duser.region=CA weblogic.Server

Detailed instructions for building and running the example is included on the example pages.