diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-12-06 20:29:53 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-12-06 20:31:03 +0100 |
| commit | 628b6a686974698cbf820bad72f10dad133174ec (patch) | |
| tree | b764e868cf52f487382e7dd53e0656724d479c18 /tests | |
| parent | 1eaf38fa87384fe26d1abf6e389d6df1600d4d8c (diff) | |
Updated translations from Transifex.
This also fixes related i18n tests.
Forwardport of 4c5215ab036aa8fda9cd0148fd034f4d8f7d69d1 from stable/4.0.x
Co-authored-by: Claude Paroz <claude@2xlibre.net>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/forms_tests/tests/test_i18n.py | 2 | ||||
| -rw-r--r-- | tests/i18n/tests.py | 18 |
2 files changed, 13 insertions, 7 deletions
diff --git a/tests/forms_tests/tests/test_i18n.py b/tests/forms_tests/tests/test_i18n.py index 38840e748e..67aafa0527 100644 --- a/tests/forms_tests/tests/test_i18n.py +++ b/tests/forms_tests/tests/test_i18n.py @@ -29,7 +29,7 @@ class FormsI18nTests(SimpleTestCase): with translation.override('pl'): self.assertHTMLEqual( f.as_p(), - '<p><label for="id_username">u\u017cytkownik:</label>' + '<p><label for="id_username">nazwa u\u017cytkownika:</label>' '<input id="id_username" type="text" name="username" maxlength="10" required></p>' ) diff --git a/tests/i18n/tests.py b/tests/i18n/tests.py index 0b419d426c..bebe313aa5 100644 --- a/tests/i18n/tests.py +++ b/tests/i18n/tests.py @@ -74,16 +74,22 @@ class TranslationTests(SimpleTestCase): """ Test plurals with ngettext. French differs from English in that 0 is singular. """ - self.assertEqual(ngettext("%d year", "%d years", 0) % 0, "0 année") - self.assertEqual(ngettext("%d year", "%d years", 2) % 2, "2 années") + self.assertEqual( + ngettext('%(num)d year', '%(num)d years', 0) % {'num': 0}, + '0 année', + ) + self.assertEqual( + ngettext('%(num)d year', '%(num)d years', 2) % {'num': 2}, + '2 années', + ) self.assertEqual(ngettext("%(size)d byte", "%(size)d bytes", 0) % {'size': 0}, "0 octet") self.assertEqual(ngettext("%(size)d byte", "%(size)d bytes", 2) % {'size': 2}, "2 octets") def test_plural_null(self): g = trans_null.ngettext - self.assertEqual(g('%d year', '%d years', 0) % 0, '0 years') - self.assertEqual(g('%d year', '%d years', 1) % 1, '1 year') - self.assertEqual(g('%d year', '%d years', 2) % 2, '2 years') + self.assertEqual(g('%(num)d year', '%(num)d years', 0) % {'num': 0}, '0 years') + self.assertEqual(g('%(num)d year', '%(num)d years', 1) % {'num': 1}, '1 year') + self.assertEqual(g('%(num)d year', '%(num)d years', 2) % {'num': 2}, '2 years') @override_settings(LOCALE_PATHS=extended_locale_paths) @translation.override('fr') @@ -99,7 +105,7 @@ class TranslationTests(SimpleTestCase): french = trans_real.catalog() # Internal _catalog can query subcatalogs (from different po files). self.assertEqual(french._catalog[('%d singular', 0)], '%d singulier') - self.assertEqual(french._catalog[('%d hour', 0)], '%d heure') + self.assertEqual(french._catalog[('%(num)d hour', 0)], '%(num)d heure') def test_override(self): activate('de') |
