lang helper

Previous Next

The lang helper can be used to add text translations to an HTML element. It does this by adding extra HTML elements that secure the original string.

Syntax

{{lang string element-name }}

 

element-name  ::=  "html"

 

String is required. The optional element-name, if specified, must be "html".

 

Example

<div>{{lang props.label "html"}}</div>

 

can be converted to:

<div>
  <script class="lang-start" type="text/html">original text</script>
         translated text
 <script class="lang-end" type="text/html"/>
</div>

 

Short notation

In most cases USoft supports a short notation:

{{'Example'}} or {{"Example"}}

 

is equivalent for…

{{lang 'Example'}} or {{lang "Example"}}

 

This short notation can be useful within the HTML property of an HTMLControl.