unibest/src/utils/index.ts

14 lines
251 B
TypeScript
Raw Normal View History

import { translate as t } from '@/locale/index'
2024-01-29 18:53:57 +08:00
/**
* test i18n in not .vue file
*/
export const testI18n = () => {
console.log(t('app.name'))
// 下面同样生效
2024-01-29 19:14:01 +08:00
uni.showModal({
title: 'i18n 测试',
content: t('app.name'),
})
2024-01-29 18:53:57 +08:00
}