From db58bdd76eae3feb6b3222fc60908c541586f5d9 Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Sat, 28 Dec 2024 12:57:23 +0800 Subject: [PATCH] fix: extend `Intl.getCanonicalLocales` error message --- utils/getLanguage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/getLanguage.ts b/utils/getLanguage.ts index c96f7c7e..0334f634 100644 --- a/utils/getLanguage.ts +++ b/utils/getLanguage.ts @@ -55,7 +55,7 @@ function linkLocale(locale: string) { try { linkedLocale = Intl.getCanonicalLocales(locale)[0] } catch (error) { - console.log(`${error.toString()}\n`) + console.log(`${error.toString()}, invalid language tag: "${locale}"\n`) } switch (linkedLocale) { case 'zh-TW':