feat: build framework

This commit is contained in:
2024-03-20 13:33:18 +08:00
parent afb892c5e9
commit 73998976a2
30 changed files with 4186 additions and 342 deletions

17
locales/index.ts Normal file
View File

@@ -0,0 +1,17 @@
// index.ts
import { createI18n } from 'vue-i18n'
import zh from './zh'
import en from './en'
const messages = {
en,
zh
}
const language = (navigator.language || 'en').toLocaleLowerCase() // 这是获取浏览器的语言
const i18n = createI18n({
locale: localStorage.getItem('lang') || language.split('-')[0] || 'en', // 首先从缓存里拿,没有的话就用浏览器语言,
fallbackLocale: 'en', // 设置备用语言
messages
})
export default i18n