Opened 8 years ago

Closed 2 years ago

#9974 closed New feature (wontfix)

Add a template filter similar to pluralize but i18n-aware regarding plural form rules

Reported by: David Larlet Owned by: David Larlet
Component: Template system Version: 1.0
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

That's the case in French and probably with other languages, I can provide the fix but a design decision is needed on how to do this.

It can be an argument on the pluralize filter or a new filter in localflavor but it seems overkill to me.

Change History (9)

comment:1 Changed 8 years ago by David Larlet

Status: newassigned

comment:2 Changed 8 years ago by Jacob

Triage Stage: UnreviewedDesign decision needed

comment:3 Changed 8 years ago by Malcolm Tredinnick

For anybody wondering if there was any resolution here: we've been leaning towards writing a localisation-aware pluralisation filter or something. Extending the existing one will complicate things a lot and isn't worth the ongoing maintenance pain. Existing pluralize is for English (and things that can pretend to be English). For localised versions, it's harder and more work and experimenting is needed (details of that require reading the above thread that David linked to).

comment:4 Changed 8 years ago by David Larlet

Yes, I had emailed the author of plural_to_python (linked in the thread) when I found the link without any answer for now.

comment:5 Changed 6 years ago by Ramiro Morales

Summary: Allow pluralize filter to consider zero as a singular formAdd a template filter similar to pluralize but i18n-aware regarding plural form rules
Triage Stage: Design decision neededAccepted

comment:6 Changed 6 years ago by Chris Beaven

Severity: Normal
Type: New feature

comment:7 Changed 5 years ago by Aymeric Augustin

UI/UX: unset

Change UI/UX from NULL to False.

comment:8 Changed 5 years ago by Aymeric Augustin

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:9 Changed 2 years ago by Aymeric Augustin

Resolution: wontfix
Status: assignedclosed

This is very difficult to get right in English -- as the Rails people learnt the hard way -- and I cannot imagine maintaining this for French.

There's no fundamental reason for such a template tag to live in Django. It's better to leave this feature to a third-party library.

Note: See TracTickets for help on using tickets.
Back to Top