classification
Title: Add gettext.pgettext() and variants support
Type: feature request
Components: Library (Lib) Versions: Python 3.0, Python 2.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: loewis Nosy List: bronger, franz_glasner, genepi, loewis
Priority: Keywords: patch

Created on 2008-03-29 02:10 by genepi, last changed 2008-05-03 10:22 by bronger.

Files
File name Uploaded Description Edit Remove
gettext-pgettext.patch franz_glasner, 2008-04-15 20:17 Patch for gettext module to add pgettext and variants
Messages
msg64675 (view) Author: Pierre Metras (genepi) Date: 2008-03-29 02:10
Please add support for pgettext(msgctxt, msgid) and variants (dpgettext,
dcpgettext...) in the gettext module.

I will not rephrase the justification for these functions and why
contexts are essential for good localization:
http://www.gnu.org/software/gettext/manual/gettext.html#Contexts
msg64685 (view) Author: Martin v. Löwis (loewis) Date: 2008-03-29 08:38
Would you like to work on a patch?
msg65526 (view) Author: Franz Glasner (franz_glasner) Date: 2008-04-15 20:17
I have written a patch against the current Python trunk's gettext to
add support for pgettext and friends (upgettext, npgettext, unpgettext,
...).

I have also changed Tools/i18n/msgfmt.py to recognize the "msgctxt" keyword.
Some new unittests for dgettext and lgettext and variants are also included.

If the patch will be accepted then someone should drop a message to the
maintainers of GNU gettext to add the new functions as default keywords
for xgettext. Right now you have to call xgettext with
"--keyword=pgettext:1c,2" to extract messages with context. 

Tools/i18n/pygettext.py does currently not handle context variants.
History
Date User Action Args
2008-05-03 10:22:28brongersetnosy: + bronger
2008-04-15 21:17:01loewissetassignee: loewis
2008-04-15 20:17:20franz_glasnersetfiles: + gettext-pgettext.patch
nosy: + franz_glasner
keywords: + patch
messages: + msg65526
components: + Library (Lib), - Extension Modules
2008-03-29 08:38:24loewissetnosy: + loewis
messages: + msg64685
2008-03-29 02:10:23genepicreate