Internationalization

Syntax

The easiest way to translate a string or variable is to enclose it between {_ and _}:

{_ var _}
{_ "hello" _}

Tags

trans

Translates a variable or string

Example:

{% trans var %}
{% trans "hello" %}

Filters

trans

Translates a variable or string.

For example:

{{ var | trans }}
{{ "my string" |  trans }}

Choosing language

To choose the language to use, set the *CURRENT-LANGUAGE* variable.

For example:

(let ((djula:*current-language* :es))
   (djula:render-template* +translation.html+))

Backends

Djula supports two backends for doing translations: cl-locale and gettext

Please have a look at the demo and the documentation of those packages to figure out how to use them.