2022.2

Table Of Contents
Stringcontainingthemessage(thesourcetext).
context
Themessage'scontext(optional).Acontextmaybespecifiedwhencreatingatranslationentry.Spe-
cifyingacontextmakesitpossibletotranslateacertaintextindifferentways.
Example
Thefollowinglineofcodegetsthetranslationofthestring"Submit"thatwasregisteredwiththecontext
"button".
var str = translate( "Submit", "button" );
Control Script API
ThetablebelowliststheobjectsthatarethemostimportantinControlScripts.Clickthroughtothe
objecttofindadescriptionandsamplescripts.
See"ControlScripts"onpage838forinformationaboutthiskindofscripts,howtoinsertthemand
whatyoucandowiththem.
Other objects that are available to Control Scripts
Thelistbelowisn'texhaustive:mostoftheobjectslistedintheDesignerAPI(see"StandardScriptAPI"
onpage1169)arealsoavailableinControlScripts.NotallofthoseobjectscanbeusedinControl
Scripts,however.ThisisbecauseControlScriptsdifferfromtemplatescripts(see"WhatControl
Scriptsare"onpage838).Forexample,thequery()functioncan'tbeusedinaControlScript
becauseitrequiresaccesstotheDOMwhichaControlScriptdoesn'thave.
Object Usage
channel(see
"Channel"on
page1294)
Thechannelforwhichoutputisgenerated.Thisisregisteredinthemergeobject:merge.channel.Notethatthechanneldoesn't
changewhentheoutputconsistsofdifferentcontexts.Whengeneratingemail,forexample,thechannelisEMAIL,evenwhenmer-
gingthePrintcontexttoattachittotheemail.
"context"on
page1299
Objectthatcontainsonecontextanditssections.Itisaccessedthroughthetemplateobject:merge.template.contexts.To
getaccesstoonecontext,youhavetospecifytheContextType(see"ContextType"onpage1295),forexample:var printCon-
text = merge.template.contexts.PRINT;.
Throughthemergeobjectyoucanfindoutwhichcontextiscurrentlybeingmerged:merge.context.
"masterpage"on
page1274
ThemasterpageobjectisusedtosetaMasterPage'sheaderandfooterortoreplaceitsentireHTMLbody.
"merge"on
page1313
Themergeobjectgivesaccesstothetemplatewithallofitscontextsandsections.
Page 1271