2 18 Multilingual Variables

LANSA for i

2.18 Multilingual Variables

A multilingual variable is a text string that changes value according to the language being used.

The following example of a text string means the same thing in different languages, but has a different textual value in each language:

"Locate Employee by Name"

"Ricerca Alfabetica Impiegati"

"Zoek Werknemer op Naam"

If this was a piece of text that you wished to place on a screen, a report, or send in a message, then a multilingual variable (called an *MTXT variable as well) should be used.

By positioning an *MTXT defaulted field on the screen, rather than just text, the values that appear on the screen at execution time will vary according to the language being used.

In many respects *MTXT variables are just like system variables (described in 2.16 System Variables), and they can be used in the same places as system variables:

  • As a field's default value in the data dictionary.
  • In any of the 6 standard types of field validation rules.
  • Just about anywhere in the RDML components of LANSA.

The extensive use of multilingual variables in validation rules has many advantages:

  • The validation rules are simpler and easier to understand.
  • The validation rules are more powerful and more accurate.
  • The validation rules work in multiple languages.

For example, imagine these multilingual variables:

*MTXTMON

"Monday" in all desired languages

*MTXTTUE

"Tuesday" in all desired languages

*MTXTWED

"Wednesday" in all desired languages

*MTXTTHU

"Thursday" in all desired languages

*MTXTFRI

"Friday" in all desired languages

*MTXTSAT

"Saturday" in all desired languages

*MTXTSUN

"Sunday" in all desired languages

*MTXTERR001

"Day of week specified is invalid" in desired languages

 

Then, in just one list of values rule in the dictionary, a file or an RDML program, you could validate the day of the week (in the current language) and issue an error message (in the current language).

Additionally, as the "dictionary" of *MTXT variables grows, they will become used repeatedly in different applications. For instance *MTXTMON, *MTXTTUE, etc might be used as column headings on screens or reports.

Note: Before attempting to make large scale use of *MTXT variables please develop and use naming standards for them.