art*_*hur 12 python django django-i18n
我对django的国际化模块有一些奇怪的麻烦.大多数字符串都是必须翻译的,而其他字符串则不是.让我告诉你和例子:
<li>{% trans "Upload Score" %}</li>
<li>{% trans "Profile" %}</li>
<li>{% trans "Invite friends" %}</li>
<li>{% trans "Settings" %}</li>
Run Code Online (Sandbox Code Playgroud)
我有一个菜单列表4项.我运行django命令makemessages用法语翻译网站,我得到了所有的预期:
#: templates/main.html:190 templates/main.html.py:195
#, fuzzy
msgid "Upload Score"
msgstr "Publier"
#: templates/main.html:191 templates/main.html.py:196
msgid "Profile"
msgstr "Profil"
#: templates/main.html:192 templates/main.html.py:197
#, fuzzy
msgid "Invite Friends"
msgstr "inviter vos amis"
#: templates/main.html:193 templates/main.html.py:198
msgid "Settings"
msgstr "Préférences"
Run Code Online (Sandbox Code Playgroud)
但是当我编译它时,将django-admin compilemessages,只翻译"Profile"和"Settings".你知道它可能来自哪里吗?它可以与白色空间的使用联系起来吗?i18n模块中是否有调试模式?
谢谢你的帮助!:)
编辑:我们在django 1.4.