diff --git a/tests/test_widgets.py b/tests/test_widgets.py index 9cb68843..e8ea818f 100644 --- a/tests/test_widgets.py +++ b/tests/test_widgets.py @@ -62,15 +62,18 @@ def test_config_from_language_code(self): config = widget.get_mce_config(attrs={"id": "id"}) self.assertEqual(config["language"], "en_US") - def test_no_language_for_en_US(self): + def test_no_language_for_en(self): """ - en_US shouldn't set 'language' + en_US nor en_GB shouldn't set 'language' (https://github.com/tinymce/tinymce/issues/4228) """ widget = TinyMCE() with override_settings(LANGUAGE_CODE="en-us"): config = widget.get_mce_config(attrs={"id": "id"}) self.assertNotIn("language", config.keys()) + with override_settings(LANGUAGE_CODE="en-gb"): + config = widget.get_mce_config(attrs={"id": "id"}) + self.assertNotIn("language", config.keys()) self.assertEqual(config["directionality"], "ltr") def test_language_override_from_config(self): diff --git a/tinymce/widgets.py b/tinymce/widgets.py index 65f91e0d..cb367478 100644 --- a/tinymce/widgets.py +++ b/tinymce/widgets.py @@ -55,7 +55,7 @@ def get_mce_config(self, attrs): mce_config = tinymce.settings.DEFAULT_CONFIG.copy() if "language" not in mce_config: mce_config["language"] = get_language_from_django() - if mce_config["language"] == "en_US": + if mce_config["language"] in ["en_GB", "en_US"]: del mce_config["language"] else: mce_config["language"] = match_language_with_tinymce(mce_config["language"])