Opened 15 years ago

Closed 15 years ago

Last modified 14 years ago

#11686 closed (wontfix)

Support for gettext's contexts

Reported by: Mitar Owned by: nobody
Component: Internationalization Version: 1.1
Severity: Keywords:
Cc: mmitar@…, bronger@… Triage Stage: Unreviewed
Has patch: yes Needs documentation: yes
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


For languages where translations change based on context (like number, gender, tense, case) it would be great if Django would support gettext's context as a parameter to ugettext and others.

And then if admin app would use this. :-)

Attachments (1)

pgettext.patch (6.9 KB ) - added by Claude Paroz 14 years ago.
pgettext implementation

Download all attachments as: .zip

Change History (7)

comment:1 by James Bennett, 15 years ago

Resolution: wontfix
Status: newclosed

This is not possible at present, as Python's gettext module does not provide an equivalent to GNU pgettext.

comment:2 by Mitar, 15 years ago

Just for the record, there exists a ticket for this on a Python tracker and it seems it will be included.

There is no future milestones which would be a place for tickets which are valid but not yet possible?

comment:3 by Ramiro Morales, 15 years ago


So, I'd say this would be (or at least has been) in the plans of a core developer for 1.2. A champion that implements (and commits to take care of) a patch for review attaching it to this (reopened) ticket plus adding the feature to the Version1.2Features list would increase the chances of something like this being added to Django.

Leaving this ticket closed as it has been set so by a core developer.

comment:4 by Torsten Bronger, 14 years ago

Cc: bronger@… added

by Claude Paroz, 14 years ago

Attachment: pgettext.patch added

pgettext implementation

comment:5 by Claude Paroz, 14 years ago

Has patch: set
Needs documentation: set

I'd like to reopen this, see the attached patch (note I didn't include tests/regressiontests/i18n/other/locale/de/LC_MESSAGES/ has it contains binary data, just msgfmt it from the django.po).

The Python issue is still pending, and as it will probably never reach the 2.x Python codebase, I think it's worth to be implemented in Django itself. Other bugs are depending on this (e.g. #9988, #14570, ...).
I took some inspiration from

I'm OK to write docs as soon as it is accepted.

comment:6 by Jannis Leidel, 14 years ago

FYI, further progress to #9988.

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