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

feat: 更新多语言取值的回退机制 #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AmosJin
Copy link
Contributor

@AmosJin AmosJin commented Aug 19, 2019

从原来默认取空,更改为默认取源多语言的值;这样解决了之前主项目
新增多语言,如果不更新 tb-i18n-loader,值回退到 key 上的问题

从原来默认取空,更改为默认取源多语言的值;这样解决了之前主项目
新增多语言,如果不更新 tb-i18n-loader,值回退到 key 上的问题
@AmosJin AmosJin force-pushed the feat/lang-fallback branch from 433b9da to 1d9227e Compare August 19, 2019 03:06
@AmosJin AmosJin requested a review from chuan6 August 19, 2019 03:07
keys.forEach(function (key) {
locales[key] = originLocales[key] || ''
})
for (var key in description) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AmosJin 这里我们有特别要用 in 的原因吗?会不会可以像上边一样用 Object.keys?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有什么特别的区别吗?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AmosJin 我们只要 own property 的遍历,我个人觉得 Object.keys 准确一些 :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我觉得都 ok,LGTM

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

Successfully merging this pull request may close these issues.

3 participants