This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: gettext() cannot find translations with plural forms
Type: behavior Stage: patch review
Components: Library (Lib) Versions: Python 3.10, Python 3.9, Python 3.8, Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Gilles Bassière, barry, cito, jwilk, loewis, python-dev
Priority: normal Keywords: patch

Created on 2013-06-27 22:53 by jwilk, last changed 2022-04-11 14:57 by admin.

Files
File name Uploaded Description Edit
test.mo jwilk, 2013-06-27 22:53
Pull Requests
URL Status Linked Edit
PR 19869 open python-dev, 2020-05-02 22:04
Messages (3)
msg191967 - (view) Author: Jakub Wilk (jwilk) Date: 2013-06-27 22:53
gettext() cannot find translations for messages that have plural forms. I would expect that gettext(s) is equivalent to ngettext(s, s, 1) for such messages, as it is implemented in GNU gettext.

>>> import gettext
>>> with open('test.mo', 'rb') as mo: trans = gettext.GNUTranslations(mo)
... 
>>> trans.ngettext("egg", "eggs", 1)
'Ei'
>>> trans.gettext("egg")
'egg'
msg228601 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-10-05 17:53
@Martin can you comment on this please.
msg368346 - (view) Author: Gilles Bassière (Gilles Bassière) * Date: 2020-05-07 14:46
Hi there,

I worked on a patch for this issue (see attached pull request).

I would be happy to discuss it with people involved in gettext module maintenance but I'm not sure how to contact them. Is there a dedicated mailing list or an IRC channel or something? I've found i18n-sig but it has been inactive for 5 years...

Best regards
Gilles
History
Date User Action Args
2022-04-11 14:57:47adminsetgithub: 62519
2020-09-18 20:39:10citosetnosy: + cito
2020-06-09 22:52:39remi.lapeyresetnosy: + barry

versions: + Python 3.8, Python 3.9, Python 3.10, - Python 2.7, Python 3.4, Python 3.5
2020-05-07 14:46:56Gilles Bassièresetmessages: + msg368346
2020-05-02 22:04:02python-devsetkeywords: + patch
nosy: + python-dev

pull_requests: + pull_request19182
stage: patch review
2020-05-01 19:36:12Gilles Bassièresetnosy: + Gilles Bassière

versions: + Python 3.7
2019-04-26 17:51:12BreamoreBoysetnosy: - BreamoreBoy
2014-10-05 17:53:00BreamoreBoysetversions: + Python 2.7, Python 3.4, Python 3.5
nosy: + loewis, BreamoreBoy

messages: + msg228601

type: behavior
2013-06-27 22:53:23jwilkcreate