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

需要 I18n,所以返回验证信息里面的 message 不应该保函 key 的字符串 #9

Closed
huacnlee opened this issue Sep 14, 2015 · 4 comments

Comments

@huacnlee
Copy link
Contributor

https://github.com/node-modules/parameter/blob/master/index.js#L101

[
{
  message: 'name should be a string',
  code: 'invalid',
  field: 'name'
}  
]

to

[
{
  message: 'should be a string',
  code: 'invalid',
  field: 'name'
}  
]

这样一来,message 的内容是固定的,就可以写 I18n 对应其他语言了。

@fengmk2
Copy link
Member

fengmk2 commented Sep 14, 2015

LGTM, DO IT!

@fengmk2
Copy link
Member

fengmk2 commented Sep 14, 2015

@huacnlee add you to team now.

@huacnlee
Copy link
Contributor Author

@fengmk2 我来搞吧?

@huacnlee
Copy link
Contributor Author

看了一下 should bigger than 10 这种情况还无法实现 I18n,10 是变数,存在困难,除非这个库直接带 i18n, 可以支持配置。

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

2 participants