1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #29144 -- Made untranslated strings for territorial language variants use translations from the generic language variant.

This commit is contained in:
Patryk Zawadzki
2018-02-19 19:09:33 +01:00
committed by Tim Graham
parent 939e0a5995
commit a20aae414e
9 changed files with 81 additions and 1 deletions

View File

@@ -1455,6 +1455,20 @@ class DjangoFallbackResolutionOrderI18NTests(ResolutionOrderI18NTests):
self.assertEqual(gettext('Date/time'), 'Datum/Zeit')
@override_settings(INSTALLED_APPS=['i18n.territorial_fallback'])
class TranslationFallbackI18NTests(ResolutionOrderI18NTests):
def test_sparse_territory_catalog(self):
"""
Untranslated strings for territorial language variants use the
translations of the generic language. In this case, the de-de
translation falls back to de.
"""
with translation.override('de-de'):
self.assertGettext('Test 1 (en)', '(de-de)')
self.assertGettext('Test 2 (en)', '(de)')
class TestModels(TestCase):
def test_lazy(self):
tm = TestModel()