2019.2

Table Of Contents
Translating content that is inserted by a script
Personalization scripts may add content to the output. OLConnect will apply translations to that
content at the moment it is added to the template, for example with the html() or replaceWith()
function. Translations are applied if that content is marked for translation, and if there is a
matching translation entry (see "Tagging text that is inserted by a script" on page911).
Tagging elements for translation
In order to mark text for translation, you have to tag the HTML element that holds the text.
When you add elements, such as text, images or a table, to the content of a template, you are
actually constructing an HTML file. It is possible to edit the source of the HTML file directly in
the Designer; see "Editing HTML" on page629.
However, to tag an element for translation, you don't have to go into the Source view.
1. Place the cursor in the text that should be translated and select the HTML element in the
breadcrumbs (see "Selecting an element" on page632) or select the element via the
Outline view. Elements that contain text are paragraphs, headings, table cells, buttons,
labels etc.
2.
Open the Translations pane. If it isn't visible, select: Window > Show View >
Translations from the menu.
3.
Click the Tag Element button in the toolbar of the Translations pane. This adds the
data-translate attribute to the element. (Attributes are visible on the "Source tab" on
page1051.)
If there was no translation entry with the same text already, the text of the tagged element is
copied to a new translation entry on the Translations pane.
One translation entry works for all HTML elements that are tagged for translation and have
exactly the same text.
Note
Remember, only text in HTML elements that are tagged for translation get translated in
the output.
Page 909