mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
gh-62519: Make pgettext search plurals when translation is not found (#107118)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
This commit is contained in:
parent
b273837fea
commit
b3c34e55c0
3 changed files with 12 additions and 4 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue