Skip to content

Commit

Permalink
chore:Fix some typos in Chinese and English (#3514)
Browse files Browse the repository at this point in the history
  • Loading branch information
Maledong authored and atian25 committed Mar 5, 2019
1 parent 65bdd15 commit 2f2bd69
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion docs/source/en/intro/egg-and-koa.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fn().then(res => console.log(res)).catch(err => console.error(err.stack));

## Koa

> Koa is a new Web framework designed by the team behind Express, which aims to be a smaller, more expressive, and more robust foundation for Web applications and APIs.
> [Koa](https://koajs.com/) is a new Web framework designed by the team behind Express, which aims to be a smaller, more expressive, and more robust foundation for Web applications and APIs.
The design styles of Koa and Express are very similar, The underlying basic library is the same, [HTTP library](https://github.com/jshttp). There are several significant differences between them. Besides the asynchronous solution by default mentioned above, there are the following points.

Expand Down
3 changes: 2 additions & 1 deletion docs/source/en/style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ Developers are advised to use `egg-init --type=simple showcase` to generate and

## Classify

Old Style:

```js
// old style
module.exports = app => {
class UserService extends app.Service {
async list() {
Expand Down
14 changes: 7 additions & 7 deletions docs/source/en/tutorials/progressive.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ Codes refer to [step3/egg-ua](https://github.com/eggjs/examples/tree/master/pro
Then modify the application, details refer to [step3/example-app](https://github.com/eggjs/examples/tree/master/progressive/step3/example-app).

- Remove directory `lib/plugin/egg-ua`.
- declare dependencies `egg-ua` in `package.json`.
- change type to `package` in `config/plugin.js`.
- Declare dependencies `egg-ua` in `package.json`.
- Change type to `package` in `config/plugin.js`.

```js
// config/plugin.js
Expand Down Expand Up @@ -210,10 +210,10 @@ $ npm test
In conclusion, we can see how to make the framework evolution step by step which benefits from Egg's powerful plugin mechanism, code co-build, reusability and modularity.


- in general, put codes into `lib/plugin` if they can be reused in the application.
- separate it into a `node module` when plugin becomes stable.
- application with relatively reusable codes will work as a separate plugin.
- abstract it as framework to release after application become certain solutions of specified business scenario.
- it would be a great improvement in the efficiency of teamwork after plugins were extracted, modularized and finally became a framework, because other projects could reuse codes by just using `npm install`.
- In general, put codes into `lib/plugin` if they can be reused in the application.
- Separate it into a `node module` when plugin becomes stable.
- Application with relatively reusable codes will work as a separate plugin.
- Abstract it as framework to release after application become certain solutions of specified business scenario.
- It would be a great improvement in the efficiency of teamwork after plugins were extracted, modularized and finally became a framework, because other projects could reuse codes by just using `npm install`.

- **Note:Whether it's the application/plugin/framework, unittest is necessary and try to reach 100% coverage**
6 changes: 3 additions & 3 deletions docs/source/zh-cn/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: 常见问题

如果下面的内容无法解决你的问题,请查看 [Egg issues](https://github.com/eggjs/egg/issues)

## 如何高效的反馈问题
## 如何高效地反馈问题

感谢您向我们反馈问题。

Expand Down Expand Up @@ -85,8 +85,8 @@ Egg 内置的 [egg-security](https://github.com/eggjs/egg-security/) 插件默

没有自动重启的情况一般是在使用 Jetbrains 旗下软件(IntelliJ IDEA, WebStorm..),并且开启了 Safe Write 选项。

Jetbrains [Safe Write 文档](https://www.jetbrains.com/help/webstorm/2016.3/system-settings.html)中有提到:
Jetbrains [Safe Write 文档](https://www.jetbrains.com/help/webstorm/2016.3/system-settings.html)中有提到(翻译如下)

> If this check box is selected, a changed file is first saved in a temporary file. If the save operation succeeds, the file being saved is replaced with the saved file. (Technically, the original file is deleted and the temporary file is renamed.)
> 如果此复选框打钩,变更的文件将首先被存储在一个临时文件中。如果成功保存了该文件,那么就会被这个文件所取代(从技术上来说,原文件被删除,临时文件被重命名)。
由于使用了重命名导致文件监听的失效。解决办法是关掉 Safe Write 选项。(Settings | Appearance & Behavior | System Settings | Use "safe write" 路径可能根据版本有所不同)
2 changes: 1 addition & 1 deletion docs/source/zh-cn/intro/egg-and-koa.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fn().then(res => console.log(res)).catch(err => console.error(err.stack));

## Koa

> Koa is a new Web framework designed by the team behind Express, which aims to be a smaller, more expressive, and more robust foundation for Web applications and APIs.
> [Koa](https://koajs.com/) 是一个新的 web 框架,由 Express 幕后的原班人马打造, 致力于成为 web 应用和 API 开发领域中的一个更小、更富有表现力、更健壮的基石。
Koa 和 Express 的设计风格非常类似,底层也都是共用的[同一套 HTTP 基础库](https://github.com/jshttp),但是有几个显著的区别,除了上面提到的默认异步解决方案之外,主要的特点还有下面几个。

Expand Down
7 changes: 4 additions & 3 deletions docs/source/zh-cn/style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ title: 代码风格指南

建议开发者使用 `egg-init --type=simple showcase` 来生成并观察推荐的项目结构和配置。

## Classify
## 用类的形式呈现(Classify)

旧写法:

```js
// old style
module.exports = app => {
class UserService extends app.Service {
async list() {
Expand Down Expand Up @@ -42,7 +43,7 @@ module.export = Object.assign(egg, {
});
```

## Private property && Lazy Initialization
## 私有属性与慢初始化

- 私有属性用 `Symbol` 来挂载。
- Symbol 的描述遵循 jsdoc 的规则,描述映射后的类名+属性名。
Expand Down
4 changes: 2 additions & 2 deletions docs/source/zh-cn/tutorials/progressive.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ title: 渐进式开发
- `ctx.isAndroid`
- `ctx.isIOS`

通过之前的教程,大家一定可以很快的写出来,我们快速回顾下:
通过之前的教程,大家一定可以很快地写出来,我们快速回顾下:

对应的代码参见 [step1](https://github.com/eggjs/examples/tree/master/progressive/step1)

Expand Down Expand Up @@ -207,7 +207,7 @@ $ npm test

## 写在最后

综上所述,大家可以看到,我们是如何一步步渐进的去进行框架演进,得益于 Egg 强大的插件机制代码的共建,复用和下沉,竟然可以这么的无痛。
综上所述,大家可以看到我们是如何一步步渐进地去进行框架演进,这得益于 Egg 强大的插件机制代码的共建,以及复用和下沉,这些步骤竟然可以这么地无痛来得以完成!

- 一般来说,当应用中有可能会复用到的代码时,直接放到 `lib/plugin` 目录去,如例子中的 `egg-ua`
- 当该插件功能稳定后,即可独立出来作为一个 `node module`
Expand Down

0 comments on commit 2f2bd69

Please sign in to comment.