[RFC] egg-validate support i18n and auto load rule file
Open
type: proposals
- Dominant language
- TypeScript
- Stars
- 19k
- Forks
- 1.8k
- PR merge metrics
- No merged PRs in 30d
Description
## Background
Currently, [egg-validate](https://github.com/eggjs/egg-validate) don't support `i18n`:
- https://github.com/eggjs/egg/issues/589
- https://github.com/eggjs/egg/issues/1064
- https://github.com/eggjs/egg-validate/pull/7
## Proposal
### i18n
- `egg-validate` will use [egg-i18n](https://github.com/eggjs/egg-i18n) as `optionalDependencies`
- change [Parameter](https://github.com/node-modules/parameter)'s `translate` to `ctx.gettext` which provide by `egg-i8n`
### rule file
- auto load `app/validate/**/*.js`, and register to `app.validator.addRule(type, fn)`
Contributor guide
Assessment
This issue has not been assessed yet.