2 Internationalization and Localization for WebLogic Server
- About Internationalization and Localization Standards
Oracle has adopted the World Wide Web Consortium's (W3C) recommendations for standard formats and protocols that are usable worldwide in all languages and in all writing systems. These standards are part of the Java internationalization APIs that are used by WebLogic Server. - Understanding Internationalization and Localization for WebLogic Server
Localization covers not only language, but collation, date and time formats, monetary formats, and character encoding. Messages that are logged to the WebLogic Server log can be localized to meet your particular requirements. - Understanding Message Catalogs
All internationalized text is defined in message catalogs, each of which defines a collection of log messages or simple text. - Understanding Java Interfaces for Internationalization
WebLogic Server uses the Java internationalization interfaces to provide internationalization and localization. - Main Steps for Creating an Internationalized Message
Creating an internationalized message comprises creating a top-level message catalog or local-specific catalog, running the WebLogic utility for validation, and configuring your application to use the generated runtime classes.
About Internationalization and Localization Standards
Oracle has adopted the World Wide Web Consortium's (W3C) recommendations for standard formats and protocols that are usable worldwide in all languages and in all writing systems. These standards are part of the Java internationalization APIs that are used by WebLogic Server.
Internationalization (I18N) refers to the process of designing software so that it can be adapted to various languages and regions easily, cost-effectively, and, in particular, without engineering changes to the software. Localization (L10N) is the use of locale-specific language and constructs at runtime.
Understanding Internationalization and Localization for WebLogic Server
-
Log messages - Log messages are informational messages that are written to the server log, and may also contain error messages if the appropriate message arguments are included in the message definition. See Elements of a Log Message Catalog.
-
Simple text - Simple text is any text other than log messages and exceptions that the server must display, such as the output from a utility. Examples of simple text include usage messages, graphical user interface (GUI) labels, and error messages. See Elements of a Simple Text Catalog.
Understanding Message Catalogs
All internationalized text is defined in message catalogs, each of which defines a collection of log messages or simple text.
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. The output sent to the WebLogic Remote Console is simple text. As with log messages, simple text can be merged with dynamic data.
To create an internationalized message, you externalize all message strings in a message catalog so that the strings can be converted to multiple locales without changing or recompiling the code. The application code supplies runtime values to the logging methods. The logging methods merge the code with the message string in the catalog according to the current locale. The application code then prints a localized message in the log files.
There are three types of message catalogs:
-
Log message catalogs - Collections of log messages. See Elements of a Log Message Catalog.
-
Simple text message catalogs - Collections of simple text messages. See Elements of a Simple Text Catalog.
-
Locale message catalogs - Collections of locale-specific messages corresponding to a top-level log message or simple text catalog. See Elements of a Locale-Specific Catalog.
Message IDs in log message catalogs or locale message catalogs are unique across all log message or locale message catalogs. Within the message catalog file, each localized version of the 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 easily find it. Message IDs in simple text catalogs are unique within each simple text catalog. See Using Message Catalogs with WebLogic Server.
To view the WebLogic Server message catalogs, see Error Messages.
Understanding Java Interfaces for Internationalization
WebLogic Server uses the Java internationalization interfaces to provide internationalization and localization.
In addition to understanding how WebLogic Server handles internationalization, you should be familiar with the Java internationalization interfaces and the following classes included in the Java Development Kit (JDK).
Table 2-1 Internationalization Classes in JDK
Class | Description |
---|---|
java.util.Locale |
Represents a specific geographical, political, or cultural region. |
java.util.ResourceBundle |
Provides containers for locale-specific objects. |
java.text.MessageFormat |
Produces concatenated messages in a language-neutral way. |