From 80e450ee2dff44db06f076f163e29b3119481134 Mon Sep 17 00:00:00 2001 From: Georg Bauer Date: Fri, 30 Sep 2005 08:53:35 +0000 Subject: [PATCH] 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 --- django/core/defaulttags.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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') %}")