mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #33863 -- Fixed JavaScriptCatalog with more than 1 level of fallback translations.
Co-authored-by: Carlos Mermingas <cmermingas@gmail.com>
This commit is contained in:
committed by
Mariusz Felisiak
parent
9ba2e8821f
commit
f2dd652245
@@ -344,6 +344,27 @@ class I18NViewTests(SimpleTestCase):
|
||||
self.assertContains(response, "il faut le traduire")
|
||||
self.assertNotContains(response, "Untranslated string")
|
||||
|
||||
def test_jsi18n_fallback_language_with_custom_locale_dir(self):
|
||||
"""
|
||||
The fallback language works when there are several levels of fallback
|
||||
translation catalogs.
|
||||
"""
|
||||
locale_paths = [
|
||||
path.join(
|
||||
path.dirname(path.dirname(path.abspath(__file__))),
|
||||
"custom_locale_path",
|
||||
),
|
||||
]
|
||||
with self.settings(LOCALE_PATHS=locale_paths), override("es_MX"):
|
||||
response = self.client.get("/jsi18n/")
|
||||
self.assertContains(
|
||||
response, "custom_locale_path: esto tiene que ser traducido"
|
||||
)
|
||||
response = self.client.get("/jsi18n_no_packages/")
|
||||
self.assertContains(
|
||||
response, "custom_locale_path: esto tiene que ser traducido"
|
||||
)
|
||||
|
||||
def test_i18n_fallback_language_plural(self):
|
||||
"""
|
||||
The fallback to a language with less plural forms maintains the real
|
||||
|
||||
Reference in New Issue
Block a user