集成 vue-i18n 支持国际化

This commit is contained in:
就眠儀式
2022-02-09 17:40:33 +08:00
parent 4325ca3bff
commit 70d4f66b96
7 changed files with 62 additions and 7 deletions

27
src/locales/index.ts Normal file
View File

@@ -0,0 +1,27 @@
import { createI18n } from 'vue-i18n'
const i18n = createI18n({
locale: 'en_US', // set locale
messages: {
zh_CN: {
input: {
hello: '你好世界',
},
page: {
prev: '上一页',
next: '下一页'
}
},
en_US: {
input: {
hello: 'hello world',
},
page: {
prev: 'prev',
next: 'next'
}
},
},
})
export default i18n