2022.2

Table Of Contents
Tip: PressingtheCtrlkeywhenyouclicktheTag ElementbuttonopenstheTranslation
StringOptionsdialog.
2. IntheContextfield,describewherethesourcetextisused,forexample:"Thistextisinthehead
ofatable",or"Table|Head"
Thedescriptionisaddedtothe<data-translate>attributeoftheHTMLelementinwhichthesourcetext
islocated,asitsvalue,forexample:<data-translate="Table">.
Notethatatranslationwillonlybeappliedifthevalueofthe<data-translate>attributeoftherespective
HTMLelementisexactlythesameasthegivenContext(case-sensitive).
Tagging text in snippets
Ifthetextthatyouwanttotagfortranslationislocatedinasnippet,donottagitinthesectionwherethe
snippetisused.Instead,openthesnippet(see"Snippets"onpage661)andtagtheelementsinside
thesnippetasdescribedabove.
Tagging text that is inserted by a script
OLConnectwillalsoapplytranslationstocontentthatisinsertedbypersonalizationscripts,butonlyif
thatcontentismarkedfortranslation,andifthereisamatchingtranslationentry.
1. OntheTranslationspane,clickontheNew Empty Stringbuttontocreatethetranslationentry.
2. Makesurethatanyelementinwhichthetextisinserted,aretaggedfortranslation.Therearesev-
eralwaystodothat:
l
LetthescriptinsertthetaggedHTMLelementaswellasthetext,forexample:
results.html( "<p data-translate>Bill to @CustNumber@</p>" );.
l
Ifthescriptinsertstextintoanexisting,emptyHTMLelement,switchtotheSourceview
andaddthedata-translateattributetotheelement(e.g.<pid="p1"data-translate>).
Dataplaceholdersintranslationentries
Atranslationentryinasnippetmayincludeplaceholdersfordatafields,e.g."Dear@name@".(For
moreinformationaboutplaceholderssee"Variabledataintext:scriptsandplaceholders"on
page726.)
Placeholdersmustnotbetranslated;otherwisethepersonalizationscriptwillnolongerreplacethem
withdata
Typically,translatorsarefamiliarwithentriesthatcontainvariables,butyoumayaddacomment
explainingthattheplaceholderisusedasavariableandthatitshouldnotbetranslated.
Page 859