nemesifier
nemesifier

Reputation: 8529

Django Internazionalization: what's wrong with my {% blocktrans %}?

In template:

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

in app/locale/es/LC_MESSAGES/django.po (done with 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 doesn't work. What am I doing wrong?

Same for:

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

Upvotes: 0

Views: 570

Answers (1)

Evgeny
Evgeny

Reputation: 10896

Try to remove ", fuzzy" and then compile messages

python manage.py compilemessages

Does it work then? The fuzzy markers are "flags" for the translators so they validate the messages.

Upvotes: 3

Related Questions