Table of Contents

In Template

Use double square-brackets.

<div>[[SOME_LANG_CONSTANT]]</div>

In Template (Legacy)

<div>${__h("SOME_LANG_CONSTANT")}</div>

Translate for HTML

var Safe_Html = __h("SOME_HTML");

Translate for Attribute (in HTML Tag)

var Safe_Attr_Value = __a("SOME_STRING");

Translate without Escaping

May break UI, always use __h, __a when possible.

// Function __ is already bound in window object
var Text = __("HELLO_WORLD");