feat: 新增中英文語言檔案並更新 i18n 配置
This commit is contained in:
+9
-12
@@ -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,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user