-
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 reference/react-dom/hooks/useFormState into Chinese #1367
Conversation
Size changes📦 Next.js Bundle Analysis for react-devThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
存在问题:
|
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.
Let's collectively think of how to translate "action", "server action", "form action" in a standardized manner
|
||
</Canary> | ||
|
||
<Intro> | ||
|
||
`useFormState` is a Hook that allows you to update state based on the result of a form action. | ||
`useFormState` 是一个可以让你根据某个 form action 的结果更新 State 的 Hook。 |
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.
form action 要看看怎么翻译:
- "form action" 本身作为术语保留
- 整体翻译
- form 翻译,action 理解为 Server Action 所以作为术语大写(另外,experimental_taintUniqueValue 文档里的 server action 是翻译了,我觉得可以不翻)
另外可以参考 MDN 中文的 form action 怎么翻译的
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.
在我的理解中 form action 表示的是 form 标签的 action 属性,或者也可以表达一个整体,所以我觉得如果要翻的话整体翻为表单动作或者表单操作会好一些
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.
不只是 form 标签的 action 属性,button 标签中的 formAction 属性也是这个意思,指代表单提交时的动作,我觉得可以翻为表单动作,或者直接不翻
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.
至于 server action ,我这个文件里也有server action相关的信息,和 form action 不同,我认为这里指代的其实是类似于调API这类的操作,说实话我一开始也没翻译这个,不过我看experimental_taintUniqueValue里翻了所以就跟着翻了
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.
@lony2003 烦请对照翻译规范自查格式~
@Yucohny 我已自查格式。烦请再次review。谢谢! |
其实对应也还有 client action 这个说法,这个说法应该是与 server action 对应提出来的。直接翻译就是「服务器/端操作」、「客户端操作」,但是感觉很怪。此处直接保留 client action 与 server action 感觉勉强能说得过去,action 作为「操作」的泛指。 |
我觉得这里的action更多的表示一个提交表单的动作或者说表示应该如何提交的这么一个方法。 根据MDN上 formaction 的描述
form action 指代的就是 form 的 action 属性或者 button 的 formaction 属性,所以这里翻译为「表单动作」或者不翻应该是比较好的选择。但我个人比较倾向于不翻译,毕竟 form action 学过 html 的人应该都会懂,但要是真翻译出来可能有的人就不是那么理解了。 当然 MDN 中的 form action 只是一个字符串,并没有支持一个函数,所以这里的定义也可能会不那么合理就是了。 |
1 is done at reactjs/react.dev#6417 and @lony2003 had made updates here accordingly. Regarding 2, I realized from https://react.dev/reference/react-dom/components/form#props that the Candidates include:
I personally prefer translating "action" as 操作 or 动作 so it makes sense when it's used separately (e.g. "the action"). |
form action(s) 就翻译为「表单动作」吧。 |
@lony2003 请自行处理一下最新的文件冲突。 |
@Yucohny form action 已改为「表单动作」,冲突已处理。 |
close #1363 .