Интернационализация Django: что не так с моим {% blocktrans%}? - PullRequest
0 голосов
/ 23 ноября 2010

В шаблоне:

{% 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 %}

в приложении / 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."

Itне работаетЧто я делаю не так?

То же самое для:

{% 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 Ответ

3 голосов
/ 23 ноября 2010

Попробуйте удалить ", нечеткие", а затем скомпилировать сообщения

python manage.py compilemessages

Это работает тогда?Нечеткие маркеры являются «флагами» для переводчиков, поэтому они проверяют сообщения.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...