Code

Opened 2 years ago

Closed 21 months ago

#18783 closed New feature (duplicate)

model's verbose name internationalization

Reported by: me@… 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.

Attachments (0)

Change History (1)

comment:1 Changed 21 months ago by lrekucki

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed
  • Triage Stage changed from Unreviewed to Accepted

Duplicate of #11688.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.