Browse Source

fix: secoia intl

webpushnotifications
Jean-Baptiste Pasquier 3 months ago
parent
commit
239eb2224b
  1. 6
      src/scripts/intl.js

6
src/scripts/intl.js

@ -257,7 +257,7 @@ window.orbit.intl = new JsI18n;
document.addEventListener("DOMContentLoaded", () => {
// Detect the lang & initialize, based on the browser or "language" item from localstorage
window.orbit.intl.detectLanguage();
let timer;
let timer, timer2;
(new MutationObserver((mutations) => {
mutations.forEach(mutation => {
if (mutation.target.attributes["data-trans"] != null) {
@ -267,6 +267,10 @@ document.addEventListener("DOMContentLoaded", () => {
clearTimeout(timer);
timer = setTimeout(() => window.orbit.intl.processNode(document.querySelector('body')), 500);
}
// Hotfix for Secoia
if (mutation.target.nodeName == "SOLID-DIRECTORY") {
if(!timer2) timer2 = setTimeout(() => mutation.target.render(), 500);
}
});
}).observe(document.body, {
subtree: true,

Loading…
Cancel
Save