summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_gettext.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-07-25 18:48:59 (GMT)
committerGitHub <noreply@github.com>2023-07-25 18:48:59 (GMT)
commit11d86c5c339abd52d1ab5ce0af4d25c44898d046 (patch)
tree3229a81d0b2b8f7f885185f0eaa731b913dd5184 /Lib/test/test_gettext.py
parent313284aa423252ebd5d4e761220e0f4fdeac626d (diff)
downloadcpython-11d86c5c339abd52d1ab5ce0af4d25c44898d046.zip
cpython-11d86c5c339abd52d1ab5ce0af4d25c44898d046.tar.gz
cpython-11d86c5c339abd52d1ab5ce0af4d25c44898d046.tar.bz2
[3.12] gh-62519: Make pgettext search plurals when translation is not found (GH-107118) (GH-107134)
(cherry picked from commit b3c34e55c053846beb35f5e4253ef237b3494bd0) Co-authored-by: Tomas R <tomas.roun8@gmail.com> Co-authored-by: Ɓukasz Langa <lukasz@langa.pl>
Diffstat (limited to 'Lib/test/test_gettext.py')
-rw-r--r--Lib/test/test_gettext.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_gettext.py b/Lib/test/test_gettext.py
index aa3520d..8430fc2 100644
--- a/Lib/test/test_gettext.py
+++ b/Lib/test/test_gettext.py
@@ -331,6 +331,8 @@ class PluralFormsTestCase(GettextBaseTest):
x = gettext.npgettext('With context',
'There is %s file', 'There are %s files', 2)
eq(x, 'Hay %s ficheros (context)')
+ x = gettext.pgettext('With context', 'There is %s file')
+ eq(x, 'Hay %s fichero (context)')
def test_plural_forms2(self):
eq = self.assertEqual
@@ -353,6 +355,8 @@ class PluralFormsTestCase(GettextBaseTest):
x = t.npgettext('With context',
'There is %s file', 'There are %s files', 2)
eq(x, 'Hay %s ficheros (context)')
+ x = gettext.pgettext('With context', 'There is %s file')
+ eq(x, 'Hay %s fichero (context)')
# Examples from http://www.gnu.org/software/gettext/manual/gettext.html