-
-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not attempt to load en_GB langauge #474
base: master
Are you sure you want to change the base?
Do not attempt to load en_GB langauge #474
Conversation
@@ -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"]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about startswith("en_")
to cover all variants?
(unless the language param can only be GB or US, not CA or all the other possibilities)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's the right fix, as someone can provide a custom en_*
translation file and this fix would ignore that custom file. I think we should instead fix match_language_with_tinymce
and replace if lang.startswith("en")
with if lang == 'en_US'
at the start of the function, so any en_*
variant will go through the standard search for an existing tinyMCE language file.
@@ -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"]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's the right fix, as someone can provide a custom en_*
translation file and this fix would ignore that custom file. I think we should instead fix match_language_with_tinymce
and replace if lang.startswith("en")
with if lang == 'en_US'
at the start of the function, so any en_*
variant will go through the standard search for an existing tinyMCE language file.
GH-319 only fixed the issue for en_US while it persists for en_GB.
It doesn't seem to be causing any issues, it's just seeing
Not Found: /static/tinymce/langs/en_GB.js
in the console on every page load with TinyMCE widget is annoying.I guess it could be extended to every English language variation by doing something like:
but I'm not an expert on that so I'd appreciate somebody else's input.