Skip to content

Commit 4b9ad60

Browse files
committed
improve readme translation for simplified chinese, fix typos
1 parent 8363d04 commit 4b9ad60

File tree

1 file changed

+10
-22
lines changed

1 file changed

+10
-22
lines changed

docs/README-zhcn.md

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
本工具通过以下三种方式为你(及你的团队)节省大量时间:
3131

3232
- **无须配置。** 史上最便捷的统一代码风格的方式,轻松拥有。
33-
- **自动的代码格式化** 只需运行 `standard --fix` 从此和脏乱差的代码说再见。
34-
- **提前发现风格及程序问题。** 减少代码审查时的反反复复修改过程,节约时间。
33+
- **自动代码格式化** 只需运行 `standard --fix` 从此和脏乱差的代码说再见。
34+
- **提前发现风格及程序问题。** 减少代码审查过程中反反复复的修改过程,节约时间。
3535

36-
无须犹豫。也不用维护 `.eslintrc`, `.jshintrc`, or `.jscsrc` 。开箱即用。
36+
无须犹豫。再也不用维护 `.eslintrc`, `.jshintrc`, or `.jscsrc` 。开箱即用。
3737

3838
安装:
3939

@@ -52,7 +52,7 @@ npm install standard --save-dev
5252
- [详情][4]
5353
- **关键字后加空格** `if (condition) { ... }`
5454
- **函数名后加空格** `function name (arg) { ... }`
55-
- 坚持使用全等 `===` 摒弃 `==` – 但在需要检查 `null || undefined` 时可以使用 `obj == null`
55+
- 坚持使用全等 `===` 摒弃 `==` 一但在需要检查 `null || undefined` 时可以使用 `obj == null`
5656
- 一定要处理 Node.js 中错误回调传递进来的 `err` 参数。
5757
- 使用浏览器全局变量时加上 `window` 前缀 – `document``navigator` 除外
5858
- 避免无意中使用到了这些命名看上去很普通的全局变量, `open`, `length`,
@@ -157,20 +157,15 @@ $ standard "src/util/**/*.js" "test/**/*.js"
157157

158158
## 为何要使用 JavaScript Standard 规范?
159159

160-
本规范特点之一是简洁。谁也不想为每个项目维护一分有成百上千行语句的代码风格配置文件。有此规范就够了。
160+
本规范特点之一是简洁。谁也不想为每个项目维护一份有成百上千行语句的代码风格配置文件。有此规范就够了。
161161

162162
本工具通过以下三种方式为你(及你的团队)节省大量时间:
163163

164164
- **无须配置。** 史上最便捷的统一代码风格的方式,轻松拥有。
165165
- **自动的代码格式化。** 只需运行 `standard --fix` 从此和脏乱差的代码说再见。
166166
- **提前发现风格及程序问题。** 减少代码审查时的反反复复修改过程,节约时间。
167167

168-
Adopting `standard` style means ranking the importance of code clarity and
169-
community conventions higher than personal style. This might not make sense for
170-
100% of projects and development cultures, however open source can be a hostile
171-
place for newbies. Setting up clear, automated contributor expectations makes a
172-
project healthier.
173-
一旦使用 `standard` 规范表明代码的简明性及社区的约定要高于个人的编码风格。这不一定100%适用于所有项目和从多的编程文化,但开源项目代码容易受到新手的影响。把规范讲明,严格执行对于项目的长远维护不无裨益。
168+
一旦使用 `standard` 规范表明代码的简明性及社区的约定要高于个人的编码风格。这不一定100%适用于所有项目和多元的编程文化,但开源项目代码容易受到新手的影响。把规范讲明,严格执行对于项目的长远维护不无裨益。
174169

175170
## 谁在用 JavaScript Standard 规范?
176171

@@ -196,8 +191,6 @@ project healthier.
196191

197192
除公司组织外,[很多个人](https://raw.githubusercontent.com/feross/standard-packages/master/all.json)也在项目中使用,这里就不一一罗列了。
198193

199-
`standard` is also the top-starred linter in GitHub's
200-
[Clean Code Linter](https://github.com/showcases/clean-code-linters) showcase.
201194
并且 `standard` 在 GitHub 的[代码检查类工具](https://github.com/showcases/clean-code-linters) 展示列表中也排名第一。
202195

203196
## 有现成的编辑器插件吗?
@@ -220,7 +213,7 @@ project healthier.
220213

221214
安装 **[linter-js-standard][atom-1]**
222215

223-
如果想要保存时自动格式化,还需安装 **[standard-formatter][atom-2]**。安装 **[standardjs-snippets][atom-3]** 可以获得 snippets。
216+
如果想要保存时自动格式化,还需安装 **[standard-formatter][atom-2]**。安装 **[standardjs-snippets][atom-3]** 可以获得 snippets 特性
224217

225218
[atom-1]: https://atom.io/packages/linter-js-standard
226219
[atom-2]: https://atom.io/packages/standard-formatter
@@ -317,14 +310,11 @@ WebStorm [最近宣布](https://blog.jetbrains.com/webstorm/2017/01/webstorm-201
317310

318311
`standard --fix` 可以修正大部分约定俗成的问题,但有些错误(譬如忘记了错误处理)只能手动去修复了。
319312

320-
To save you time, `standard` outputs the message "`Run standard --fix to
321-
automatically fix some problems`" when it detects problems that can be fixed
322-
automatically.
323313
为了使用方便,`standard` 会在检测到有能够自动被修复的问题的时候,给出相应的提示 "`运行 standard --fix 来自动修正一些问题`"。
324314

325315
## 如何排除某些文件?
326316

327-
`node_modules/`, `coverage/`, `vendor/`, `*.min.js`, `bundle.js` 这些目录,还有以 `.` 开头的文件(譬如 `.git/`)或者文件夹自动被排除在外。
317+
`node_modules/``coverage/``vendor/``*.min.js``bundle.js` 这些目录,还有以 `.` 开头的文件(譬如 `.git/`)或者文件夹自动被排除在外。
328318

329319
`.gitignore` 里配置的文件也会自动排除掉。
330320

@@ -343,7 +333,7 @@ automatically.
343333

344334
## 如何隐藏某类警告?
345335

346-
很少的情况下你需要绕开 `standard`,隐藏某些警告信息
336+
很少的情况下你需要绕开 `standard` 以隐藏某些警告信息
347337

348338
JavaScript Standard 代码规范底层使用的是 [ESLint](http://eslint.org/)。所以如果你想隐藏某些警告,方法和使用 ESLint 时一样。
349339

@@ -479,8 +469,6 @@ $ standard --env mocha
479469
/* eslint-env serviceworker */
480470
```
481471

482-
This lets `standard` (as well as humans reading your code) know that `self` is a
483-
global in web worker code.
484472
这样可以让 `standard` 知道 `self` 是 web worker 中的全局变量(同时也让人更容易看懂)。
485473

486474
## Markdown 或者 HTML 文件中的代码能检查到吗?
@@ -515,7 +503,7 @@ $ standard --plugin html '**/*.html'
515503

516504
## 有为 git 添加 `pre-commit` 钩子么?
517505

518-
很高兴你问了
506+
这个问题问得好
519507

520508
```sh
521509
#!/bin/sh

0 commit comments

Comments
 (0)