warn the user if page translation is enabled for cibuild
This commit is contained in:
parent
5adad321fb
commit
a129d865c9
|
@ -1,5 +1,5 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<script type="module" src="cibuild.js"></script>
|
||||
|
|
|
@ -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();
|
||||
|
||||
}
|
||||
})();
|
Loading…
Reference in New Issue