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 changecount += 1
if changecount: if changecount:
msg = ngettext("%(count)s %(singular)s was changed successfully.", if changecount == 1:
"%(count)s %(plural)s were changed successfully.", 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, changecount) % {'count': changecount,
'singular': force_unicode(opts.verbose_name), 'name': name,
'plural': force_unicode(opts.verbose_name_plural),
'obj': force_unicode(obj)} 'obj': force_unicode(obj)}
self.message_user(request, msg) self.message_user(request, msg)