Conversation
| 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.
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.
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.
| 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.
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.jsin 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.