mirror of
https://github.com/django/django.git
synced 2025-07-04 09:49:12 +00:00
i18n: added the translation step to the filter parser (the arg is now translated if it is _("..."))
git-svn-id: http://code.djangoproject.com/svn/django/branches/i18n@835 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
0cd2968973
commit
0b0c323708
@ -361,7 +361,7 @@ class FilterParser:
|
|||||||
return (self.current_filter_name, self.current_filter_arg)
|
return (self.current_filter_name, self.current_filter_arg)
|
||||||
|
|
||||||
def read_arg(self):
|
def read_arg(self):
|
||||||
# First read a "
|
# First read a " or a _("
|
||||||
self.next_char()
|
self.next_char()
|
||||||
translated = False
|
translated = False
|
||||||
if self.current == '_':
|
if self.current == '_':
|
||||||
@ -400,6 +400,7 @@ class FilterParser:
|
|||||||
if self.current != ')':
|
if self.current != ')':
|
||||||
raise TemplateSyntaxError, "Bad character (expecting ')') '%s'" % self.current
|
raise TemplateSyntaxError, "Bad character (expecting ')') '%s'" % self.current
|
||||||
self.next_char()
|
self.next_char()
|
||||||
|
arg = _(arg)
|
||||||
return arg
|
return arg
|
||||||
|
|
||||||
def get_filters_from_token(token):
|
def get_filters_from_token(token):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user