Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed a ungettext() call to prevent spurious string extraction by xge…

…ttext.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10168 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 7f63d0009f762c6ce1c665df3674be2fcd3ef7fa 1 parent 6485d9b
@malcolmt malcolmt authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 django/contrib/admin/util.py
View
7 django/contrib/admin/util.py
@@ -206,8 +206,8 @@ def model_format_dict(obj):
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 @@ def model_ngettext(obj, n=None):
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)
Please sign in to comment.
Something went wrong with that request. Please try again.