Code

Opened 5 years ago

Closed 5 years ago

Last modified 3 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 claudep 3 years ago.
pgettext implementation

Download all attachments as: .zip

Change History (7)

comment:1 Changed 5 years ago by ubernostrum

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

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

comment:2 Changed 5 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 5 years ago by ramiro

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 4 years ago by bronger

  • Cc bronger@… added

Changed 3 years ago by claudep

pgettext implementation

comment:5 Changed 3 years ago by claudep

  • 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 3 years ago by jezdez

FYI, further progress to #9988.

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.