我有一个像这样的模板部分,
{% blocktrans with poster=link.posted_by timesince=link.posted_at|timesince %}Posted by {{poster}}, {{timesince}} ago.{% endblocktrans %}
我正在接受:
Caught ValueError while rendering: unsupported format character '?' (0xf6) at index 35
该行的错误。我在这里缺少什么?我认为问题在于时间......什么是正确的行为才能正确打印出来?
注意:我也试过了:
{% blocktrans with poster=link.posted_by posted_at=link.posted_at %}Posted by {{poster}}, {{posted_at|timesince}} ago.{% endblocktrans %}
答案 0 :(得分:0)
您是否尝试过这种方式: -
创建语言环境文件夹(有些像这样)
/locale/it/LC_MESSAGES/django.po
此处“it”是区域设置名称(意大利语),示例:它,de_AT,es,pt_BR
django-admin.py makemessages -l it
有关详细信息,请参阅此网址: -
<强> http://www.djangobook.com/en/1.0/chapter18/ 强>
<强> http://www.paolocorti.net/2009/12/18/the-pinax-tutorial-3-internationalization-of-the-application/ 强>