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-dom/hooks/index into Chinese #1347

Merged
merged 2 commits into from
Oct 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/content/reference/react-dom/hooks/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: "React DOM Hooks"

<Intro>

The `react-dom` package contains Hooks that are only supported for web applications (which run in the browser DOM environment). These Hooks are not supported in non-browser environments like iOS, Android, or Windows applications. If you are looking for Hooks that are supported in web browsers *and other environments* see [the React Hooks page](/reference/react). This page lists all the Hooks in the `react-dom` package.
`react-dom` 包含的 Hook 仅支持 web 应用程序,即在浏览器 DOM 环境中运行的应用程序。这些 Hook 不支持非浏览器环境,如 iOSAndroid Windows 应用程序。如果正在寻找在 web 浏览器以及其他环境中支持的 Hook,请参阅 [React Hooks 页面](/reference/react)。该页面列出了 `react-dom` 包中的所有 Hook。

</Intro>

Expand All @@ -14,14 +14,14 @@ The `react-dom` package contains Hooks that are only supported for web applicati

<Canary>

Form Hooks are currently only available in React's canary and experimental channels. Learn more about [React's release channels here](/community/versioning-policy#all-release-channels).
Form Hooks 目前仅在 React canary experimental 渠道中可用。在此处了解更多关于 [React 发布渠道](/community/versioning-policy#all-release-channels) 的信息。

</Canary>

*Forms* let you create interactive controls for submitting information. To manage forms in your components, use one of these Hooks:
**Form** 允许创建用于提交信息的交互式控件。要在组件中管理表单,请使用以下其中一个 Hook:

* [`useFormStatus`](/reference/react-dom/hooks/useFormStatus) allows you to make updates to the UI based on the status of the a form.
* `useFormState` allows you to manage state inside a form.
* [`useFormStatus`](/reference/react-dom/hooks/useFormStatus) 允许根据表单的状态更新用户界面。
Copy link
Collaborator

Choose a reason for hiding this comment

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

我现在觉得 allow 不翻译成“允许”会好一点,比如直接翻译成“可以”?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

可以,主要是之前的文档基本也都翻译为「允许」了。

* `useFormState` 允许管理表单内部的状态。

```js
function Form({ action }) {
Expand All @@ -41,7 +41,7 @@ function Button() {
const { pending } = useFormStatus();
return (
<button disabled={pending} type="submit">
Submit
提交
</button>
);
}
Expand Down
Loading