1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-15 15:03:07 +01:00

warn the user if page translation is enabled for cibuild

This commit is contained in:
wellenvogel
2024-12-10 19:16:11 +01:00
parent 5adad321fb
commit a129d865c9
2 changed files with 24 additions and 2 deletions

View File

@@ -867,5 +867,27 @@ class PipelineInfo{
buildSelectors(ROOT_PATH,structure.config.children,true);
if (! isRunning()) findPipeline();
updateStatus();
const translationCheck=()=>{
const lang = document.documentElement.lang;
if (lang != "en"){
alert(
"This page will not work correctly with translation enabled"
);
}
}
// Works at least for Chrome, Firefox, Safari and probably more. Not Microsoft
// Edge though. They're special.
// Yell at clouds if a translator doesn't change it
const observer = new MutationObserver(() => {
translationCheck();
});
observer.observe(document.documentElement, {
attributes: true,
attributeFilter: ['lang'],
childList: false,
characterData: false,
});
translationCheck();
}
})();