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 reference/react/useInsertionEffect into Chinese #1166

Merged

Conversation

NewVo1d
Copy link
Contributor

@NewVo1d NewVo1d commented May 11, 2023

reference/react/useInsertionEffect 已翻译完成,辛苦review
@QC-L @Yucohny @awxiaoxian2020

@github-actions
Copy link

github-actions bot commented May 11, 2023

Size changes

📦 Next.js Bundle Analysis for react-dev

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

src/content/reference/react/useInsertionEffect.md Outdated Show resolved Hide resolved
src/content/reference/react/useInsertionEffect.md Outdated Show resolved Hide resolved
src/content/reference/react/useInsertionEffect.md Outdated Show resolved Hide resolved
src/content/reference/react/useInsertionEffect.md Outdated Show resolved Hide resolved
src/content/reference/react/useInsertionEffect.md Outdated Show resolved Hide resolved
src/content/reference/react/useInsertionEffect.md Outdated Show resolved Hide resolved
src/content/reference/react/useInsertionEffect.md Outdated Show resolved Hide resolved
@Yucohny
Copy link
Collaborator

Yucohny commented May 18, 2023

由于本篇文档主题原因,原文出现了大量 ”Effect“,而有的时候翻译为了”副作用“,有的时候保留了原文,因此除去 review 当中直接提及的,可以再多考虑本篇文档中对 ”Effect“ 的处理。

@NewVo1d
Copy link
Contributor Author

NewVo1d commented May 18, 2023

由于本篇文档主题原因,原文出现了大量 ”Effect“,而有的时候翻译为了”副作用“,有的时候保留了原文,因此除去 review 当中直接提及的,可以再多考虑本篇文档中对 ”Effect“ 的处理。

收到,辛苦校对

@NewVo1d
Copy link
Contributor Author

NewVo1d commented May 21, 2023

由于本篇文档主题原因,原文出现了大量 ”Effect“,而有的时候翻译为了”副作用“,有的时候保留了原文,因此除去 review 当中直接提及的,可以再多考虑本篇文档中对 ”Effect“ 的处理。

参考了 React 中文翻译指南 #2 后,我认为本文正文中出现的五次 Effect(包含 Effects)均应不翻译。

@NewVo1d
Copy link
Contributor Author

NewVo1d commented May 21, 2023

另外,对本文中部分用词进行了修改,辛苦再次校对。 @Yucohny

src/content/reference/react/useInsertionEffect.md Outdated Show resolved Hide resolved

* Effect 只在客户端上运行,在服务端渲染中不会运行。
* 你不能在 `useInsertionEffect` 内部更新 state。
* 在 `useInsertionEffect` 运行期间,refs 还没有附加,DOM 也还没有更新。
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
*`useInsertionEffect` 运行期间,refs 还没有附加,DOM 也还没有更新。
*`useInsertionEffect` 运行期间,ref 还没有附加,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
Contributor Author

Choose a reason for hiding this comment

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

当初翻译的时候,考虑如下:

  • ref 如果用于计算值的时候,使用 赋值 比较合适;
  • ref 如果用于 DOM 的时候,使用 赋值 感觉差点意思,故使用了 attach 的直译 附加

暂未想到对 attach 更好的表达方式,但是 赋值 并无不妥之处。如同意,我会将其改为 赋值

Copy link
Collaborator

Choose a reason for hiding this comment

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

可以考虑加个因果关系?类似于:因为 DOM 还没有更新,所以 ref 还没有被赋值。

Copy link
Collaborator

Choose a reason for hiding this comment

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

可以考虑加个因果关系?类似于:因为 DOM 还没有更新,所以 ref 还没有被赋值。

这个因果关系是确认的吗?

src/content/reference/react/useInsertionEffect.md Outdated Show resolved Hide resolved
src/content/reference/react/useInsertionEffect.md Outdated Show resolved Hide resolved
src/content/reference/react/useInsertionEffect.md Outdated Show resolved Hide resolved
src/content/reference/react/useInsertionEffect.md Outdated Show resolved Hide resolved
src/content/reference/react/useInsertionEffect.md Outdated Show resolved Hide resolved
src/content/reference/react/useInsertionEffect.md Outdated Show resolved Hide resolved
@Yucohny Yucohny merged commit b2679bf into reactjs:main Jun 16, 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.

3 participants