wangchen147 f7288afe80 0.1.1
2024-03-08 16:06:29 +08:00

20 lines
447 B
TypeScript

import i18n, { language } from "./i18n"
import { currRoute } from '@/utils/common'
const t = (message: string) => {
const route = currRoute()
const file = language.getFileKey(`/${route}`)
const key = `${file.fileKey}.${message}`
return i18n.global.t(key) != key ? i18n.global.t(key) : i18n.global.t(message)
}
export { language, t }
export default {
install(app: any) {
//注册i18n
app.use(i18n);
}
};