Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #5969 -- Corrected a problem introduced in [6682].

*sigh* As usual, the one case I forget to test turned out to be broken.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6689 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 5f8cfe99f3d508cfd7f3eecf50d41a3ac7e7442a 1 parent ce73298
Malcolm Tredinnick authored November 18, 2007
2  django/templatetags/i18n.py
@@ -73,7 +73,7 @@ def render(self, context):
73 73
         if self.plural and self.countervar and self.counter:
74 74
             count = self.counter.resolve(context)
75 75
             context[self.countervar] = count
76  
-            plural = self.render_token_list(self.plural)[0]
  76
+            plural, vars = self.render_token_list(self.plural)
77 77
             result = translation.ungettext(singular, plural, count)
78 78
         else:
79 79
             result = translation.ugettext(singular)
4  tests/regressiontests/templates/tests.py
@@ -717,10 +717,10 @@ def get_template_tests(self):
717 717
             'i18n06': ('{% load i18n %}{% trans "Page not found" %}', {'LANGUAGE_CODE': 'de'}, "Seite nicht gefunden"),
718 718
 
719 719
             # translation of singular form
720  
-            'i18n07': ('{% load i18n %}{% blocktrans count number as counter %}singular{% plural %}plural{% endblocktrans %}', {'number': 1}, "singular"),
  720
+            'i18n07': ('{% load i18n %}{% blocktrans count number as counter %}singular{% plural %}{{ counter }} plural{% endblocktrans %}', {'number': 1}, "singular"),
721 721
 
722 722
             # translation of plural form
723  
-            'i18n08': ('{% load i18n %}{% blocktrans count number as counter %}singular{% plural %}plural{% endblocktrans %}', {'number': 2}, "plural"),
  723
+            'i18n08': ('{% load i18n %}{% blocktrans count number as counter %}singular{% plural %}{{ counter }} plural{% endblocktrans %}', {'number': 2}, "2 plural"),
724 724
 
725 725
             # simple non-translation (only marking) of a string to german
726 726
             'i18n09': ('{% load i18n %}{% trans "Page not found" noop %}', {'LANGUAGE_CODE': 'de'}, "Page not found"),

0 notes on commit 5f8cfe9

Please sign in to comment.
Something went wrong with that request. Please try again.