From 3b99de49728eba6ebae4d92a12a3a51e614f2796 Mon Sep 17 00:00:00 2001 From: Lena Montenot Date: Thu, 23 Mar 2023 12:33:29 +0100 Subject: [PATCH] Filter out links which locale is different from the html document's --- .../discourse/initializers/discourse-custom-header-links.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/javascripts/discourse/initializers/discourse-custom-header-links.js b/javascripts/discourse/initializers/discourse-custom-header-links.js index 73e556a..5b086f9 100644 --- a/javascripts/discourse/initializers/discourse-custom-header-links.js +++ b/javascripts/discourse/initializers/discourse-custom-header-links.js @@ -47,6 +47,11 @@ export default { anchorAttributes.target = linkTarget; } + if (locale !== "" + && document.documentElement.lang + && document.documentElement.lang !== locale + ) { return ; } + headerLinks.push( h( `li.headerLink${deviceClass}${keepOnScrollClass}${localeClass}${linkClass}`,