Pass Parameters and HTML

This topic applies to

Applies to

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

Important

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) 

Pass HTML

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>')

Important

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.