From 49a33ae467b8c4297517b1539d246d13105b3e9a Mon Sep 17 00:00:00 2001 From: Leilei332 Date: Fri, 20 Dec 2024 22:25:16 +0800 Subject: [PATCH] Fix switching language should not make the lang attribute empty (#8831) * Fix switching language should not make the lang attribute empty * Use name field --- core/modules/startup/startup.js | 1 + 1 file changed, 1 insertion(+) diff --git a/core/modules/startup/startup.js b/core/modules/startup/startup.js index e09f6393f..dcfcac48a 100755 --- a/core/modules/startup/startup.js +++ b/core/modules/startup/startup.js @@ -88,6 +88,7 @@ exports.startup = function() { if($tw.browser) { var pluginTiddler = $tw.wiki.getTiddler(plugins[0]); if(pluginTiddler) { + document.documentElement.setAttribute("lang",pluginTiddler.getFieldString("name")); document.documentElement.setAttribute("dir",pluginTiddler.getFieldString("text-direction") || "auto"); } else { document.documentElement.removeAttribute("dir");