python django Localization
I'm using django Internationalization current now. When i use in template such as
{% trans "i love you" %}
it works fine.
But when i define it in python file
_("i love you")
it still outputs the Engl开发者_运维问答ish word.
If I replace _("i love you")
with "我爱你"
, it says:
SyntaxError: Non-ASCII character '\xe4'
you shouldn't replace _("i love you")
in your views.py but in the .po file generated by django-admin.py compilemessages
(see here).
hope it helps
精彩评论