【发布时间】:2020-10-22 23:30:00
【问题描述】:
我们如何正确地为字符串添加翻译功能而不将它们分成更小的部分?我想让翻译人员能够更轻松地翻译字符串。
例如,请考虑以下几点:
<p>By clicking on "register", you agree to our <a href="{% url 'terms' %}">terms of service</a>, <a href="{% url 'privacy' %}">privacy policy</a> and <a href="{% url 'forum_guidelines' %}">forum guidelines</a></p>
如果我们使用反式标签{% trans "" %},则必须将其分解为 6 个单独的部分,这将很难本地化为其他语言:
1) {% trans "By clicking on "register", you agree to our" %}
2) {% trans "terms of service" %}
3) {% trans "," %}
4) {% trans "privacy policy" %}
5) {% trans "and" %}
6) {% trans "forum guidelines" %}
我已经阅读了documentation,但我仍然不明白如何解决这个问题。我希望你们知道如何做到这一点,或者对这种情况有适当的解决方案。
【问题讨论】:
标签: django django-templates localization internationalization