Pass Parameters and HTML

This topic applies to

Applies to

SuiteCommerce Advanced | Denali | Mont Blanc | Vinson | Elbrus | Kilimanjaro


If you are localizing text using an extension for SuiteCommerce Standard or SuiteCommerce Advanced, see Localize Text in an Extension.

In addition to passing string literals to the _.translate() function, you can also pass parameters and HTML segments.

Pass Parameters

In the following code, the variable values of $(0) and $(1) are passed 20 and 43 respectively.

_(‘'Subtotal: ($(0) of $(1))'’).translate(20,43)


In the following code, an HREF segment is passed to the translate function so that the translated literal string is followed by the correct URL.

_('Continue Shopping on our $(0)').translate('<a href="/" data-touchpoint="home">' + _('Home Page').translate() + '</a>')


When customizing your applications with new _.translate() functions using parameters and HTML, ensure that your translation vendor does not translate the parameter or HTML code segments, only the literal strings.