Example 2: Mark contents as translateable with translation file
By useing the swac_lang HTML attribute you can define the content of tags and attributes as translatebale. This example shows on which tags and attributes translation is useable.
Translate in Textblock:
This is my original text. It should be replaced if i choose a translation.
<p swac_lang="Example.myTextblock">
This is my original text. It should be replaced if i choose a translation.
</p>
Translate in link description
Example.myLinkCaption
<a href="#top">Example.myLinkCaption</a>
Translate in labels
<label class="uk-form-label">Example.myLabel</label>
Translate in value attributes:
<input type="submit" class="uk-button" value="Example.myButtonCaption">
Translate in title attributes:
<input type="text" class="uk-input" placeholder="Example.myPlaceholder">
Translate in alt attributes:
<img src="nonexisting.jpg" alt="Example.myAlt">
Translate in uk-tooltip attributes:
Hover over this link
<a href="#top" uk-tooltip="Example.myTooltip">Hover over this link<a>
Translate placeholders:
<input type="text" class="uk-input" placeholder="Example.myPlaceholder">
Translate in any attribute:
Look at the data-translated attribute
<a href="#" swac_langattr="data-translated:Example.myDataTranslated"">Look at the data-translated attribute<a>