wip(i18n): Config i18n
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { createI18n } from 'vue-i18n'
|
||||
import type { App } from 'vue'
|
||||
import type { I18nOptions } from 'vue-i18n'
|
||||
|
||||
// export let i18n: ReturnType<typeof createI18n>
|
||||
export let i18n: ReturnType<typeof createI18n>
|
||||
|
||||
const messages = Object.fromEntries(
|
||||
Object.entries(import.meta.globEager('../../locales/*.ts')).map(([key, value]) => {
|
||||
@@ -10,10 +11,10 @@ const messages = Object.fromEntries(
|
||||
)
|
||||
|
||||
export function setupI18n(app: App): void {
|
||||
const i18n = createI18n({
|
||||
i18n = createI18n({
|
||||
legacy: false,
|
||||
locale: 'zh-CN',
|
||||
messages
|
||||
})
|
||||
} as I18nOptions)
|
||||
app.use(i18n)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user