diff --git a/docs/topics/i18n/translation.txt b/docs/topics/i18n/translation.txt index a5cf9c1410b..bb38c919661 100644 --- a/docs/topics/i18n/translation.txt +++ b/docs/topics/i18n/translation.txt @@ -694,6 +694,31 @@ or with the ``{#`` ... ``#}`` :ref:`one-line comment constructs +

{% trans "Welcome to our page" %}

+ + {% language 'en' %} + {% get_current_language as LANGUAGE_CODE %} + +

{% trans "Welcome to our page" %}

+ {% endlanguage %} + +While the first occurrence of "Welcome to our page" uses the current language, +the second will always be in English. + .. _template-translation-vars: Other tags @@ -1098,13 +1123,11 @@ active language. Example:: .. _reversing_in_templates: -.. templatetag:: language - Reversing in templates ---------------------- If localized URLs get reversed in templates they always use the current -language. To link to a URL in another language use the ``language`` +language. To link to a URL in another language use the :ttag:`language` template tag. It enables the given language in the enclosed template section: .. code-block:: html+django