zhangfisher / voerka-i18n

Nodejs/Vue/React International solutions
https://zhangfisher.github.io/repos#voerka-i18n
MIT License
147 stars 13 forks source link

使用 t 翻译似乎无法转换纯 js 文件的翻译内容 #49

Open aniude opened 4 days ago

aniude commented 4 days ago

eg . test.js

import { t } from './languages'

const attr = {'name': t('名字')};  // 不会自动转换英文

const attr = {'name': () => t('名字')}; // 写成这样就可以

在 vue 文件使用没有这个问题.

aniude commented 4 days ago

另外 vue 组件 的 props 使用 default 参数好像也有这个问题.