mirror of
https://github.com/django/django.git
synced 2025-07-04 17:59:13 +00:00
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
This commit is contained in:
parent
f913e4d8c9
commit
80e450ee2d
@ -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') %}")
|
||||
|
Loading…
x
Reference in New Issue
Block a user