Author: mtredinnick
Date: 2009-03-24 20:31:57 -0500 (Tue, 24 Mar 2009)
New Revision: 10168
Modified:
django/trunk/django/contrib/admin/util.py
Log:
Fixed a ungettext() call to prevent spurious string extraction by xgettext.
Modified: django/trunk/django/contrib/admin/util.py
===================================================================
--- django/trunk/django/contrib/admin/util.py 2009-03-24 23:02:36 UTC (rev
10167)
+++ django/trunk/django/contrib/admin/util.py 2009-03-25 01:31:57 UTC (rev
10168)
@@ -206,8 +206,8 @@
def model_ngettext(obj, n=None):
"""
- Return the appropriate `verbose_name` or `verbose_name_plural` for `obj`
- depending on the count `n`.
+ Return the appropriate `verbose_name` or `verbose_name_plural` value for
+ `obj` depending on the count `n`.
`obj` may be a `Model` instance, `Model` subclass, or `QuerySet` instance.
If `obj` is a `QuerySet` instance, `n` is optional and the length of the
@@ -219,4 +219,5 @@
n = obj.count()
obj = obj.model
d = model_format_dict(obj)
- return ungettext(d['verbose_name'], d['verbose_name_plural'], n or 0)
+ singular, plural = d["verbose_name"], d["verbose_name_plural"]
+ return ungettext(singular, plural, n or 0)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---