Skip to content

Commit

Permalink
warn the user if page translation is enabled for cibuild
Browse files Browse the repository at this point in the history
  • Loading branch information
wellenvogel committed Dec 10, 2024
1 parent 5adad32 commit a129d86
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
4 changes: 2 additions & 2 deletions webinstall/cibuild.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html>
<html lang="en">

<head>
<script type="module" src="cibuild.js"></script>
Expand Down Expand Up @@ -83,4 +83,4 @@ <h3 id="resultTitle">Last Build</h3>
</form>
</div>
</body>
</html>
</html>
22 changes: 22 additions & 0 deletions webinstall/cibuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

}
})();

0 comments on commit a129d86

Please sign in to comment.