-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
框架本身以及官方插件国际化问题 #589
Comments
框架可以默认支持国际化,框架使用配置的文案,然后可以被应用覆盖和添加其他语言的文案。 |
内置 另一种思路是提供 |
@atian25 我感觉也是提供一个类似app.throw的方法可以定制,比如
|
|
现在是内置的吧 |
所有的文案都改成 |
嗯 |
这个问题的结论是不是修改下 egg-multipart 就 OK 了? |
好像比较麻烦,要
|
还好吧,规定一个前缀规则,然后每个插件遇到改改就好了。 |
对的,框架本身、任意插件、中间件都按照egg制定的国际化规范(也就是egg-i18n插件的用法)改改就好了。 |
我提交了一个 PR ,在初始化 parameter 的时候使用 egg 自己的 i18n 功能来配置 parameter 实现国际化。 |
@runfan url 贴上来 |
https://github.com/runfan/egg-validate 这是我的 fork 版本 |
先关掉了,一般来说底层抛出的异常,绝大部分是 500,不应该让客户感知到,绝少数的 40x 异常(例如 body 太长)单独处理吧 |
egg框架本身以及官方插件(比如这里的egg-multipart)代码中,抛出的一些异常信息,默认是英文,比如:
![image](https://cloud.githubusercontent.com/assets/3336443/23990584/7f04bcba-0a71-11e7-8098-f6864bc3d7e9.png)
类似于这种异常提示信息,若不在框架或插件层面国际化,在应用代码中就不大好国际化
The text was updated successfully, but these errors were encountered: