From b84e1dbb3055c0108de9840b87a6902e662fd4fc Mon Sep 17 00:00:00 2001 From: hailin Date: Thu, 17 Apr 2025 18:22:30 +0800 Subject: [PATCH] . --- components/ui/language-switcher.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/ui/language-switcher.tsx b/components/ui/language-switcher.tsx index 4135755..1c61493 100644 --- a/components/ui/language-switcher.tsx +++ b/components/ui/language-switcher.tsx @@ -17,7 +17,9 @@ export function LanguageSwitcher() { // 只在加载时检查,避免多次保存 cookie if (typeof window !== 'undefined') { const saved = localStorage.getItem('preferred-language') + console.log('Read cookie from localstorage preferred-language=', saved) const isLocaleInPath = i18nConfig.locales.includes(currentLocale as any) + console.log('i18nConfig.locales currentLocale=', currentLocale) // 只有在 URL 中没有 locale 前缀时才进行处理 if (!isLocaleInPath && saved !== currentLocale) {