BEA Logo BEA WebLogic Server Release 6.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

   BEA WebLogic Server Internationalization Guide:   Previous topic   |   Next topic   |   Contents   

 

Overview of Internationalization for WebLogic Server

 

Internationalization (I18N) refers to the preparation of software so that it behaves properly in multiple locations. Localization (L10N) is the use of locale-specific language and constructs at run time. The information covered in this guide only addresses the presentation of textual data.

Log messages contain data that is written to the log file. This data is predominantly dynamic, and contains information that is specific to the current state of the application and system. When merged with text in a localized log message catalog, this data results in well-formatted, localized messages that describe the error condition in the language of the user.

This section includes the following topics:

Understanding Log Messages

To create an internationalized message, all message strings must be externalized in a message catalog so that they can be easily converted to multiple locales without changing or recompiling the code. The application code supplies any run-time values to the logging methods, which merge the code with the message strings in the catalog per the current locale, and prints a localized message in the log files.

Within the message catalog file, each message is assigned a unique message ID and message text specific to the error. Ideally, a message is logged from only one location within the system so that a support team can find it easily.

The following steps are involved in creating an internationalized message:

  1. Define the message in a message catalog. For details, see " Using the BEA WebLogic Server Internationalization Tools and Utilities."

    In addition to message text, a catalog entry also contains information about the type and placement of any run-time values that the message contains.

  2. Run i18ngen, which validates the message catalog and generates a Logger (a Java class) for each catalog. The generated class has a method for each message, according to information specified in the message catalog entry.

  3. When a particular message needs to be logged, the application code must invoke the relevant generated method from its Logger and provide the run-time values as arguments.

  4. The Logger method combines the run-time values and the message strings in the catalog to create localized entries in the WebLogic Server log files.

For more detailed information, including an overview of the logging subsystem and a description of log message parts, see "Using Log Messages to Manage WebLogic Servers" in the WebLogic Server Administration Guide.

Understanding Localization

Localization covers not only language, but collation, date and time formats, monetary formats, and character encoding. Messages that are logged to the WebLogic Server error log can be localized.

WebLogic Server internationalization supports localization of two types of data:

Java Interfaces for Internationalization

Users of the Java internationalization interfaces should be familiar with the following interfaces included in the Java Developer's Kit (JDK):

java.util.Locale

Represents a specific geographical, political, or cultural region.

java.util.ResourceBundle

Containers for locale-specific objects.

java.text.MessageFormat

A means to produce concatenated messages in a language-neutral way.

Internationalization catalogs reside as XML files in the directory

  weblogic/msgcat

Localization catalogs reside as XML files in subdirectories to weblogic/msgcat. (see Catalog Hierarchy). These XML catalogs are compiled into classes during the build process; the methods of the resulting classes are the objects used to log messages at runtime.

The message catalogs are XML files that contain a description of a collection of text messages, each indexed by a unique idenifier. Catalogs for the base locale are defined by the document type definition (DTD) in msgcat.dtd. Catalogs which provide different localizations of the base catalogs are defined in msgcat subdirectories named for the locale (for example, weblogic/msgcat/ja for Japan), and use l10n_msgcat.dtd.

 

Back to Top