summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Bauer <gb@hugo.westfalen.de>2005-09-30 08:53:35 +0000
committerGeorg Bauer <gb@hugo.westfalen.de>2005-09-30 08:53:35 +0000
commit80e450ee2dff44db06f076f163e29b3119481134 (patch)
treed0dd5d37e22891acca7434c74940ee12ad8b7e7a
parentf913e4d8c94a69794527a7c2b556a4dfd9e831d9 (diff)
i18n template tag now accepts varibles with filters or strings.
Variables with filters won't be pulled out for translation, of course, but will just run the result of the filter through the translation engine. git-svn-id: http://code.djangoproject.com/svn/django/branches/i18n@739 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/core/defaulttags.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/core/defaulttags.py b/django/core/defaulttags.py
index 29eaf4cf70..e351a70f7e 100644
--- a/django/core/defaulttags.py
+++ b/django/core/defaulttags.py
@@ -303,7 +303,7 @@ class I18NNode(template.Node):
elif s.startswith('"') and s.endswith('"'):
s = s[1:-1]
else:
- raise template.TemplateSyntaxError("i18n must be called as {% i18n _('some message') %}")
+ s = template.resolve_variable_with_filters(s, context)
return translation.gettext(s) % context
else:
raise template.TemplateSyntaxError("i18n must be called as {% i18n _('some message') %}")