智慧教务系统 PHP-NiuCloud框架开发
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

10 lines
405 B

import { useRoute } from 'vue-router'
import Language from '~~/utils/language'
export function t(message: string) {
const i18n = useNuxtApp().$getI18n()
const route = useRoute()
const file = new Language(i18n).getFileKey((route?.meta.addon || 'app'), route?.path || '')
const key = `${file}.${message}`
return i18n.global.t(key) != key ? i18n.global.t(key) : i18n.global.t(message)
}