mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 09:33:37 +08:00
DEV: Improve browser-update compatibility (#24852)
Now that we're using native `import()`, our main JS bundles might not even be parse-able by older browsers. In that case, `I18n` will never be defined, and so we need to account for that situation in the browser-update code.
This commit is contained in:
parent
097cef7d21
commit
0f3a6cf042
|
@ -45,8 +45,8 @@
|
|||
}
|
||||
|
||||
// retrieve localized browser upgrade text
|
||||
var t = I18n.t("browser_update"); // eslint-disable-line no-undef
|
||||
if (t.indexOf(".browser_update]") !== -1) {
|
||||
var t = window.I18n && I18n.t("browser_update"); // eslint-disable-line no-undef
|
||||
if (!t || t.indexOf(".browser_update]") !== -1) {
|
||||
// very old browsers might fail to load even translations
|
||||
t =
|
||||
'Unfortunately, <a href="https://www.discourse.org/faq/#browser">your browser is unsupported</a>. Please <a href="https://browsehappy.com">switch to a supported browser</a> to view rich content, log in and reply.';
|
||||
|
|
Loading…
Reference in New Issue
Block a user