Fixed #10897 -- Modified use of ngettext to ungettext in admin change messages. Thanks to zuber for the report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10677 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee 2009-05-05 22:25:35 +00:00
parent 9d28568cb4
commit 31c833f113
1 changed files with 27 additions and 27 deletions

View File

@ -18,7 +18,7 @@ from django.utils.safestring import mark_safe
from django.utils.functional import curry from django.utils.functional import curry
from django.utils.text import capfirst, get_text_list from django.utils.text import capfirst, get_text_list
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from django.utils.translation import ngettext, ugettext_lazy from django.utils.translation import ungettext, ugettext_lazy
from django.utils.encoding import force_unicode from django.utils.encoding import force_unicode
try: try:
set set
@ -937,11 +937,11 @@ class ModelAdmin(BaseModelAdmin):
name = force_unicode(opts.verbose_name) name = force_unicode(opts.verbose_name)
else: else:
name = force_unicode(opts.verbose_name_plural) name = force_unicode(opts.verbose_name_plural)
msg = ngettext("%(count)s %(name)s was changed successfully.", msg = ungettext("%(count)s %(name)s was changed successfully.",
"%(count)s %(name)s were changed successfully.", "%(count)s %(name)s were changed successfully.",
changecount) % {'count': changecount, changecount) % {'count': changecount,
'name': name, 'name': name,
'obj': force_unicode(obj)} 'obj': force_unicode(obj)}
self.message_user(request, msg) self.message_user(request, msg)
return HttpResponseRedirect(request.get_full_path()) return HttpResponseRedirect(request.get_full_path())