Translate static content using the loaded dictionary or gettext strings. |
|
| see attr, eval, load, text, t, zena 1.0 | |
You can use the content of the inner html as key for the translation:
<h3 do='trans'>documents list</h3>
If your translation keys do not correspond to the template’s dummy text, you should use text:
<h3 do='t' text='doc_list'>documents list</h3>
or even:
<h3 do='t("doc_#{ref_lang}")'>english docs</h3>
You can create your own translations by writing them in a node. The translations are loaded with the “load” method.
links
If you want to link to a page but have a static text instead of the node’s title, you have to use translate:
<span do='link' anchor='comments' do='t'>comments</span>
We force the use of do='t' so that we can keep dummy text in templates for the designers.
RubyLess integration
You can translate the result of a RubyLess parsing with either of these syntaxes (v is an alias for version):
<p do='trans' eval='v.lang'/> <p do='trans(v.lang)'/>