From 3c5965936be2bb0613dcee2e3906bce982964674 Mon Sep 17 00:00:00 2001 From: Leilei332 Date: Sat, 22 Nov 2025 12:42:35 +0800 Subject: [PATCH] Update checkLanguageCode --- core/modules/utils/utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/modules/utils/utils.js b/core/modules/utils/utils.js index 96ca7b92b..65d23ff6a 100644 --- a/core/modules/utils/utils.js +++ b/core/modules/utils/utils.js @@ -165,9 +165,10 @@ Check whether a language code is supported by Intl */ exports.checkLanguageCode = lang => { try { - "a".localeCompare("a", lang); + Intl.Collator(lang); return true; } catch(e) { + console.warn(`Warning: ${lang} is not a valid language code.`); return false; } }