fixes bug with blocktrans and parameters not actually doing the translation (thx. nesh for the report)

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1230 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Georg Bauer 2005-11-14 13:29:38 +00:00
parent 4decd32b0e
commit 5319f285a6
1 changed files with 2 additions and 2 deletions

View File

@ -62,11 +62,11 @@ class BlockTranslateNode(Node):
context.push() context.push()
for var,val in self.extra_context.items(): for var,val in self.extra_context.items():
context[var] = resolve_variable_with_filters(val, context) context[var] = resolve_variable_with_filters(val, context)
singular = self.render_token_list(self.singular) % context singular = self.render_token_list(self.singular)
if self.plural and self.countervar and self.counter: if self.plural and self.countervar and self.counter:
count = resolve_variable_with_filters(self.counter, context) count = resolve_variable_with_filters(self.counter, context)
context[self.countervar] = count context[self.countervar] = count
plural = self.render_token_list(self.plural) % context plural = self.render_token_list(self.plural)
result = translation.ngettext(singular, plural, count) % context result = translation.ngettext(singular, plural, count) % context
else: else:
result = translation.gettext(singular) % context result = translation.gettext(singular) % context