feat: 实现 C 端移动溯源页(响应式 H5 + 中英 i18n)

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Nixevol
2026-06-28 16:58:04 +08:00
co-authored by Cursor
parent 5fa84f346b
commit 45c4b11938
17 changed files with 849 additions and 2 deletions
+23
View File
@@ -0,0 +1,23 @@
import { createI18n } from 'vue-i18n';
import zhCN from './zh-CN.json';
import enUS from './en-US.json';
const KEY = 'artveris_h5_locale';
export function getInitialLocale(): string {
const saved = localStorage.getItem(KEY);
if (saved) return saved;
return navigator.language.startsWith('en') ? 'en-US' : 'zh-CN';
}
export const i18n = createI18n({
legacy: false,
locale: getInitialLocale(),
fallbackLocale: 'zh-CN',
messages: { 'zh-CN': zhCN, 'en-US': enUS },
});
export function setLocale(l: string): void {
localStorage.setItem(KEY, l);
i18n.global.locale.value = l as 'zh-CN' | 'en-US';
}