feat(i18n): add zh-tw

This commit is contained in:
lejianwen
2025-01-19 21:19:57 +08:00
parent 68ebc75e59
commit 8617959d15
2 changed files with 12 additions and 8 deletions
+10 -8
View File
@@ -4,19 +4,21 @@ import zhCN from '@/utils/i18n/zh_CN.json'
import ko from '@/utils/i18n/ko.json'
import ru from '@/utils/i18n/ru.json'
import es from '@/utils/i18n/es.json'
import zhTW from '@/utils/i18n/zh_TW.json'
import { useAppStore } from '@/store/app'
const trans = {
'en': en,
'fr': fr,
'zh-CN': zhCN,
'ko': ko,
'ru': ru,
'es': es,
'zh-TW': zhTW,
}
export function T (key, params, num = 0) {
const appStore = useAppStore()
const lang = appStore.setting.lang
const trans = {
'en': en,
'fr': fr,
'zh-CN': zhCN,
'ko': ko,
'ru': ru,
'es': es,
}
const tran = trans[lang]?.[key]
if (!tran) {
return key