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 learn/removing-effect-dependencies into Chinese #1144

Merged
merged 18 commits into from
Jun 28, 2023

Conversation

creamidea
Copy link
Contributor

@creamidea creamidea commented Apr 28, 2023

@github-actions
Copy link

github-actions bot commented Apr 28, 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! 🙌

@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! 🙌

Copy link
Collaborator

@Yucohny Yucohny left a comment

Choose a reason for hiding this comment

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

请对照翻译规范自查一遍。

src/content/learn/removing-effect-dependencies.md Outdated Show resolved Hide resolved
src/content/learn/removing-effect-dependencies.md Outdated Show resolved Hide resolved
src/content/learn/removing-effect-dependencies.md Outdated Show resolved Hide resolved
// ...
}
```

[Effects "react" to reactive values.](/learn/lifecycle-of-reactive-effects#effects-react-to-reactive-values) Since `roomId` is a reactive value (it can change due to a re-render), the linter verifies that you've specified it as a dependency. If `roomId` receives a different value, React will re-synchronize your Effect. This ensures that the chat stays connected to the selected room and "reacts" to the dropdown:
[Effects “反应”响应式值](/learn/lifecycle-of-reactive-effects#effects-react-to-react-values) 因为这里的 `roomId` 是一个响应式值(它可能随重新渲染而改变),所以 linter 会验证你是否将它指定为一个依赖项。如果 `roomId` 变成不同的值,React 将重新运行你的 Effect。这可以确保聊天界面与所选房间保持一致,并把变化“反馈”给下拉菜单:
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
[Effects “反应”响应式值](/learn/lifecycle-of-reactive-effects#effects-react-to-react-values) 因为这里的 `roomId` 是一个响应式值(它可能随重新渲染而改变),所以 linter 会验证你是否将它指定为一个依赖项。如果 `roomId` 变成不同的值,React 将重新运行你的 Effect。这可以确保聊天界面与所选房间保持一致,并把变化“反馈”给下拉菜单:
[Effect “反应”响应式值](/learn/lifecycle-of-reactive-effects#effects-react-to-react-values) 因为这里的 `roomId` 是一个响应式值(它可能随重新渲染而改变),所以 linter 会验证你是否将它指定为一个依赖项。如果 `roomId` 变成不同的值,React 将重新运行你的 Effect。这可以确保聊天界面与所选房间保持一致,并把变化“反馈”给下拉菜单:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这里的意思是,Effects => Effect ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

是的

src/content/learn/removing-effect-dependencies.md Outdated Show resolved Hide resolved
@Yucohny Yucohny added the Pending Modify 已校对,待修改阶段 label Jun 20, 2023
@awxiaoxian2020
Copy link
Collaborator

注意到你删除了任务领取,你是否还想为这篇翻译作出贡献呢?

@Yucohny Yucohny closed this Jun 21, 2023
@creamidea
Copy link
Contributor Author

@awxiaoxian2020 我没有删除任务领取,不知道是哪里出错了。我按照 @Yucohny 的要求重新检查,再提交一下。

@awxiaoxian2020
Copy link
Collaborator

目前的问题是有重复的 PR。

@creamidea
Copy link
Contributor Author

creamidea commented Jun 24, 2023

目前的问题是有重复的 PR。

了解。不过当时我是在评论区留言,且在任务列表中出现明确分配开始翻译的。

image iShot_2023-06-24_13 30 01

我想大概是留言的隐藏机制,导致另一位作者没有搜索到,所以以为删除了🤔
image

src/content/learn/removing-effect-dependencies.md Outdated Show resolved Hide resolved
src/content/learn/removing-effect-dependencies.md Outdated Show resolved Hide resolved
src/content/learn/removing-effect-dependencies.md Outdated Show resolved Hide resolved
src/content/learn/removing-effect-dependencies.md Outdated Show resolved Hide resolved
src/content/learn/removing-effect-dependencies.md Outdated Show resolved Hide resolved
src/content/learn/removing-effect-dependencies.md Outdated Show resolved Hide resolved
src/content/learn/removing-effect-dependencies.md Outdated Show resolved Hide resolved
- 当你对依赖项不满意时,你需要编辑的是代码。
- 抑制 linter 会导致非常混乱的错误,你应该始终避免它。
- 要移除依赖项,你需要向 linter “证明”它不是必需的。
- 如果某些代码是响应特定交互,请将该代码移至事件处理部分。
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.

这里我改成:如果某些代码是为了响应特定交互,请将该代码移至事件处理的地方
请帮忙评估一下。

Copy link
Contributor

Choose a reason for hiding this comment

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

我觉得这样也挺好的,主要拗口的是前半句

src/content/learn/removing-effect-dependencies.md Outdated Show resolved Hide resolved
src/content/learn/removing-effect-dependencies.md Outdated Show resolved Hide resolved
@creamidea
Copy link
Contributor Author

中文翻译出现了许多“依赖列表”、“依赖关系”、“依赖项”以及“依赖”等等表述,但是有的时候对应的原文是一致的,此时建议翻译后的文本保持一致。 除此之外,建议再多琢磨一下有关表达,尽量让表达更加通顺。

此提议很好,我觉得可以将其都统一为“依赖”,请评估。

@creamidea
Copy link
Contributor Author

image

抱歉,这里使用了 force-push,之前是 merge 了 main 分支的代码吗?

@creamidea creamidea requested review from yionr and Yucohny June 28, 2023 07:26
@Yucohny
Copy link
Collaborator

Yucohny commented Jun 28, 2023

中文翻译出现了许多“依赖列表”、“依赖关系”、“依赖项”以及“依赖”等等表述,但是有的时候对应的原文是一致的,此时建议翻译后的文本保持一致。 除此之外,建议再多琢磨一下有关表达,尽量让表达更加通顺。

此提议很好,我觉得可以将其都统一为“依赖”,请评估。

可以的。

@Yucohny
Copy link
Collaborator

Yucohny commented Jun 28, 2023

image 抱歉,这里使用了 force-push,之前是 merge 了 main 分支的代码吗?

是的,与 main 分支保持同步。

@creamidea
Copy link
Contributor Author

image 抱歉,这里使用了 force-push,之前是 merge 了 main 分支的代码吗?

是的,与 main 分支保持同步。

了解,我现在点击了同步 main 的按钮。

@Yucohny Yucohny added Pending Review 已翻译,待校对阶段 and removed Pending Modify 已校对,待修改阶段 labels Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pending Review 已翻译,待校对阶段
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants