Fixed #10533 -- Worked around an apparent limitation of xgettext.

Looks like we have to use the same format specifiers in both singular and
plural forms of a message or the PO file cannot be compiled to MO format. This
commit changes one place in admin that was using different specifiers.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10081 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick 2009-03-18 09:19:24 +00:00
parent 4a88785e38
commit 4a67fee785
1 changed files with 117 additions and 114 deletions

View File

@ -742,11 +742,14 @@ class ModelAdmin(BaseModelAdmin):
changecount += 1
if changecount:
msg = ngettext("%(count)s %(singular)s was changed successfully.",
"%(count)s %(plural)s were changed successfully.",
if changecount == 1:
name = force_unicode(opts.verbose_name)
else:
name = force_unicode(opts.verbose_name_plural)
msg = ngettext("%(count)s %(name)s was changed successfully.",
"%(count)s %(name)s were changed successfully.",
changecount) % {'count': changecount,
'singular': force_unicode(opts.verbose_name),
'plural': force_unicode(opts.verbose_name_plural),
'name': name,
'obj': force_unicode(obj)}
self.message_user(request, msg)