项目从akmon迁入到mall

This commit is contained in:
comlibmb
2026-01-21 12:12:22 +08:00
parent cf8236e175
commit d7f95f7fa5
165 changed files with 69160 additions and 0 deletions

14
utils/i18nfun.uts Normal file
View File

@@ -0,0 +1,14 @@
import i18n from '@/i18n/index.uts'
// 包装一个带参数智能判断的 t 函数,支持缺省值
export function tt(key: string, values: any | null = null, locale: string | null = null): string {
const isLocale = typeof values === 'string'
const _values = isLocale ? null : values
const _locale = isLocale ? values : locale
return i18n.global.t(key, _values, _locale)
}
// 示例用法
// tSmart('prev')
// tSmart('prev', 'en-US')
// tSmart('prev', {name: '张三'})