feat: 新增中英文語言檔案並更新 i18n 配置

This commit is contained in:
skytek_xinliang
2026-03-30 15:43:22 +08:00
parent d7ebbda3d3
commit 959d2411a9
3 changed files with 81 additions and 12 deletions
+9 -12
View File
@@ -1,21 +1,18 @@
import { createI18n } from 'vue-i18n'
import en from '@/language/en-US.json'
import zh from '@/language/zh-TW.json'
const messages = {
en: {
message: {
hello: 'hello world',
},
},
ja: {
message: {
hello: 'こんにちは、世界',
},
},
'zh-TW': zh,
'en-US': en,
}
const defaultLocale = localStorage.getItem('locale') ?? 'zh-TW'
export default createI18n({
legacy: false,
locale: 'en',
fallbackLocale: 'en',
locale: defaultLocale,
fallbackLocale: 'en-US',
messages,
})