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:
@@ -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();
|
||||
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user