-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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/context.md into Chinese #87
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consume 的翻译需要和大家讨论,需要统一
Co-Authored-By: BetaMee <gongxq95@gmail.com>
Co-Authored-By: BetaMee <gongxq95@gmail.com>
Co-Authored-By: BetaMee <gongxq95@gmail.com>
Co-Authored-By: BetaMee <gongxq95@gmail.com>
Deploy preview for cn-reactjs ready! Built with commit f684ef3 |
Co-Authored-By: BetaMee <gongxq95@gmail.com>
Deploy preview for cn-reactjs ready! Built with commit 5814007 |
Deploy preview for cn-reactjs ready! Built with commit 41756fa |
Co-Authored-By: BetaMee <gongxq95@gmail.com>
Co-Authored-By: BetaMee <gongxq95@gmail.com>
Co-Authored-By: BetaMee <gongxq95@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review 了一部分,晚点继续
Co-Authored-By: BetaMee <gongxq95@gmail.com>
Co-Authored-By: BetaMee <gongxq95@gmail.com>
Co-Authored-By: BetaMee <gongxq95@gmail.com>
Co-Authored-By: BetaMee <gongxq95@gmail.com>
Co-Authored-By: BetaMee <gongxq95@gmail.com>
Co-Authored-By: BetaMee <gongxq95@gmail.com>
Co-Authored-By: BetaMee <gongxq95@gmail.com>
Co-Authored-By: BetaMee <gongxq95@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
除 consume 译法需统一外无其他问题。
content/docs/context.md
Outdated
} | ||
} | ||
MyClass.contextType = MyContext; | ||
``` | ||
|
||
The `contextType` property on a class can be assigned a Context object created by [`React.createContext()`](#reactcreatecontext). This lets you consume the nearest current value of that Context type using `this.context`. You can reference this in any of the lifecycle methods including the render function. | ||
挂载在 class 上的 `contextType` 属性会被重赋值为一个由 [`React.createContext()`](#reactcreatecontext) 创建的 Context 对象。这能让你使用 `this.context` 来获取最近 Context 上的那个值。你可以在任何生命周期中访问到它,包括 render 函数中。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consume 在这里被译为获取
@@ -31,7 +31,7 @@ function Layout() { | |||
); | |||
} | |||
|
|||
// A component may consume multiple contexts | |||
// 一个组件可能会调用多个 context |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consume 在这里被译为调用
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
统一翻译成消费不好么,在事件模型里,不是有生产者/消费者模式么,也是用的这个词。使用/调用/获取都有对应的词了。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BetaMee 来讨论一下以便于快点merge啦
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maicss “一个组件可能会消费多个 context”、“这能让你使用 this.context
来消费最近 Context 上的那个值。”
Co-Authored-By: BetaMee <gongxq95@gmail.com>
Co-Authored-By: BetaMee <gongxq95@gmail.com>
Co-Authored-By: BetaMee <gongxq95@gmail.com>
Co-Authored-By: BetaMee <gongxq95@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.