2020.2

Table Of Contents
The translate() function gets the translation for a message, provided that a translation entry
can be found for it (with the same context, if given).
If the text to be translated does not already exist in the template, you can create a translation
entry for it by using the Add Empty String button on the "Translations pane" on page568.
Note that calling the translate() function may be unnecessary if a script adds text to an
element that has the data-translate attribute; see "Tagging text that is inserted by a script" on
page444. In that case, any existing translation will be applied automatically.
translate(message, context)
The translate() function gets the translation of a source text with an (optional) context. It
returns the message as-is if no translation is found.
message
String containing the message (the source text).
context
The message's context (optional). A context may be specified when creating a translation
entry. Specifying a context makes it possible to translate a certain text in different ways.
Example
The following line of code gets the translation of the string "Submit" that was registered with the
context "button".
var str = translate( "Submit", "button" );
Control Script API
The table below lists the objects that are the most important in Control Scripts. Click through to
the object to find a description and sample scripts.
See "Control Scripts" on page417 for information about this kind of scripts, how to insert them
and what you can do with them.
Other objects that are available to Control Scripts
The list below isn't exhaustive: most of the objects listed in the Designer API (see "Standard
Script API" on page780) are also available in Control Scripts. Not all of those objects can be
Page 889