Author: mtredinnick
Date: 2007-11-17 21:36:03 -0600 (Sat, 17 Nov 2007)
New Revision: 6689
Modified:
django/trunk/django/templatetags/i18n.py
django/trunk/tests/regressiontests/templates/tests.py
Log:
Fixed #5969 -- Corrected a problem introduced in [6682].
*sigh* As usual, the one case I forget to test turned out to be broken.
Modified: django/trunk/django/templatetags/i18n.py
===================================================================
--- django/trunk/django/templatetags/i18n.py 2007-11-17 22:04:05 UTC (rev
6688)
+++ django/trunk/django/templatetags/i18n.py 2007-11-18 03:36:03 UTC (rev
6689)
@@ -73,7 +73,7 @@
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)
Modified: django/trunk/tests/regressiontests/templates/tests.py
===================================================================
--- django/trunk/tests/regressiontests/templates/tests.py 2007-11-17
22:04:05 UTC (rev 6688)
+++ django/trunk/tests/regressiontests/templates/tests.py 2007-11-18
03:36:03 UTC (rev 6689)
@@ -717,10 +717,10 @@
'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"),
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---