model's verbose name internationalization
|Reported by:||Owned by:||nobody|
|Severity:||Normal||Keywords:||verbose_name i18n internationalization|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The model class has two fields, verbose_name and verbose_name_plural. But when a model's name is translated into languages where plural forms are constructed differently from English, e.g. Slavic, Finno-Ugric languages, the resulting translation (which shows e.g. in admin) is incorrect.
For instance, in Estonian one would define verbose_name for Client as 'klient', verbose_name_plural as 'kliendid' (which is fine if the number of clients is not given). But when a count is given, the message looks like "33 kliendid" while the correct form is "33 klienti".
It would be quite logical to define another kind of verbose name as a wrapper for
ungettext("%d <object>", "%d <objects>", count)
- with the count value substituted when appropriate.
The main problem one has to deal with is that the count is not known at definition time. So one can not plainly use ungettext or ungettext_lazy in the model class definition.
Providing such an attribute (probably a method) would eliminate many issues including repetitions of blocktrans in templates.