Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Add the part : Translating Text In Form Widgets

...

The text will be translated into the user's language.

Translating Text In Form Widgets

Labels used in forms have to be loaded in memory from parent screens. The map uiLabelMap loaded in screens can be accessed within included forms like :

Code Block
languagexml
<!-- Form widget --> 
    <field name="firstName" title="${uiLabelMap.PartyFirstName}" tooltip="${uiLabelMap.CommonRequired}" widget-style="required"><text/></field> 
    <field name="description" title="${uiLabelMap.CommonDescription}"><text/></field>

Specific Rules :

It is not mandatory for a field title to be specified like in the previous example (${uiLabelMap.PartyFirstName}). If title property is not given, the form renderer will look for a specific property within uiLabelMap using the rule : FormFieldTitle_${field-name}.

In our case for firstName field :

Code Block
languagexml
<property key="FormFieldTitle_firstName">
    <value xml:lang="de">Vorname</value>
    <value xml:lang="en">First Name</value>
    <value xml:lang="es">Primer nombre</value>
    <value xml:lang="fr">Prénom</value>
    <value xml:lang="hi_IN">प्रथम नाम</value>
    <value xml:lang="it">Nome</value>
    <value xml:lang="ja">姓(FN)</value>
    <value xml:lang="nl">Voornaam</value>
    <value xml:lang="pt_BR">Nome</value>
    <value xml:lang="ro">PreNume</value>
    <value xml:lang="ru">Имя</value>
    <value xml:lang="th">ชื่อ</value>
    <value xml:lang="vi">Tên</value>
    <value xml:lang="zh">名字</value>
    <value xml:lang="zh_TW">名字</value>
</property>

 

Display-entity field can be translated within each language using another specific property file. Using the following example as illustration :

Code Block
languagexml
    <field name="statusId"><display-entity entity-name="StatusItem" key-field-name="statusId" description="${description}"/></field>

If nothing is configured, such display entity will display the content of the description attribute from the StatutItem entity record, having in primary key the value of statusId. But only one description can be stored in the database.

In *EntityLabels.xml property files (which have to be loaded like other property files) are defined the translations of such case :

Code Block
languagexml
<property key="StatusItem.description.CAL_CANCELLED">
    <value xml:lang="de">Annulliert</value>
    <value xml:lang="en">Cancelled</value>
    <value xml:lang="es">Cancelado</value>
    <value xml:lang="fr">Annulé</value>
    <value xml:lang="it">Cancellato</value>
    <value xml:lang="ja">取消</value>
    <value xml:lang="nl">Gannuleerd</value>
    <value xml:lang="pt">Cancelado</value>
    <value xml:lang="ro">Sters</value>
    <value xml:lang="ru">Отменен</value>
    <value xml:lang="th">ยกเลิก</value>
    <value xml:lang="vi">Hủy bỏ</value>
    <value xml:lang="zh">已取消</value>
    <value xml:lang="zh_TW">已取消</value>
</property>
    <StatusItem description="Cancelled" sequenceId="99" statusCode="CANCELLED" statusId="CAL_CANCELLED" statusTypeId="CALENDAR_STATUS"/>

Then the display-entity field will display the translation of "Cancelled" for the given record of status item using the identifiing rule : EntityName.FieldToDisplay.ValueOfPK

Translating Text In Mini-Language

The process is similar in Mini-Language, but the syntax is slightly different:

...