verbose_name should allow dynamical translation based on a number
|Reported by:||mitar||Owned by:||nobody|
|Cc:||mmitar@…, sirexas@…, 4glitch@…, shaib, maciej.olko@…||Triage Stage:||Accepted|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||yes|
verbose_name of meta data for models should allow dynamical translation based on a number of elements through ungettext and not just two possibilities of verbose_name and verbose_name_plural which is not enough for languages with complex plural forms.
Django could check if verbose_name is a function and call it with a number of elements as a parameter. This would also be backwards compatible.
It should also allow a seconds parameter, a context, as I have described in #11686, because in some languages counting depends also on a context (like case of a counted noun). Probably it should be set to something like a view name by default (or something else which would correlate with grammatical context). Or at least it should be possible to specify it in a model definition to differentiate between different translations of the same word for model name and some other use of this word.
Change History (24)
comment:1 Changed 7 years ago by ubernostrum
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Resolution set to duplicate
- Status changed from new to closed
comment:2 Changed 7 years ago by mtredinnick
- Resolution duplicate deleted
- Status changed from closed to reopened