Translate text

Syntax

$input.translate(
    targetLang: $targetLang, 
    sourceLang: $sourceLang
)

Translates the input text into the target language.

Parameter

Name Type Description Mandatory Default
input Text The text to be translated. yes
targetLang String The language to translate into yes
sourceLang String The language of the input string, or "auto" to auto-detect the language. no The language of the current user, or the default language of the application.

Return value

Type: Text

The input value in the requested target language.

Examples

Translation of "Hello world!" to German.

"Hello world!".translate(targetLang: "de")