Django国际化:我的{%blocktrans%}出了什么问题?

时间:2010-11-23 16:20:12

标签: django django-templates

在模板中:

{% blocktrans with event.title|capfirst as title and event.event_date|date:"d/m/Y" as event_date  %}
<p>To book a VIP Table at <b>{{ title }}</b> on <b>{{ event_date }}</b> fill the following form and indicate the details in the message.</p>
{% endblocktrans %}
app / locale / es / LC_MESSAGES / django.po中的

(使用django-admin.py makemessages -l es完成)

#: agenda/booking.html:18
#, fuzzy, python-format
msgid ""
"\n"
"    <p>To book a VIP Table at <b>%(title)s</b> on <b>%(event_date)s</b> fill "
"the following form and indicate the details in the message.</p>\n"
"    "
msgstr ""
"\n"
"    Para reservar una mesa VIP a <b>\"%(title)s\"</b> on <b>%(event_date)s</"
"b> rellena el siguiente formulario y indicanos los detalles en el mensaje."

它不起作用。我做错了什么?

同样的:

{% blocktrans with request.POST.email as email %}
<p>Thank you for using the booking form.</p>
<p>We will forward the reply to <b>{{ email }}</b> in the next 48 hours.</p>
<br />
{% endblocktrans %}

1 个答案:

答案 0 :(得分:3)

尝试删除“,模糊”,然后编译消息

python manage.py compilemessages

那么它有效吗?模糊标记是翻译者的“标志”,因此他们验证消息。