You can translate the text strings of a deployed Visual Composer model using the standard portal translation worklist mechanism. When models are deployed, they are bundled as Portal Archive (PAR) packages and stored in the portal in the Visual Composer folder of the Portal Content Directory (PCD). By setting the proper translation options in Visual Composer (see Prerequisites following), two translation files are created when you deploy (and automatically compile) the model:
· localization.properties: a Visual Composer translation file that contains all the string identifiers (see Text Type Classifications) and raw text strings from the model
· package_lang.info: a portal-like translation worklist file, including the portal UI-string classification codes
Once you deploy your file to the portal, you can translate it using the Translation Worklist Editor, accessed by choosing Content Administration ® Portal Content Translation ® Translation Worklist Coordination. For more information about portal translation procedures, see in the Portal Administration Guide.
All standard plain texts (“static” values) in the model – such as field labels, button labels and tooltips – are entered automatically into the translation lists. However, dynamic text – such as field values – cannot be entered. Dynamic expressions and formulas containing strings can be entered in the translation lists as long as they include a special TRANSLATE function code.
Avoid using the TRANSLATE function for static values, since interpretation of the unnecessary TRANSLATE function may affect runtime performance. However, if you use a dynamic expression in a property, the value is not automatically tagged for translation. In this case, you should use the TRANSLATE function if you want the string to be translated.
● Hello: Tagged automatically for translation
● ”The price is” & @Price: Not tagged for translation
● TRANSLATE(”The price is”)& @Price: Tagged for translation
For more information about the TRANSLATE function, see Text Functions.
You have tagged the model for translation by choosing Options ® Compiler and selecting the following checkboxes:
● Deploy model with PAR
● Generate Translation Info file
To prepare text within a formula (dynamic expression) for translation:
1. To the right of the field (in the Configure Element task panel or in the Control Properties dialog box) that will contain the formula, click fx, Formula or choose Enter formula from the drop-down menu. The appropriate Expression Manager dialog box is displayed.
2. Select the formula and enter the required fields, as needed.
3. Before entering the text string, expand the Text Functions node and double-click TRANSLATE (at the bottom of the list).
4. In the parentheses after TRANSLATE, enter the text and the type of UI-string classification code.
The following is an example of defining a formula that includes a dynamic field (BANK_CTRY) and static text for translation.
Upon deployment, the translation files are created, containing all standard static strings and those strings created in formulas that contain the TRANSLATE code. The result of the previous example would be listed in the package_lang.infofile as follows:
For detailed information about translating primary and nested iViews modeled in Visual Composer, see How to Translate a Visual Composer Model - Part 1 (accessed through the Visual Composer page of SDN).