Opened 12 years ago
Closed 12 years ago
#18783 closed New feature (duplicate)
model's verbose name internationalization
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Internationalization | Version: | 1.4 |
Severity: | Normal | Keywords: | verbose_name i18n internationalization |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
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.
Change History (1)
comment:1 by , 12 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Triage Stage: | Unreviewed → Accepted |
Duplicate of #11688.