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

[Localization] Translations of files in locale\zh-cn\docs #1705

Merged
4 commits merged into from Aug 25, 2018
Merged

[Localization] Translations of files in locale\zh-cn\docs #1705

4 commits merged into from Aug 25, 2018

Conversation

ghost
Copy link

@ghost ghost commented Jun 19, 2018

Finished all the translations in the folders.

@ghost ghost changed the title Translations of files in locale\zh-cn\docs [Localization] Translations of files in locale\zh-cn\docs Jun 19, 2018
@fhemberger
Copy link
Contributor

@Maledong Could you please mention the translation team for review in your future PRs (see below)?

/cc @nodejs/nodejs-cn

@ghost
Copy link
Author

ghost commented Jun 19, 2018

@fhemberger :Because I haven't finished all of them yet, I don't want to call them.
My submit is based on folders with all of the files there.
But anyway for pre-reviewing is also OK with me:)

@laosb
Copy link

laosb commented Jun 20, 2018

@Maledong : At least feel free to ping me alone when you finish a piece of doc, since in the l10n group no one are actually working full time reviewing PRs. It's better to "submit one, review one", at least for me I would put off reviewing a long multiple-file PR. (maybe forever before I visit that PR again)

@ghost
Copy link
Author

ghost commented Jun 22, 2018

@laosb : OK, I'll submit one by one if I have free time.
Thanks all!

Copy link

@laosb laosb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finish reviewing es6.md. And I've suggested you should avoid splitting Chinese paragraph into multiple lines to avoid extra spaces.

Btw, I'm having my final exams for this semester. I will be back reviewing you great PR after July 5.


## 默认情况下什么特性随着 Node.js一起发布?

此网站 [node.green](http://node.green) 提供了非常完整、几乎涵盖了不同版本的 Node.js 中所支持的ECMAScript特性。它基于 kangax 的兼容性对照表构建。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing 此网站 sounds better. And please remember to do CW-spacing.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed


## 我有我自己的基本框架,可以平衡 --harmony,所以我可以移除这个标记吗?

目前来说,`--harmony` 在 Node.js 的作用是让 **staged** 特性起作用。它本质上等同于 `--es_staging`。如上所述,有些特性尚未完全确认是稳定的,所以如果你希望一个安全的环境(尤其是在发布环境),你应该考虑移除这个运行时的环境标记,直到它在 V8 中以默认形式发布,或者在 Node.js 中落地。如果你开启了这个开关,你应该有对未来 Node.js 升级而造成代码破坏(无法正常工作)的准备,如果 V8 引擎做了更改,它的语义变得更接近标准的话。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你应该有对未来 Node.js 升级而造成代码破坏(无法正常工作)的准备,如果 V8 引擎做了更改,它的语义变得更接近标准的话。

你应该有对未来 Node.js 升级而造成代码破坏(无法正常工作)的准备,比如 V8 引擎做了更改,它的语法变得更接近标准。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed


# 一次 HTTP 传输解析

本指南的宗旨将让你对 HTTP 传输处理有一个清晰完整的了解。在不考虑特定编程语言及开发环境
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Splitting a Chinese paragraph to multiple lines would result in extra spaces between characters. Please put them to one line.

Copy link
Author

@ghost ghost Jun 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using Visual Studio Code, and it seems I didn't split them into multiple lines……?

Plz have a view of https://github.com/Maledong/nodejs.org/blob/790f8d2ca03796de5347d5a53737708681b5887a/locale/zh-cn/docs/guides/anatomy-of-an-http-transaction.md.

This is just ONLY the show differences:)
请注意:VSC,GitHub预览页面显示的单行文本长度不同的。所以请直接看我给你的连接为准,谢谢!因为不同文本编辑器文本长度可以调节。

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Maledong it’s clear if you see line numbers ;) And actually you could see extra spaces in sentences, with the link you provided.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Maledong This is a must-fix.

本指南的宗旨将让你对 HTTP 传输处理有一个清晰完整的了解。在不考虑特定编程语言及开发环境
下,我们假设你已经知道在一般情况下 HTTP 是如何进行工作的。我们同样假定你熟悉一些
关于 Node.js 的东西 [`EventEmitters`][] 和 [`Streams`][]。当然,如果你确实不了解它
们,我们非常建议你把以上列出的内容快速而完整的阅读一遍。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

非常建议

强烈建议

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK。这并不是自动换行。这是批注的GitHub自动预览时候产生效果。请对比:
default

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@ghost
Copy link
Author

ghost commented Jun 25, 2018

@fhemberger : What does here one mean in buffer-constructor-deprecation.md? Is there anything missing here?

This is useful if you create Buffer instances in only a few places (**e.g. one**)

@fhemberger
Copy link
Contributor

@Maledong I guess it means if you just need one instance … 🤔

@ghost
Copy link
Author

ghost commented Jun 25, 2018

OK. I thought you were trying to write something but later you didn't continue doing that before submitting... OK. Thanks anyway!

BTW: My accout is somehow invalid by GitHub, so I removed my email accout and use a new one instead. So don't be feeling curious about why my icons are something like this following:

default

@ghost
Copy link
Author

ghost commented Jun 30, 2018

@laosb:I've finished all the translations in this folder. You can check them all if you have free time.

@laosb
Copy link

laosb commented Jul 4, 2018

@Maledong: Well done, I will start reviewing today since I finish all my exams this semester.

Copy link

@laosb laosb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

anatomy-of-an-http-transaction Reviewed.


# 一次 HTTP 传输解析

本指南的宗旨将让你对 HTTP 传输处理有一个清晰完整的了解。在不考虑特定编程语言及开发环境
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Maledong This is a must-fix.


本指南的宗旨将让你对 HTTP 传输处理有一个清晰完整的了解。在不考虑特定编程语言及开发环境
下,我们假设你已经知道在一般情况下 HTTP 是如何进行工作的。我们同样假定你熟悉一些
关于 Node.js 的东西 [`EventEmitters`][] 和 [`Streams`][]。当然,如果你确实不了解它
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我们同样假定你熟悉一些关于 Node.js 的东西 [EventEmitters][] 和 [Streams][]

我们同样假定你熟悉 Node.js 的 [EventEmitters][] 和 [Streams][]

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok


## 创建一个后台服务

任何网络服务应用程序,从某种程度而言,总是要先创建一个服务对象。这在 Node.js 中通常通过 [`createServer`][] 方法。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原文 Any node web server application will at some point have to create a web server object.

在此处 at some point 应当翻译为「总是」「总归」。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

});
```

每当有 HTTP 发出请求到达服务器时,[`createServer`][] 中传入的函数就被自动执行。所以这个
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

发出请求 =》 请求

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

```

每当有 HTTP 发出请求到达服务器时,[`createServer`][] 中传入的函数就被自动执行。所以这个
函数也被称为是请求处理函数。实际上,由 [`createServer`][] 创造返回的 [`Server`][] 对象
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

创造 =》 构造函数

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

```

当一个 HTTP 到达服务端,node 调用 request 处理程序,并产生一些唾手可得的对象用以处理传输,
这些对象就是 `request` 和 `response`。我们很快就可以得到他们。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll get to those shortly. 意为「我们马上会讲到。」

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

当一个 HTTP 到达服务端,node 调用 request 处理程序,并产生一些唾手可得的对象用以处理传输,
这些对象就是 `request` 和 `response`。我们很快就可以得到他们。

实际上,为了处理请求,[`listen`][] 方法需要在 `server` 对象上被显示调用。在大多数情况下,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

显示调用 =》 显式调用

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

这里的 `method` 总是一个普通的 HTTP 方法动作行为 (verb),`url` 是指没有服务器协议和
端口号的完整访问地址。一个典型的访问地址通常意味着包括第三个斜杠以及后面的所有内容。

消息头也不是很难得到,它们也在 `request` 对象里,称为 `headers`。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I bet 消息头 is widely known as "请求头"?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK


## 服务器响应的示例代码

让我们简化之前代码来做一个可以简单有响应的服务端,它同样也可以把接受到的任何信息返回给客户端。我们所要做的就是从请求流中把请求数据取出,然后原样写回到返回流中即可。就如我们之前做的那么简单。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

让我们简化之前代码来做一个可以简单有响应的服务端

让我们简化之前的代码,做一个可以有响应的简单的服务端

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

}).listen(8080);
```

现在让我们调整一下,我们只接受以下条件接受应答:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我们只对以下条件应答

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@ghost ghost self-assigned this Jul 9, 2018
```

当一个 HTTP 到达服务端,node 调用 request 处理程序,并产生一些唾手可得的对象用以处理传输,
这些对象就是 `request` 和 `response`。我们马上会讲到。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still, don't split into 2 lines.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

layout: docs.hbs
---

# 数据流中的背压问题
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right on Line 2. It's better worded as 积压.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix all related translations


为解决这个问题,必须存在一种适当的代理机制,确保流从一个源流入另外一个的时候是平滑顺畅的。不同的社区组织针对他们各自的问题单独做了解决,好例子比如 Unix 的管道和 TCP 的 Socket。此问题经常与 _流控制_ 相关。在 Node.js 中,流已经是被采纳的解决方案。

此文的目的在于详细深入介绍什么是背压,并从代码角度详细解释在 Node.js 中,流是如何针对此问题进行处理的。本文的第二部分将对你在实现流的功能时给予最佳实战经验,以确保你的程序既安全又精简。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

本文的第二部分将给予你实现流的功能时最佳实践,以确保你的程序既安全又精简

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed


此文的目的在于详细深入介绍什么是背压,并从代码角度详细解释在 Node.js 中,流是如何针对此问题进行处理的。本文的第二部分将对你在实现流的功能时给予最佳实战经验,以确保你的程序既安全又精简。

我们假定你对 Node.js 中的 [`背压`][],[`缓存`][],[`事件发射器`][] 和 [`流`][] 的基本概念有一点了解。如果你尚未完整阅读过 API 文档,那么最好是先看一下相关 API 说明,它也会有助于你扩展理解本文的主旨。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In most cases we keep the originals of EventEmitter, Streams, etc.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if this is related to some node API or module function names, it shouldn't be translated. However if it's related to some explainations. I suggest translations needed. So I changed part of them.

@ghost ghost requested a review from willin July 16, 2018 03:53

特性优化的工作也随着 ES2015 到来,以上计划是通过 [执行计划](https://docs.google.com/document/d/1EA9EbfnydAmmU_lM8R_uEMQ-U_v4l9zulePSBkeYWmY),有一个 V8 团队在那儿收集整理相关信息,并协调需要提高性能、设计追踪问题的文稿等部门。

## 我有我自己的基本框架,可以平衡 --harmony,所以我可以移除这个标记吗?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have my infrastructure set up to leverage the --harmony flag. Should I remove it?
I think 'leverage' means '利用' in here

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed


## 阻塞

**阻塞** 是说 Node.js 中其它的 JavaScript 命令必须等到一个非 JavaScript 操作完成之后才可以执行。这是因为当 **阻塞** 发生时,事件机制无法继续运行JavaSCript。

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JavaSCript => JavaScript

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed


### zlib

为了快速压缩解压,Node.js 依赖与工业标准的 zlib 类库。同名可知的还有 gzip 和 libpng。Node.js 使用 zlib 创建同步、异步和数据流压缩、解压缩接口。

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

依赖与

依赖于

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@ghost ghost removed the request for review from willin July 19, 2018 02:53
@ghost
Copy link
Author

ghost commented Aug 1, 2018

It's been quite a long time……Anything left?

```javascript
const server = http.createServer();
server.on('request', (request, response) => {
// the same kind of magic happens here!
Copy link
Contributor

@willin willin Aug 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments in codes should also be translated

Copy link
Author

@ghost ghost Aug 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I strongly suggest that comments shouldn't be translated but to keep original.
No translate books will translate comments from one language to another, which is a default rule.

});
```

> **注意:** 或许你感到这样做有些枯燥乏味,不过大多数情况下你算是幸运的。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这句是谷歌翻译的吗?

This may seem a tad tedious, and in many cases, it is. 

Luckily, there are modules like concat-stream and body on npm which can help hide away some of this logic. 

这看起来有些单调乏味,大多数情况下也确实是这样。不过庆幸的是,npm上有…… blabla

Copy link
Author

@ghost ghost Aug 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. It's all translated by myself.
And I'll update according to what you said.

}).listen(8080); // Activates this server, listening on port 8080.
```

如果我们运行这个示例代码,我们只能 *接收* 到请求但得不到 *回应*。实际上,如果你在浏览器内运行这个示例,你的请求只会超时,因为服务器那边根本没有返回给客户端任何东西。
Copy link
Contributor

@willin willin Aug 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

param names should not be translated, or translate with comment notes.

Copy link
Author

@ghost ghost Aug 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Sorry but I have to say that I disagree with you on the point.

Notice that this just emphises what we do in a verb——Here request and response is the verb of the whole sentence instead of a snippet of codes. If you translate this like '我们只能 request 到请求……'.——Where's the predicate in Chinese?

@ghost
Copy link
Author

ghost commented Aug 12, 2018

@laosb : Sorry to interrupt:Have you reviewed all of them?

@laosb
Copy link

laosb commented Aug 12, 2018

I'm terribly sorry for not continue to review this PR, it's quite a lot of work for me and I'm always have something other to do - so in general if you get 2 native language users' LGTM the pr should be good to enough for merging. I'm kind of perfectist so you don't have to wait for only me, go ahead if you won 1 more LGTM - Thank you for your kindly contribution!

@ghost
Copy link
Author

ghost commented Aug 25, 2018

Well……Since this has been lasting for quite a long time and it seems we have no time have a review again. After having a review by myself again I don't think it will cause a big problem. So I'll merge it and later we can fix the translation problem as well. Hope you all can understand.

@ghost ghost merged commit ceb5d09 into nodejs:master Aug 25, 2018
This pull request was closed.
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

Successfully merging this pull request may close these issues.

4 participants