localizeΒΆ

This localizes a phrase.

Parameters:

_key
The property key.
_locale
A string-representation of a locale. If the locale is not set, the site language is used.
_values
Optional placeholder values (comma separated).

Usage in Thymeleaf:

<div data-th-text="${portal.localize({'_key=mystring','_locale=en'})}">Not translated</div>

Usage in XSLT:

<xsl:stylesheet version="2.0" exclude-result-prefixes="#all"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:portal="urn:enonic:xp:portal:1.0">

  <xsl:template match="/">
    <xsl:value-of select="portal:localize('_key=mystring')"/>
  </xsl:template>

</xsl:stylesheet>