Example: Localized stxt and exs file excerpts

The following are excerpts of both the .stxt file and the .exs file that must be edited during the process of localizing a rulebase as described in the topic Localize an existing rulebase.

.stxt file excerpt

Note that a Boolean and a non-Boolean attribute type has been included to demonstrate the various states and text of each type. As mentioned, most/all of the translations that need to be done to localise a .stxt file involves translating the various states of an attribute.

Also note that the text to be translated is the text inside the XML tags, and there are tokens (for example, %app_name?%) that need to be preserved when translating

...
      <string key="true">true</string>
      <string key="false">false</string>
      <string key="uncertain">uncertain</string>
      <string key="unknown">unknown</string>
      <string key="male">Male</string>
      <string key="female">Female</string>
      <attribute attr-id="b18@Interpretative" entity="global">
            <basic>the applicant is male</basic>
            <third-person>
                  <positive>%app_name?% is male.</positive>
                  <question>Is %app_name?% male?</question>
                  <negative>%app_name?% is not male.</negative>
                  <uncertain>%app_name?% might be male.</uncertain>
            </third-person>
      </attribute>
      <attribute attr-id="hhm_age" entity="hhm_name">
            <basic>the household member's age</basic>
            <third-person>
                  <text>%hhm_name?%'s age</text>
                  <positive>%hhm_name?%'s age is %hhm_age%.</positive>
                  <question>What is %hhm_name?%'s age?</question>
                  <uncertain>%hhm_name?%'s age is uncertain.</uncertain>
                  <unknown>%hhm_name?%'s age is unknown.</unknown>
            </third-person>
      </attribute>
...

.exs file excerpt

The following is an excerpt from an .exs file. It is much trickier to localize than an .stxt file and requires knowledge of what constitutes display text and what constitutes screen metadata.

Note that the text to be translated is both inside XML tags and also the values of XML attributes. Another difference from .stxt localization is that some values inside XML tags should not be translated.

<screen type="question" id="s1@Screens" title="Income and Resources" entity="global">
      <label text-style="Heading 5">
            <caption>Income (monthly)</caption>
      </label>
      <money-attr attr="income_salary" default="0">
            <readonly-expr>
                  <rb:false-value />
            </readonly-expr>
            <mandatory-expr>
                  <rb:true-value />
            </mandatory-expr>
            <caption>Income from wages and salary:</caption>
            <property key="ClassOverride">Body_body</property>
      </money-attr>
      <money-attr attr="income_tips" default="0">
            <readonly-expr>
                  <rb:false-value />
            </readonly-expr>
            <mandatory-expr>
                  <rb:true-value />
            </mandatory-expr>
            <caption>Income from tips:</caption>
            <property key="ClassOverride">Body_body</property>
      </money-attr>
      <money-attr attr="income_selfemployment" default="0">
            <readonly-expr>
                  <rb:false-value />
            </readonly-expr>
            <mandatory-expr>
                  <rb:true-value />
            </mandatory-expr>
            <caption>Income from self-employment:</caption>
            <property key="ClassOverride">Body_body</property>
      </money-attr>
      <money-attr attr="income_boarders" default="0">
            <readonly-expr>
                  <rb:false-value />
            </readonly-expr>
            <mandatory-expr>
                  <rb:true-value />
            </mandatory-expr>
            <caption>Net income from boarders/lodgers:</caption>
            <property key="ClassOverride">Body_body</property>
      </money-attr>
      <money-attr attr="income_unearned" default="0">
            <readonly-expr>
                  <rb:false-value />
            </readonly-expr>
            <mandatory-expr>
                  <rb:true-value />
            </mandatory-expr>
            <caption>Unearned income:</caption>
            <property key="ClassOverride">Body_body</property>
      </money-attr>
      <money-attr attr="child_support" default="0">
            <readonly-expr>
                  <rb:false-value />
            </readonly-expr>
            <mandatory-expr>
                  <rb:true-value />
            </mandatory-expr>
            <caption>Child support:</caption>
            <property key="ClassOverride">Body_body</property>
      </money-attr>
      <label text-style="Heading 5">
            <caption>Resources</caption>
      </label>
      <money-attr attr="resources" default="0">
            <readonly-expr>
                  <rb:false-value />
            </readonly-expr>
            <mandatory-expr>
                  <rb:true-value />
            </mandatory-expr>
            <caption>What is the value of the household's resources (Savings, Stocks, Car ...)?</caption>
            <property key="ClassOverride">Body_body</property>
      </money-attr>
</screen>