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/strict-mode.md into Chinese #165

Merged
merged 5 commits into from
Apr 13, 2019

Conversation

fonkie
Copy link
Collaborator

@fonkie fonkie commented Mar 10, 2019

No description provided.

@fonkie fonkie mentioned this pull request Mar 10, 2019
@netlify
Copy link

netlify bot commented Mar 10, 2019

Deploy preview for cn-reactjs ready!

Built with commit 1374d39

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

@netlify
Copy link

netlify bot commented Mar 10, 2019

Deploy preview for zh-hans-reactjs ready!

Built with commit 1374d39

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

@QC-L QC-L added the Pending Review 已翻译,待校对阶段 label Mar 11, 2019

Previously, React provided two ways for managing refs: the legacy string ref API and the callback API. Although the string ref API was the more convenient of the two, it had [several downsides](https://github.com/facebook/react/issues/1373) and so our official recommendation was to [use the callback form instead](/docs/refs-and-the-dom.html#legacy-api-string-refs).
以前,React 提供了两种方法管理 ref:过时字符串 ref API 和回调 API。 尽管字符串 ref API 在两者中使用更方便,但是它有 [一些缺点](https://github.com/facebook/react/issues/1373), 因此我们官方推荐 [使用回调方式](/docs/refs-and-the-dom.html#legacy-api-string-refs)
Copy link
Collaborator

Choose a reason for hiding this comment

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

“回调“ -> ”回调函数“

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

callback 在glossary词汇表里面确实是翻译成“回调函数”,刚开始我也是这么翻译的,但多念几遍之后,就默默的把“函数”去掉了。这里我重新加回去吧


You can instead make this explicit by pass a ref to your custom component and pass that along to the DOM using [ref forwarding](/docs/forwarding-refs.html#forwarding-refs-to-dom-components).
你可以通过将 ref 传递给自定义组件并使用 [ref 转发](/docs/forwarding-refs.html#forwarding-refs-to-dom-components) 来将其传递给 DOM 节点。
Copy link
Collaborator

Choose a reason for hiding this comment

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

”转发“还是”传递“比较好?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

这个forward貌似很多地方都出现了,有些地方翻译成“转发”,有些地方翻译成“传递”,还有些地方翻译成“转递”,再听听各位意见


Strict mode can't automatically detect side effects for you, but it can help you spot them by making them a little more deterministic. This is done by intentionally double-invoking the following methods:
严格模式不能自动检测到你的副作用,但它可以帮助你发现它们,使它们更具确定性。这是通过故意双重调用以下方法来完成的:
Copy link
Collaborator

Choose a reason for hiding this comment

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

”双重“ 总感觉有点怪。”重复“?或者”两次“?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

double-invoking 我最刚开始翻译成“两次调用”,然后想想,改成了双重调用;其实翻译成“重复调用”放到句子里面最通顺的,但总觉得double应该是“双”或者“二”的意思,翻译经验不多,再听听各位的意见


### Detecting legacy context API {#detecting-legacy-context-api}
通过故意双重调用方法(如组件的构造函数),严格模式使得这样的情况更容易被发现。
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

收到,我去群里再问问大家意见,之前有咨询过,争取今天把所有问题修复完成

@cyan33
Copy link
Collaborator

cyan33 commented Mar 13, 2019

This looks to me a solid translation. Thanks for your contribution! @fonkie 👍

cc @QC-L @hijiangtao

content/docs/strict-mode.md Outdated Show resolved Hide resolved
@QC-L QC-L changed the title Translate Advanced Guides Strict Mode to Chinese docs(cn): translate content/docs/strict-mode.md into Chinese Apr 13, 2019
@QC-L QC-L merged commit 5ba719c into reactjs:master Apr 13, 2019
OhIAmFine pushed a commit to OhIAmFine/zh-hans.reactjs.org that referenced this pull request May 6, 2019
@awxiaoxian2020 awxiaoxian2020 removed the Pending Review 已翻译,待校对阶段 label Feb 23, 2023
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.

5 participants