On Mon, May 5, 2008 at 1:16 AM, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
>  > Is it?  Maybe.  I don't know if anyone has proposed smartening-up Django's
>  > pluralization rules in the past
>
>  I had a look through the mailing-list archive and couldn't spot
>  anything directly related.

Then you haven't looked too hard. Pluralization comes up regularly,
both in the context of the pluralize filter, and the
verbose_name/verbose_name_plural option. And if you're calling
pluralization a simple task, you _really_ haven't done your research.

The short version is that pluralization is _hard_. Automatic
pluralization, which seems to be what you want, is an effectively
impossible task, especially in English. English doesn't have regular
rules for pluralization for anything but trivial cases. About the only
way to do it effectively is to have a dictionary of all possible
plurals - and then you hit the religious wars over whether the plural
of octopus is octopus, octopuses, or octopodes.

Even if you could get English sorted out, then you get the i18n
problem. A few eastern European languages have some very interesting
pluralization rules which further complicates the dream of an
automatic solution.

So, we have settled with the a naive solution, manually assisted, with
template helpers that cover 95% of cases. "Add an s" works for a good
majority of cases - if that isn't correct, you can manually correct it
in verbose_name_plural. The template filter can handle all the english
cases (worst case being different extensions for 1 and many). This
doesn't cover the needs of the previously mentioned eastern European
languages, but accommodating those languages while keeping the simple
case simple is almost impossible, so users of those languages can
write a custom template tag if they need one.

Yours,
Russ Magee %-)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to