mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #28221 -- Fixed plural fallback translations in JavaScriptCatalog view
Thanks Waldemar Kornewald for the report and initial patch.
This commit is contained in:
@@ -272,13 +272,27 @@ class I18NViewTests(SimpleTestCase):
|
||||
def test_i18n_fallback_language_plural(self):
|
||||
"""
|
||||
The fallback to a language with less plural forms maintains the real
|
||||
language's number of plural forms.
|
||||
language's number of plural forms and correct translations.
|
||||
"""
|
||||
with self.settings(LANGUAGE_CODE='pt'), override('ru'):
|
||||
response = self.client.get('/jsi18n/')
|
||||
self.assertEqual(
|
||||
response.context['catalog']['{count} plural3'],
|
||||
['{count} plural3', '{count} plural3s', '{count} plural3 p3t']
|
||||
['{count} plural3 p3', '{count} plural3 p3s', '{count} plural3 p3t']
|
||||
)
|
||||
self.assertEqual(
|
||||
response.context['catalog']['{count} plural2'],
|
||||
['{count} plural2', '{count} plural2s', '']
|
||||
)
|
||||
with self.settings(LANGUAGE_CODE='ru'), override('pt'):
|
||||
response = self.client.get('/jsi18n/')
|
||||
self.assertEqual(
|
||||
response.context['catalog']['{count} plural3'],
|
||||
['{count} plural3', '{count} plural3s']
|
||||
)
|
||||
self.assertEqual(
|
||||
response.context['catalog']['{count} plural2'],
|
||||
['{count} plural2', '{count} plural2s']
|
||||
)
|
||||
|
||||
def test_i18n_english_variant(self):
|
||||
|
||||
Reference in New Issue
Block a user