Comments for translators
New in Django 1.3:
Please see the release notes
If you would like to give translators hints about a translatable string, you can add a comment prefixed with the Translatorskeyword on the line preceding the string, e.g.:
def my_view(request):
# Translators: This message appears on the home page only
output = ugettext("Welcome to my site.")
This also works in templates with the comment tag:
{% comment %}Translators: This is a text of the base template {% endcomment %}

本文提供了一段关于Django 1.3版本中新增功能的详细翻译说明,包括如何为翻译者提供字符串提示,以及如何在模板中使用注释标记翻译字符串。
1184

被折叠的 条评论
为什么被折叠?



