Pass Parameters and HTML

This topic applies to the Kilimanjaro release of SCA and earlier. If you are localizing text using an extension, 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 example below, the variable values of $(0) and $(1) are passed 20 and 43 respectively.

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

        

Pass HTML

In the example below, an HREF segment is passed to the translate function so the translated string is followed by the correct URL.

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

        
Important:

When you add new _.translate() functions with parameters and HTML, make sure your translation vendor translates only the literal strings, not the parameter or HTML code segments.

Related Topics

General Notices