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

docs(cn): translate content/docs/hooks-effect.md into Chinese #123

Merged
merged 52 commits into from Mar 26, 2019

Conversation

Crazydogs
Copy link
Contributor

content/docs/hooks-effect.md done.

@QC-L QC-L mentioned this pull request Feb 19, 2019
@netlify
Copy link

netlify bot commented Feb 19, 2019

Deploy preview for cn-reactjs ready!

Built with commit effe0de

https://deploy-preview-123--cn-reactjs.netlify.com

@QC-L QC-L added the Pending Review 已翻译,待校对阶段 label Feb 20, 2019
This snippet is based on the [counter example from the previous page](/docs/hooks-state.html), but we added a new feature to it: we set the document title to a custom message including the number of clicks.
这段代码是基于[上一页中的计数器示例](/docs/hooks-state.html)修改的,我们为计数器增加了一个小功能:将 document 的 title 设置为一句包含了点击次数的消息

数据获取,设置订阅以及手动更改 React 组件中的 DOM 都是副作用的示例。无论你之前是否将他们称为"副作用"(可能就是你想要的效果),应该都在组件中使用过了。
Copy link
Collaborator

@yesmeck yesmeck Feb 20, 2019

Choose a reason for hiding this comment

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

(or just "effects") 翻译错了,这是说 side effects 可以简称 effects。

其实括号里的内容可以不翻译直接去掉,因为中文里没有这样的简称。

Copy link
Contributor

Choose a reason for hiding this comment

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

数据获取 -> 获取数据,跟后面的“设置订阅”等保持同样的 动宾短语 结构是不是比较好

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这里我觉得它的原意就是有些解释 side effect 的 side 的感觉。这一页主要讲的是 effect hook,effect 在这里是一个单独的概念,而 side effect 是一个容易理解为“副作用”的短语。所以这里解释一下

Copy link
Collaborator

Choose a reason for hiding this comment

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

感觉确实没必要翻译这个"just 'effects'",这里的确是说有时候这些副作用就是我们的目的,但是这里翻成“想要的效果”太奇怪了...


This is because in many cases we want to perform the same side effect regardless of whether the component just mounted, or if it has been updated. Conceptually, we want it to happen after every render -- but React class components don't have a method like this. We could extract a separate method but we would still have to call it in two places.
这是因为很多情况下我们希望在组件加载和更新时执行同样的操作。从概念上说,我们希望它在每次渲染之后执行 ———— 但 React 的类定义组件没有提供这样的方法。即使我们提取出一个方法,我们还是要在两个地方调用它。
Copy link
Collaborator

Choose a reason for hiding this comment

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

side effect 应该是副作用

Copy link
Member

Choose a reason for hiding this comment

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

class 组件。FYI: #2

@netlify
Copy link

netlify bot commented Feb 26, 2019

Deploy preview for zh-hans-reactjs ready!

Built with commit 698dfe2

https://deploy-preview-123--zh-hans-reactjs.netlify.com

@netlify
Copy link

netlify bot commented Feb 26, 2019

Deploy preview for zh-hans-reactjs ready!

Built with commit effe0de

https://deploy-preview-123--zh-hans-reactjs.netlify.com

content/docs/hooks-effect.md Outdated Show resolved Hide resolved
content/docs/hooks-effect.md Outdated Show resolved Hide resolved
content/docs/hooks-effect.md Show resolved Hide resolved
content/docs/hooks-effect.md Outdated Show resolved Hide resolved
content/docs/hooks-effect.md Outdated Show resolved Hide resolved
content/docs/hooks-effect.md Outdated Show resolved Hide resolved
content/docs/hooks-effect.md Outdated Show resolved Hide resolved
content/docs/hooks-effect.md Outdated Show resolved Hide resolved
content/docs/hooks-effect.md Outdated Show resolved Hide resolved
content/docs/hooks-effect.md Outdated Show resolved Hide resolved
yuqingc and others added 14 commits March 17, 2019 16:05
Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>
Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>
Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>
Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>
Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>
Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>
Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>
Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>
Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>
Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>
Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>
Copy link
Collaborator

@zcfan zcfan left a comment

Choose a reason for hiding this comment

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

感谢造福群众~

content/docs/hooks-effect.md Outdated Show resolved Hide resolved
content/docs/hooks-effect.md Outdated Show resolved Hide resolved
content/docs/hooks-effect.md Outdated Show resolved Hide resolved
content/docs/hooks-effect.md Outdated Show resolved Hide resolved
content/docs/hooks-effect.md Outdated Show resolved Hide resolved
content/docs/hooks-effect.md Outdated Show resolved Hide resolved
content/docs/hooks-effect.md Outdated Show resolved Hide resolved
content/docs/hooks-effect.md Outdated Show resolved Hide resolved
content/docs/hooks-effect.md Outdated Show resolved Hide resolved
content/docs/hooks-effect.md Outdated Show resolved Hide resolved
zcfan and others added 5 commits March 22, 2019 10:11
Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>
Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>
Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>
Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>
Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>
content/docs/hooks-effect.md Outdated Show resolved Hide resolved
@QC-L
Copy link
Member

QC-L commented Mar 25, 2019

@Crazydogs

zcfan and others added 7 commits March 25, 2019 18:33
Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>
Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>
Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>
Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>
zcfan
zcfan previously approved these changes Mar 25, 2019
content/docs/hooks-effect.md Outdated Show resolved Hide resolved
content/docs/hooks-effect.md Outdated Show resolved Hide resolved
content/docs/hooks-effect.md Outdated Show resolved Hide resolved
content/docs/hooks-effect.md Outdated Show resolved Hide resolved
content/docs/hooks-effect.md Outdated Show resolved Hide resolved
content/docs/hooks-effect.md Outdated Show resolved Hide resolved
content/docs/hooks-effect.md Outdated Show resolved Hide resolved
yuqingc
yuqingc previously approved these changes Mar 26, 2019
content/docs/hooks-effect.md Outdated Show resolved Hide resolved
content/docs/hooks-effect.md Show resolved Hide resolved
content/docs/hooks-effect.md Show resolved Hide resolved
content/docs/hooks-effect.md Show resolved Hide resolved
Copy link
Member

@QC-L QC-L left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@yuqingc yuqingc left a comment

Choose a reason for hiding this comment

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

lgtm

@QC-L QC-L merged commit c415c77 into reactjs:master Mar 26, 2019
OhIAmFine pushed a commit to OhIAmFine/zh-hans.reactjs.org that referenced this pull request May 6, 2019
…s#123)

* 翻译了 effect hook 的前半部分

* hooks-effect 翻译完成

* Update hooks-effect.md

修改一些问题

* Update hooks-effect.md

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update hooks-effect.md

* Update hooks-effect.md

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update hooks-effect.md

quota

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update hooks-effect.md

* Update hooks-effect.md

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update hooks-effect.md

* docs:modify hooks-effect doc

* Update hooks-effect.md

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update content/docs/hooks-effect.md

Co-Authored-By: Crazydogs <crazydogazrael@gmail.com>

* Update hooks-effect.md

* Update hooks-effect.md

* Update hooks-effect.md

* Update hooks-effect.md

* Update hooks-effect.md

* Update hooks-effect.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pending Modify 已校对,待修改阶段
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants