﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
21650	Usage example in i18n docs is bad advice for plurals	Ned Batchelder	nobody	"[https://docs.djangoproject.com/en/dev/topics/i18n/translation/#pluralization This example in the i18n docs]:

{{{
Lets see a slightly more complex usage example::

    from django.utils.translation import ungettext
    from myapp.models import Report

    count = Report.objects.count()
    if count == 1:
        name = Report._meta.verbose_name
    else:
        name = Report._meta.verbose_name_plural

    text = ungettext(
            'There is %(count)d %(name)s available.',
            'There are %(count)d %(name)s available.',
            count
    ) % {
        'count': count,
        'name': name
    }
}}}

Here we choose between two forms of name (singular and plural) based on whether the count is 1 or not.  That is the rule in English, but not in other languages.  The whole point of ungettext is to defer the logic that performs the mapping from number to text, since it depends on the language.

Unfortunately, I think the only solution is to use more stilted language:

{{{
text = ungettext(
    'There is %(count)d %(name)s object available.',
    'There are %(count)d %(name)s objects available.',
    count
) % {
    'count': count,
    'name': Report._meta.verbose_name,
}
}}}

and ignore the verbose_name_plural altogether."	Cleanup/optimization	closed	Documentation	1.6	Normal	fixed			Accepted	1	0	0	0	0	0
