2.7 text

To support multilingual dialogs the DM provides the resource text. The dialog is initially developed in one language.

The resource text is introduced during the translation into a new language. A string from the original language is defined together with its translations in this process.

Definition

{ export | reexport } text { <Identifier> }  "<original string>"
  <variantDef> | ;
variantDef ::=
{
           1 : "<translated string>" | nlscat(<message number>) ;
  [ <number> : "<translated string>" ; ]
}

The identifier is optional, i.e. it does not have to be indicated necessarily. By means of the identifier, the text can be referenced in the dialog.

The first translation can be either a <translated string> or an entry from a message or text catalog nlscat(<message number>), further translations are defined as <translated string>.

The access of the Dialog Manager to the text is as follows:

The function which was installed with DM_InstallNlsHandler is called. Then the text is stored internally. The access applies only to texts actually used.

The texts have to be defined in ISO 8859/1 standard, which is suitable for almost all European languages, so that as many different characters as possible can be represented. Then the DM converts this representation into the representation of the corresponding window system, so that the characters are correctly represented.

The characters can be input according to the following pattern:

All 7-bit characters are directly entered with the relevant editor, i.e. all ASCII characters can be directly entered. This kind of character input guarantees that all editors can correctly represent these characters, because many editors can only represent 7-bit characters.

All 8-bit characters have to be entered in octal notation, i.e. characters that are larger than 127 have to be entered as octal number with a leading backslash "\".

Figure 20-1: Table for Octal Values

To describe a certain character, e.g. "A", you first have to specify the corresponding value on the y-axis:

-> 10x

"x" then has to be substituted by the corresponding value on the y-axis:

-> xx1 (xx stands for the above results of 10)

It results in:

=> \101

Further Examples

ö

36x

xx6

=>

\366

#

04x

xx3

=>

\043

Example

text "Hello world"

{

  1:  "Hallo Welt";

  2:  "Allo le monde";

  3:  "Buon giorno il mondo";

  4:  "Holá mundo";

}

By selecting one of the languages 1–4 with the option ‑IDMlanguage, the string "Hello World" is replaced with the corresponding translation throughout the dialog. You can get the defined text either by inputting the original text or by inputting the identifier.

Example

text WindowText "Window"

{

  1:  "Fenster";

  }

Window.title := WindowText;

is the same as

text "Window"

{

  1: :"Fenster";

}

Window.title := "Window";

Remark

With the attribute .text you can get the string in the current language variant.

2.7.1 Note on the use of symbol fonts under Microsoft Windows

When using fonts that contain symbols (e.g. Wingdings) the following should be observed:

  1. The name must correspond to the actual name of the font (no alias). If Windows executes a font exchange, IDM recognizes this and forces the replacement to a font that supports the WIN ANSI character set. This is necessary to prevent the unintentional selection of an illegible font.
  2. A font that contains symbols is allocated to the Windows SYMBOL character set. This is mapped on the Unicode rage \uF000–\uF0FF (user-defined range in Unicode). In order to display the character 0xFE, \uF0FE must be defined.

    Remark

    This is generally not necessary on a western European Windows system as the system code page CP1252 is almost identical to the lower Unicode range and contains almost all characters. This is why this does not lead to a conversion and the desire character is shown – quasi by chance. This however is not the case on other Windows language versions.