Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] unit test has an international I18N report error. #11342

Closed
mgbq opened this issue May 25, 2018 · 3 comments
Closed

[Bug Report] unit test has an international I18N report error. #11342

mgbq opened this issue May 25, 2018 · 3 comments

Comments

@mgbq
Copy link

mgbq commented May 25, 2018

Element UI version

2.3.9

OS/Browsers version

1.9

Vue version

2.5.17-beta.0

Reproduction Link

Molunerfinn/vue-koa-demo#32

Steps to reproduce

你好,我参考了element test util.js ,我是这样引入i18n的
import i18n from '@/lang'
Vue.use(Element, {
size: 'medium', // set element-ui default size
i18n: (key, value) => i18n.t(key, value)
})

可是它报错了 信息为 ERROR LOG: TypeError: undefined is not an object (evaluating 'i18n._t')
改成
import i18n from '@/lang'
Vue.use(i18n) 也是报这个错,百忙中求解答

What is Expected?

期望正常test

What is actually happening?

ERROR LOG: TypeError: undefined is not an object (evaluating 'i18n._t')

@element-bot element-bot changed the title [Bug Report] 单元测试里面有国际化i18n 报错 [Bug Report] unit test has an international I18N report error. May 25, 2018
@element-bot
Copy link
Member

Translation of this issue:

Element UI version
2.3.9

OS/Browsers version
One point nine

Vue version
2.5.17-beta.0

Reproduction Link
Molunerfinn/vue-koa-demo#32

Steps to reproduce
Hello, I refer to element test util.js. I introduced I18N in this way.

Import I18N from'@/lang'
Vue.use (Element, {

Size:'medium', / / / set element-ui default size
I18n: (key, value) = > i18n.t (key, value)

})
However, it reported the wrong information as ERROR LOG: TypeError: undefined is not an object (evaluating'i18n._t').

Change into
Import I18N from'@/lang'

Vue.use (I18N) also reported this mistake and asked for answers in busy schedule.
What is Expected?

Expected normal test
What is actually happening?

ERROR LOG: TypeError: undefined is not an object (evaluating'i18n._t')

@mgbq
Copy link
Author

mgbq commented May 25, 2018

thanks

@jikkai
Copy link
Contributor

jikkai commented May 25, 2018

根据你给出的片段感觉是用法有问题,请仔细阅读文档 - 国际化获得帮助。如果确认不是用法问题而是可复现的 bug,请整理一个最小化可复现 demo。

@jikkai jikkai closed this as completed May 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants