Translate Dynamically Generated Text Created by Rulebase
Text constructed within a rulebase can be localized and extracted into the UserText.properties resource bundle.
The text within <op func="concat"> is dynamically constructed by the rulebase engine and saved within the WORKITEMDETAIL database table during work item creation process. This text does not get translated when you switch to a different locale.
To translate dynamically-generated text created by a rulebase engine, use the following rulebase function which takes message text, parameter list, and the resource ID.
<op func="message"> <text resourceid=''>Text Message</text> <parameter> <name>parameter name</name> <var>parameter value to be fetch from a variable</var> </parameter> </op>
From this rulebase function, the resource ID is assigned to the message and it is then extracted into the UserText.properties resource bundle. The text value specified is the default text to be used when no resource ID entry is found in the resource bundle.
The above snippet will then be replaced with the new rulebase function as follow.
<action> <assign> <var>WORKITEM_DESCRIPTION</var> <op func = "message"> <text resourceid="RB-1001"><![CDATA[Record $PrimaryRecord$ in Master Catalog $MasterCatalog$ is being added. Your approval is requested. ( Total records in this workitem: <Parameter name='RECORD_COUNT'/>)</text> <parameter> <name>RECORD_COUNT</name> <var>WORKITEM/RECORD_COUNT</var> </parameter> </op> </assign> </action>
After changing the rulebase files, the resource strings with resource IDs RB-1001 must be added into the UserText.properties resource bundle.