mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 08:57:10 -06:00
DEV: Simplify I18n shim check (#24244)
We have identified some third-party analytics scripts which do things like `window.I18n = window.I18n` 🤦♂️. This leads to the window object having a null I18n property, but `"I18n" in globalThis` returns true.
This commit checks whether `window.I18n` is a truthy value.
This commit is contained in:
parent
047cae4b3f
commit
76b75fae36
@ -1,4 +1,4 @@
|
||||
if ("I18n" in globalThis) {
|
||||
if (window.I18n) {
|
||||
throw new Error(
|
||||
"I18n already defined, discourse-i18n unexpectedly loaded twice!"
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user