Skip to main content
Version: 2026.0

translate

Methods

text

text(pText, pLocale?): string

Translates the text you passed into the language required on the client. Make sure to enter the text without leading or trailing spaces!

Parameters

pText
string | number | boolean

The text to be translated.

pLocale?
string | number | boolean

The language into which the text is to be translated, e.g. "de_DE".

Returns

string

The translation.

Throws

May throw an exception.

Example

question.showMessage(translate.text("Kontaktperson", "en_GB"));

withArguments

withArguments(pText, pArguments, pLocale?): string

Translates a text, using the resources from the application pool.

The text itself can contain placeholders (% 0,% 1,% 2, and so on) that are then replaced by the corresponding arguments.

"%" can be escaped by the backslash.

Parameters

pText
string | number | boolean

The text to be translated.

pArguments
string[]

An array with arguments that were specified in the text to be translated with %0 to %n.

pLocale?
string | number | boolean

The language into which the text is to be translated, e.g. "de" or "de_AT".

Returns

string

The translation.

Throws

May throw an exception.

Example

var ext = fileIO.getName(data).split(".");
ext = ext[ext.length-1].toLowerCase();
question.showMessage(translate.withArguments("Dateiformat %0 nicht unterstützt.", [ext], "en_GB"));