Reputation: 4911
I am nearing the final stages of a project and have run into a bit of a hiccup with Django.
It relates to the {% blocktrans %}
tag.
How do I enable it to be fully functional in my app, currently if I wrap a piece of text in {% blocktrans %}
I get a TemplateSyntaxError
message
I have the following in my
TEMPLATE_CONTEXT_PROCESSORS = (
...
"django.core.context_processors.i18n",
...
)
Any help would be appreciated.
Upvotes: 1
Views: 1012
Reputation: 2609
For me was like this (windows + python 2.6 + django 1.2.1)
Will result an error(TemplateSyntaxError):
{% load i18n %}
{% blocktrans %} My name is {{ user.firstname }} {% endblocktrans %}
Will work:
{% load i18n %}
{% blocktrans with user.firstname as hmpf %} My name is {{ hmpf }} {% endblocktrans %}
Upvotes: 3