Localize an existing rulebase

A rulebase authored in Oracle Policy Modeling can be localized so that when running the rulebase in Oracle Web Determinations, the user has the choice of running the interview in two or more locales. If the rulebase has commentary and has been localized to another locale, the author has the choice of:

 

Note that to localize a rulebase for small rulebase engagements (presales, proof of concept), it is ideal to have the following:

 

For production rulebases, a strong knowledge of the above mentioned areas is essential.

Example scenario (SocialServicesScreening rulebase):

There is a requirement for a rulebase authored in Oracle Policy Modeling with the default English (en-US) locale, to also be available in another language (for example, Danish: da-DK). To enable this:

 

Understand the process involved in localizing a rulebase and its commentary

The following diagram illustrates the process involved in localizing a rulebase and its commentary:

 

 

Localizing a rulebase

To successfully localize a rulebase, knowledge of XML, OPM xgen files, and Rule authoring is essential.

Localizing commentary

 

Important note:
Subsequent changes to the rulebase or its commentary files/content will require manual changes to the localized commentary files. 

Understand how Oracle Web Determinations uses the localized files

As long as the files are placed in the correct folders, Oracle Policy Modeling will package the files in the rulebase zip file (for example, MyRules.zip) during the Build process.

Important note:
It is important for the user to run the 'Build' process after changes are made to either the stxt/exs localized files or the localized commentary. Running the Build process will update the contents of the rulebase zip with the new changes. If the Build process is not run, the changes will not be propagated into the rulebase zip file.

Localized rulebase files

When Oracle Web Determinations finds localized .stxt and .exs files,

Localized commentary files

A rulebase that has Commentary for the default locale does not necessarily need to provide commentary for its other localizations. For example, with the MyRules rulebase the author can choose to only provide Commentary for the default en-US locale.

This means that if the user chooses da-DK or zh-CN locale for an interview, no commentary will be available. Essentially, Oracle Web Determinations is able to detect if there is a corresponding commentary folder for the locale chosen.

Localize a rulebase

The following steps describe how to localize a rulebase. In this example, the rulebase to be localized is a rulebase called "MyRules" and it has a locale of en-US.

  1. After authoring the rules of MyRules in Oracle Policy Modeling, run the Build process.
  2. Go to the output folder of the MyRules rulebase.
    1. By default this is located on C:\projects\MyRules\Development\output.

  3. Inspect to ensure that the .stxt and .exs files (MyRules.stxt and MyRules.exs) have been generated from the Build process.
  4. For each locale that the MyRules rulebase needs to be localized, do the following:
    1. Create copies of the MyRules.stxt and MyRules.exs, and name it in a format MyRules.xx-XX.stxt and MyRules.xx-XX.exs where xx-XX is the new locale; for example, for zh-CN locale the filenames will be MyRules.zh-CN.stxt and MyRules.zh-CN.exs.
    2. For the .stxt file, note the following:
      1. It is simpler to localize than the .exs screen file.
      2. It is helpful to know the various states of Boolean and non-Boolean attributes as most of the translations to the new locale require translating the text of the various states; for example, Boolean positive/negative/question/uncertain.
      3. Only translate text in between the XML tags; there is no need to translate the XML tags or its attributes.
      4. Be careful to ensure the substitution tokens (for example, %app_name?%) are not removed when translating a text. It is very easy to delete the token, and will result in Oracle Web Determinations errors .
    3. For the .exs file, note the following:
    1. This is much more complicated to localize than the .stxt file. This is mainly because text to be translated is not solely inside the XML tags. Instead, the text to be translated can be inside XML tags, or values of an attribute of an XML tag; for example, for "<screen type="view" id="s9@Screens" name="summary" title="Assessment Summary" entity="global">" the title needs to be translated.
  5. After creating the localized .stxt and .exs files, run the Build again to automatically package those new files into the MyRules.zip.

Localize commentary

The following steps describe how to localize the commentary for a rulebase. The rulebase to be localized is a rulebase called "MyRules" and it has a locale of en-US.

  1. Produce commentary files for MyRules if it is not available or completed:
    1. To generate commentary files for MyRules, in OPM go to 'Build->Generate Commentary Files'.
    2. Once the commentary files have been generated, go to <MyRulesProjectFolder>/Development/include/commentary.
    3. In the commentary folder, there should now be a folder with the name of the project's locale; for example, en-US.
    4. You can add to or modify the generated commentary HTML files.

  2. Once commentary files for the MyRules are complete, it is now ready to be localized.
  3. Create a folder inside include/commentary for each locale you want the commentary localized to; for example, include/commentary/da-DK and include/commentary/zh-CN.
  4. Copy the contents inside the 'en-US' folder, and paste these contents inside the new commentary locales (include/commentary/da-DK and include/commentary/zh-CN).
  5. For each locale, go into each of the HTML file and localize displayed text; note that to be able to determine which text is metadata and which is display text, a knowledge of HTML is desirable.
  6. After localizing the commentary files, run the Build again to automatically package those new files into the MyRules.zip.