diff --git a/src/shared/i18n/index.ts b/src/shared/i18n/index.ts index 857f5aa..14f732b 100644 --- a/src/shared/i18n/index.ts +++ b/src/shared/i18n/index.ts @@ -14,8 +14,8 @@ const messages = { 'en-US': {} // 英文使用key作为默认值 } -// 全局语言状态 - 默认英文 -export const locale = ref('en-US') +// 全局语言状态 +export const locale = ref('zh-CN') // 翻译函数 - 支持 t("自然英文") 语法 export function t(key: string) { @@ -45,9 +45,6 @@ export function initLocale() { const saved = localStorage.getItem('locale') if (saved && locales.some(l => l.code === saved)) { locale.value = saved - } else { - // 如果没有保存的语言,默认使用英文 - locale.value = 'en-US' } // 初始化时设置 HTML 的 lang 属性 if (typeof document !== 'undefined') {