Opened 14 years ago
Closed 14 years ago
#16075 closed Bug (fixed)
Django 1.3 new "localize" tag/filter doesn't work?
Reported by: | Owned by: | ||
---|---|---|---|
Component: | Documentation | Version: | 1.3 |
Severity: | Normal | Keywords: | dceu2011 |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
I've noticed that Django 1.3 introduced the new "localize" tag/filter.
http://docs.djangoproject.com/en/1.3/topics/i18n/localization/
It says:
To activate or deactivate localization for a template block, use: {% localize on %} {{ value }} {% endlocalize %} {% localize off %} {{ value }} {% endlocalize %}
However I always got the error message:
Invalid block tag: 'localize'
Looks like the "localize" filter doesn't work as well. Can anybody help me? Or can anybody else confirm if this is a bug? Thanks!
Attachments (1)
Change History (7)
comment:1 by , 14 years ago
Component: | Template system → Documentation |
---|---|
Description: | modified (diff) |
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 14 years ago
Owner: | changed from | to
---|---|
UI/UX: | unset |
by , 14 years ago
Attachment: | ticket-16075.diff added |
---|
comment:3 by , 14 years ago
Has patch: | set |
---|
It is also indicated in the "Controlling localization in templates" chapter of the localization documentation. In any case, I've also added the actual template lib loading in all the template snippets in this document.
comment:5 by , 14 years ago
Keywords: | dceu2011 added |
---|
Simply put, this is a documentation issue. You need to load the template tag library first (
{% load l10n %}
), as mentioned here: http://docs.djangoproject.com/en/1.3/ref/templates/builtins/#l10n