diff --git a/django/templatetags/i18n.py b/django/templatetags/i18n.py index a2b7818eb5..b4438fdf42 100644 --- a/django/templatetags/i18n.py +++ b/django/templatetags/i18n.py @@ -73,7 +73,7 @@ class BlockTranslateNode(Node): if self.plural and self.countervar and self.counter: count = self.counter.resolve(context) context[self.countervar] = count - plural = self.render_token_list(self.plural)[0] + plural, vars = self.render_token_list(self.plural) result = translation.ungettext(singular, plural, count) else: result = translation.ugettext(singular) diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py index 6f6667b6b0..5c3a0a9081 100644 --- a/tests/regressiontests/templates/tests.py +++ b/tests/regressiontests/templates/tests.py @@ -717,10 +717,10 @@ class Templates(unittest.TestCase): 'i18n06': ('{% load i18n %}{% trans "Page not found" %}', {'LANGUAGE_CODE': 'de'}, "Seite nicht gefunden"), # translation of singular form - 'i18n07': ('{% load i18n %}{% blocktrans count number as counter %}singular{% plural %}plural{% endblocktrans %}', {'number': 1}, "singular"), + 'i18n07': ('{% load i18n %}{% blocktrans count number as counter %}singular{% plural %}{{ counter }} plural{% endblocktrans %}', {'number': 1}, "singular"), # translation of plural form - 'i18n08': ('{% load i18n %}{% blocktrans count number as counter %}singular{% plural %}plural{% endblocktrans %}', {'number': 2}, "plural"), + 'i18n08': ('{% load i18n %}{% blocktrans count number as counter %}singular{% plural %}{{ counter }} plural{% endblocktrans %}', {'number': 2}, "2 plural"), # simple non-translation (only marking) of a string to german 'i18n09': ('{% load i18n %}{% trans "Page not found" noop %}', {'LANGUAGE_CODE': 'de'}, "Page not found"),