在我当前的项目中blocktrans
不再起作用了(过去工作得很好)。 trans
或单行 - blocktrans
工作正常,只有多行 - blocktrans
失败。 django-admin.py makemessages
仍然可以正确选择所有这些消息,但在输出中将显示默认(en)语言而不是翻译。
使用python shell我可以检索翻译。这是模板/本地化,系统似乎无法检索翻译。在python manage.py shell
内:
from django.utils import translation
s = "the text"
translation.activate('en')
translation.ugettext(s) # gets the default text
translation.activate('hi')
translation.ugettext(s) # gets the correct translated text
我还在django 1.1
我能错过什么/做错什么?