Opened 7 years ago

Closed 7 years ago

Last modified 6 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: UI/UX:

Description

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 6 years ago.
pgettext implementation

Download all attachments as: .zip

Change History (7)

comment:1 Changed 7 years ago by James Bennett

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 Changed 7 years ago by Mitar

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 Changed 7 years ago by Ramiro Morales

See http://groups.google.com/group/Django-I18N/browse_frm/thread/577afdaef1392958?hl=en

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 Changed 7 years ago by Torsten Bronger

Cc: bronger@… added

Changed 6 years ago by Claude Paroz

Attachment: pgettext.patch added

pgettext implementation

comment:5 Changed 6 years ago by Claude Paroz

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/django.mo 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 http://bugs.python.org/file10036/gettext-pgettext.patch

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

comment:6 Changed 6 years ago by Jannis Leidel

FYI, further progress to #9988.

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