我在我的项目中安装了django-rosetta。我创建了一个.po和.mo文件。 模板我有一个代码,显示已在django-rosetta中翻译的文本(来自django docs)。 如何创建一个指向每个翻译页面的链接?
{% get_current_language as LANGUAGE_CODE %}
<!-- Current language: {{ LANGUAGE_CODE }} -->
<p>{% trans "Welcome to our page" %}</p>
<p>{{ LANGUAGE_CODE }}</p>
{% language 'pl' %}
{% get_current_language as LANGUAGE_CODE %}
<p>{% trans "Some text to translate" %}</p>
{% endlanguage %}
{% language 'en' %}
{% get_current_language as LANGUAGE_CODE %}
<p>{% trans "Some text to translate" %}</p>
{% endlanguage %}
{% language 'ru' %}
{% get_current_language as LANGUAGE_CODE %}
<p>{% trans "Some text to translate" %}</p>
{% endlanguage %}