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

Translation of 'functional updater form' #612

Merged
merged 2 commits into from
Mar 5, 2020
Merged

Conversation

ychi
Copy link

@ychi ychi commented Mar 2, 2020

Hi there,

I happen to notice there might be a better way to translate 'functional form updater' to zh-tw.

'Form' as in 'essays in book form'; instead of form as in 'filling in a form.'
Also this translation aligns with react doc (https://zh-hant.reactjs.org/docs/hooks-reference.html#functional-updates) better :)

'Form' as in 'essays in book form'; instead of form as in 'filling in a form.'
Also this translation aligns with react doc (https://zh-hant.reactjs.org/docs/hooks-reference.html#functional-updates) better :)
@vercel
Copy link

vercel bot commented Mar 2, 2020

This pull request is being automatically deployed with ZEIT Now (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://zeit.co/gaearon/overreactedio/nf64qd0ox
✅ Preview: https://overreactedio-git-fork-ychi-patch-1.gaearon.now.sh

@ychi
Copy link
Author

ychi commented Mar 2, 2020

Hi @eyeccc can you help review my proposed change? Thank you 🙏

@@ -979,7 +979,7 @@ function Counter() {
}, [count]);
```

為了做到這樣,我們需要問問我們自己:**我們為了什麼使用 `count` 呢?**看起來我們只為了呼叫 `setCount` 而用它。在這樣的情況下,我們並不真的需要 `count`。當我們想要根據前一次的 state 來更新現在的 state,我們可以使用 `setState` 的 [函式更新表單(functional updater form)](https://reactjs.org/docs/hooks-reference.html#functional-updates):
為了做到這樣,我們需要問問我們自己:**我們為了什麼使用 `count` 呢?**看起來我們只為了呼叫 `setCount` 而用它。在這樣的情況下,我們並不真的需要 `count`。當我們想要根據前一次的 state 來更新現在的 state,我們可以使用 `setState` 的 [函數形式的更新器(functional updater form)](https://reactjs.org/docs/hooks-reference.html#functional-updates):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hey. Thanks for noticing my wrong translation.
I think maybe we can use 函數式更新形式 to align with the React document?

Ref:

「+」和「-」按鈕使用了函數式形式
The ”+” and ”-” buttons use the functional form

Copy link
Author

Choose a reason for hiding this comment

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

"函數式" + "更新形式" sounds a bit redundant, how about "函數形式的更新" or "函數式更新法"?

Copy link
Collaborator

Choose a reason for hiding this comment

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

"函數形式的更新" sounds good!

@ychi
Copy link
Author

ychi commented Mar 3, 2020

And just noticed there is also

這個「更新表單」也對其他情況有幫助

How about "這個形式的更新也對其他情況有幫助" or "這種更新的方式也對其他情況有幫助"

@eyeccc
Copy link
Collaborator

eyeccc commented Mar 4, 2020

And just noticed there is also

這個「更新表單」也對其他情況有幫助

How about "這個形式的更新也對其他情況有幫助" or "這種更新的方式也對其他情況有幫助"

"這種更新的方式也對其他情況有幫助" looks good. Thanks for catching that error.

@eyeccc eyeccc merged commit 94bcb38 into gaearon:master Mar 5, 2020
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.

2 participants