mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[3.11] gh-62519: Make pgettext search plurals when translation is not found (GH-107118) (GH-107133)
(cherry picked from commit b3c34e55c0)
Co-authored-by: Tomas R <tomas.roun8@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
This commit is contained in:
parent
012bc1329a
commit
41756e3960
3 changed files with 12 additions and 4 deletions
|
|
@ -329,6 +329,8 @@ def test_plural_context_forms1(self):
|
|||
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
|
||||
|
|
@ -349,6 +351,8 @@ def test_plural_context_forms2(self):
|
|||
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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue