>
> Problem is that the replacement for `Meta.verbose_name` and
> `Meta.verbose_name_plural` we finally come up with also needs to:
>
> * Maintain backward compatibility
>
> * Not change verbose names behavior when i18n isn't being used. IMHO
>  disrupting the workflow native English developers (especially
>  English-speaking Django core developers) use (and the results
>  they get) the least possible this is particularly important to
>  increase the chances of a proposed fix being finally committed.)
>
> * Simply accept the fact that bare human readable model verbose
>  names are also needed and very useful in many contexts. I believe that
>  if for some UI work one needs the 'Poll' literal (or its translation)
>  and instead one gets '1 Poll' it would be surprising to say the
>  least, not matter what locale is in effect.
>
> So, making the implementation to always execute something like
>
>  ungettext('%(count)d poll', '%(count)d polls, count) % {'count': count, }
>
> isn't the right thing to do either. At least with this particular API.
>

These are good and valid points to which I agree. However, in the context
of software localization there are two distinct usages for plural:

1. Unquantified plurals (i.e. some unknown qty greater than 1). This is
used in model listing on the admin site landing page.
2. Quantified plurals (e.g., 4 cows). This is used in admin messages and
admin paginator.

For languages with multiple plural forms, quantified plural without
quantifier is rather meaningless.

With this in mind maybe we can leave Meta.verbose_name_plural as is for the
sake of backward compatibility as well as for getting unquantified plural
form of the model. And introduce a new method for getting quantified
plurals only as I outlined earlier:

ungettext('%(count)d poll', '%(count)d polls, count) % {'count': count, }

(Unless there is an additional reason to get rid of Meta options.)


> By the way, there is a piece of code in the admin app that after the patch
> looks like this (`changecount` is the int variable that contains the
> number of
> model instances involved)::
>
>    name = force_unicode(model.get_verbose_name(changecount))
>    msg = ungettext("%(count)s %(name)s was changed successfully.",
>                    "%(count)s %(name)s were changed successfully.",
>                    changecount) % {'count': changecount,
>                                    'name': name}
>    self.message_user(request, msg)
>
Here, we aren't using full phrase translation but we still are setting
> things up in way so a) Translators can reorder the words, they just need
> to keep in mind that the 'name' var will contain the right verbose name
> for the plural form in use and b) Final users are shown correct model
> verbose names in all locales.
>

The problem with current implementation: it does not work well for
languages with multiple plural form because the form of %(name)s depends on
the count. The proposed change will resolve this problem. But to achieve a
correct plural translation we essentially need 2 translation call:

1) to get the correct plural form the model based on the quantifier
2) to get the resulting translation into "%(count)s %(name)s" string which
I think can be somewhat confusing to translators

Lastly, regardless of what we agree upon there probably should be a new tag
or filter to get pluralized model names in templates, because AFAIK there
is no way to call a model method with an argument directly.

Thanks

>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django internationalization and localization" group.
To post to this group, send email to django-i18n@googlegroups.com.
To unsubscribe from this group, send email to 
django-i18n+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-i18n?hl=en.

Reply via email to