Understand how Web Determinations works with locales
Apply a language specific theme to Web Determinations
Change the text displayed for a specific language
When discussing localization in Oracle Web Determinations, it is important to distinguish between what is the concern of the Interview Engine and that of any clients to that engine such as the Web Determinations platform. In simple terms the Web Determinations client is responsible for localizing everything that is not authored as a part of the rulebase. Further, all Web Determinations and rule engine sessions are created in a specific locale and it is assumed that anything coming out of the rule engine session will be localized according to that locale.
Examples of what the Interview Engine is responsible for include:
- Attribute text, sentence forms, decision reports and so on.
- Controls and screens authored within Oracle Policy Automation.
- The display format of attribute values.
- Warning and Error daemon text.
Examples of what Web Determinations is responsible for:
- Accepted attribute input format(s).
- Any text on screens or screens themselves that are not authored inside Oracle Policy Automation; for example, copyright statements, button text, menu text.
- Error and warning messages, excluding the text of error and warning messages that are authored in Oracle Policy Automation (for example, daemons).
- Templates and style sheets used for rendering screens.
Once an interview session is started in Web Determinations for a given rulebase, the locale that was used to create that session controls the culture of the screens that are displayed for the duration of that interview. There are two ways of selecting the locale for a session:
http://<server>:<port>/<webapp>/startsession/<rulebase>/<locale>For example, to start a session in the 'en-US' locale for the rulebase 'MyRulebase' the URL would look something like:
http://server:8080/web-determinations/startsession/MyRulebase/en-US
Whilst the vast majority of screens in Web Determinations come from the rulebase, there are a few that are not bound to an interview, most notably the rulebase and locale selection screens. In this case, the locale that is used is defined by the 'default.locale' property in the application. properties configuration file.
For information on the localization of error and warning messages, go to the topic below, Change the text displayed for a specific language.
See also:
messages.<locale>.properties file
Web Determinations allows the accepted input and output format(s) of Date, DateTime, Currency and Number attributes to be specified on a per locale basis using its default formatter. The relevant configuration properties are located in the message.properties file.
It is imperative that all localized files are saved with UTF-8 encoding. Failure to do this will cause errors when the properties located in non-UTF-8 encoded files are loaded and retrieved.
The two letter ISO 693-1 code is used to identify any supported language. Where there is the need to support multiple variations of any given language, this may be followed by the two letter ISO 3166-1 country code separated by a hyphen.
Out of the box we provide localizations for the following languages:
Language Locale Code Arabic (Saudi Arabia) ar Chinese (Simplified) zh-CN Chinese (Traditional) zh-HK Czech cs Danish da Dutch nl English (American) en English (Great Britain) en-GB Finnish fi French fr German de Hebrew he Italian it Japanese ja Korean ko Polish pl Portuguese (Brazilian) pt-BR Portuguese (European) pt-PT Russian ru Spanish (Modern) es Swedish sv Thai th Turkish tr
Web Determinations provides the ability to change the look and feel of the application on a per locale basis. The appearance of the application is controlled by the appearance properties. By default, Web Determinations only provides one set of appearance properties, however, these can be overridden on a per locale basis by copying the appearance.properties file, changing the name to appearance.<locale>.properties and then editing the property values as required.
Localization of error and warning messages is, for the most part, the responsibility of the Oracle web Determinations platform. Only error and warning messages that implement either com.oracle.web-determinations.engine.data.error.Error or com.oracle.web-determinations.engine.data.error.Warning are localized in Web Determinations; uncaught exceptions and other non-recoverable errors are handled differently.
Within the Oracle Web Determinations platform, localization is performed through the message service which is responsible for loading the correct message bundle for the specified locale and returning the message for the specific error or warning to be localized. The message bundle itself is a properties file called messages.<locale>.properties. The location of this file is specified by the 'messages.path' property in the configuration file.
The message service also utilizes the Velocity Templating Engine to allow substitution of current property values in the error message; for example, if you wanted to display the attribute ID and the actual value that was entered in an invalid value error, you could do so by setting your error property as:
AttributeValueError = The value ${message.value} is not valid for attribute ${message.attributeId}
The localization settings for displayed text in Web Determinations are managed in the messages.<locale>.properties file.