i18n API¶
registerTranslation¶
Register translations for a language. Keys match the {% trans "text" %} source string.
You can also register nested keys for blocktrans with variables:
unregisterTranslation¶
setLanguage / getLanguage¶
Set or get the active language.
setFallbackLanguage / getFallbackLanguage¶
Set or get the fallback language (used when a key is missing from the active language).
getAvailableLanguages¶
List all registered languages.
Template Tags¶
The {% trans %} and {% blocktrans %} tags are provided by the auto-activated i18n library:
{% trans "Hello" %}
{% blocktrans %}Welcome, {{ name }}!{% endblocktrans %}
{% language "fr" %}...{% endlanguage %}