Opened 15 years ago

Closed 13 years ago

Last modified 12 years ago

#9988 closed (fixed)

Make it possible to handle translation contexts

Reported by: Stephane Raimbault Owned by: nobody
Component: Internationalization Version: dev
Severity: Keywords: french i18n-nofix
Cc: claude@…, s.kuzmenko@…, bronger@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The file utils/date.py contains the following strings:
MONTHS = {

1:_('January'), 2:_('February'), 3:_('March'), 4:_('April'), 5:_('May'), 6:_('June'),
7:_('July'), 8:_('August'), 9:_('September'), 10:_('October'), 11:_('November'),
12:_('December')

}

MONTHS_AP = { # month names in Associated Press style

1:_('Jan.'), 2:_('Feb.'), 3:_('March'), 4:_('April'), 5:_('May'), 6:_('June'), 7:_('July'),
8:_('Aug.'), 9:_('Sept.'), 10:_('Oct.'), 11:_('Nov.'), 12:_('Dec.')

}

so there is only one string for 'July' in the PO file and it's not possible to have a contextual translation.
For example, in French, the first translation is 'Juillet' and the second one for AP is 'Juil.'.

The solution depends on http://bugs.python.org/issue2504

Attachments (3)

pgettext.patch (6.9 KB ) - added by Claude Paroz 13 years ago.
pgettext implementation
pgettext-2.patch (11.7 KB ) - added by Claude Paroz 13 years ago.
pgettext implementation including js and docs
months_ap_pgettext.patch (1.3 KB ) - added by Claude Paroz 13 years ago.
Add context to MONTHS_AP dict strings

Download all attachments as: .zip

Change History (20)

comment:1 by Malcolm Tredinnick, 15 years ago

Component: TranslationsInternationalization

comment:2 by Jacob, 15 years ago

Triage Stage: UnreviewedDesign decision needed

comment:3 by Marc Garcia, 15 years ago

Keywords: i18n-nofix added

comment:4 by Ramiro Morales, 14 years ago

[12296] is a first step in this direction.

comment:5 by Ramiro Morales, 14 years ago

Summary: It's not possible to correctly translate the monthsMake it possible to handle translation contexts

See related django-i18n thread.

comment:6 by Jannis Leidel, 13 years ago

Triage Stage: Design decision neededAccepted

by Claude Paroz, 13 years ago

Attachment: pgettext.patch added

pgettext implementation

comment:7 by Jannis Leidel, 13 years ago

milestone: 1.3

comment:8 by Claude Paroz, 13 years ago

I just attached a patch to implement pgettext for Django (same patch uploaded on #11686). This would be the foundation needed to resolve this issue.

by Claude Paroz, 13 years ago

Attachment: pgettext-2.patch added

pgettext implementation including js and docs

by Claude Paroz, 13 years ago

Attachment: months_ap_pgettext.patch added

Add context to MONTHS_AP dict strings

comment:9 by Claude Paroz, 13 years ago

Cc: claude@… added
Has patch: set

comment:10 by anonymous, 13 years ago

Cc: s.kuzmenko@… added

comment:11 by Claude Paroz, 13 years ago

Note that Catalan translations will have to be updated after the MONTHS_AP patch so as regressiontests.i18n.tests.FormattingTests still pass successfully.

comment:12 by Torsten Bronger, 13 years ago

Cc: bronger@… added

comment:13 by Jannis Leidel, 13 years ago

Resolution: fixed
Status: newclosed

(In [14450]) Fixed #9988 -- Added support for translation contexts. Thanks, Claude Paroz.

comment:14 by Jannis Leidel, 13 years ago

(In [14899]) Fixed #14570 -- Added new date format character for alternative month names using the new context capabilities. Also add context to Associated Press style month names (refs #9988). Thanks to Claude and shell_dweller.

comment:15 by Claude Paroz, 13 years ago

Resolution: fixed
Status: closedreopened

I'm reopening the ticket, because the latest patch which fixes the main issue of the original ticket is still not committed.

comment:16 by Jannis Leidel, 13 years ago

Resolution: fixed
Status: reopenedclosed

(In [15280]) Fixed #9988 (again) -- Updated list of Associated Press months names to use a translation context. Thanks, Claude Paroz.

comment:17 by Jacob, 12 years ago

milestone: 1.3

Milestone 1.3 deleted

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