In order to internationalize a web site’s ResourceBundle
logs and user messages, you must copy, rename, and translate the ResourceBundle.properties
files. These files must be renamed according to the Java naming conventions to enable ResourceBundle
inheritance.
For translation instructions, see ResourceBundle Translation Instructions. For information on ResourceBundle
inheritance see ResourceBundle Inheritance.
Preparing ResourceBundles for Internationalization
Each ResourceBundle.properties
file should contain comments, which are formed by lines with either a #
or !
as the first character. Each property’s comments should describe whether the property affects user messages, developer messages, or log messages. These comments should also mark certain properties that should not be translated.
An internationalized Oracle Commerce Platform web site uses the Java ResourceBundle
class to dynamically display the appropriate ResourceBundle
object. The Java ResourceBundle
naming guidelines stipulate that each ResourceBundle.properties
file must designate a locale in the file name, which must be in the following format: basename_language_country_variant
. The language
suffix is required, and the variant
and country
suffixes are optional.
In order to fully internationalize a web site, each user message ResourceBundle.properties
file must be copied and renamed with the appropriate language
, country
, and variant
suffixes. For example you can copy the ResourceBundle
DynamoBundle.properties
and rename it DynamoBundle_fr_FR.properties
for the fr_FR
locale.
The following displays an example of ResourceBundles
with the basename
DynamoBundle
for five locales:
DynamoBundle_en_US_UNIX.properties DynamoBundle_en_US.properties DynamoBundle_fr_FR.properties DynamoBundle_de_DE.properties DynamoBundle_ja.properties
Each user message ResourceBundle.properties
file should be translated according to the guidelines in the ResourceBundle Translation Instructions section in this chapter. In addition, any references to other .properties
files, JSP files, HTML files, GIF files, and other media files should be changed to reflect the names of new files.
Note the following:
You must perform an ASCII conversion to Escaped Unicode for all translated
ResourceBundle
files that contain non-Latin 1 fonts or non-Unicode characters (including single-byte character sets). For more information, see Converting Properties Files to Escaped Unicode.Make sure that the internationalized
ResourceBundles
are referenced in the Oracle Commerce Platform CLASSPATH.