Django: any use of blocktrans raises TemplateSyntaxError

Using Django 1.2.1, any use of blocktrans violates my pattern. For example,

{%blocktrans%}text{%endblocktrans%} 

Results in:

Django Version: 1.2.1 Exception Type: TemplateSyntaxError Invalid block tag: 'blocktrans'

Removing drafts causes the code to work. Django runs on GAE, if relevant.

+8
django internationalization translation
source share
2 answers

Just add this to your inline tags, for example:

 # in urls.py template.add_to_builtins('django.templatetags.i18n') 

Any tag that I use in several templates, I just upload there.

+5
source share

Answering my own question, I forgot:

 {% load i18n %} 

At the top of the template. This is necessary to use the blocktrans tag.

Change See the fix for orokusaki below to fix this for all of your templates.

+19
source share

All Articles