Set the language of the document
authorRaphaël Jakse <raphael.trivabble@jakse.fr>
Wed, 15 Apr 2020 19:24:40 +0000 (21:24 +0200)
committerRaphaël Jakse <raphael.trivabble@jakse.fr>
Wed, 15 Apr 2020 19:24:40 +0000 (21:24 +0200)
index.html
trivabble.js

index 9ff2d860e367c5e5aa893720680057b130b01c68..3a9899a3e341b8d6d8870ee6f391808c441d3c43 100644 (file)
@@ -1,5 +1,5 @@
 <!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
     <head>
         <meta charset="utf-8" />
         <title> Trivabble </title>
index 3a4844110b5e371f528677e1bd35298a9ec0c7d5..38072cc55fe4993cbf60c2ef8200cb36f897afff 100644 (file)
     }
 
     trivabble.applyL10n = function () {
+        document.documentElement.lang = libD.lang;
+        document.documentElement.setAttribute("xml:lang", libD.lang);
+
         for (const node of [].slice.call(document.querySelectorAll("[data-l10n]"))) {
             if (node.dataset.l10n === "text-content") {
                 node.textContent = _(node.textContent.trim());