Translating rule project items

You can change the display name of a rule project item either when you create the item, or later.

About this task

To translate a rule project item name, you prefix it with a percentage sign (%), create a messages file in your rule project and then populate it with key-value pairs for each item name you want to change.

Note: The translation of ruleset parameters and variables in multi-locale rule projects is not supported.

Procedure

To add a percentage sign prefix and create the messages file:

  1. To add a percentage sign prefix
    1. In the Rule Explorer, select the rule project item.
    2. Right-click the item and then click Refactor > Rename.
    3. In the Rename Element dialog, type a % sign at the beginning of the rule project item name.
    4. Click OK.

      In your project, the new name replaces the old name and includes the % prefix.

  2. To create the messages file:
    1. In the Rule Explorer, select the project whose items you want to translate.
    2. Right-click the project and then click New > File.
    3. In the New File dialog, in the File name field, type messages_<locale>.properties.

      where <locale> is the Java™ representation for your target locale. You can define the target locale by language or country. For example, fr (French) or fr_FR (France), zh (Chinese) or zh_CH (China or Simplified Chinese).

      For example: messages_fr_FR.properties.

    4. For each rule project item that you want to translate, enter a line in the messages file in the following format: <key>=<value>.

      Where <key> is the current rule project item name that is prefixed with the % sign, and <value> is the translated version of it.

      For example:

      Entering a line for each artifact

      You can list the items in any order. You do not have to reflect the different levels in the hierarchy.

    5. Save the messages file.

      The name of each artifact in your project changes to the new value. Only those artifact names that are prefixed with % are changed.

      Note: You can see the new values in the Rule Designer specific views such as the Rule Explorer or the ruleflow editor. In generic Eclipse views such as the Problems view or the Project Explorer view, the artifacts are still displayed with the original name prefixed with the % sign.