Initial commit of akmon project

This commit is contained in:
2026-01-20 08:04:15 +08:00
commit 77a2bab985
1309 changed files with 343305 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: '张三'})