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

Translated - Lifting State Up #30

Closed
wants to merge 24 commits into from

Conversation

SambhavSacheti
Copy link

@SambhavSacheti SambhavSacheti commented Apr 13, 2019

  • Lifting State Up
  • Adding a Second Input
  • Writing Conversion Functions
  • Lifting State Up
  • Lessons Learned

@netlify
Copy link

netlify bot commented Apr 13, 2019

Deploy preview for hi-reactjs ready!

Built with commit 77df3fd

https://deploy-preview-30--hi-reactjs.netlify.com

Copy link
Member

@arshadkazmi42 arshadkazmi42 left a comment

Choose a reason for hiding this comment

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

Awesome work. Great work at the translation, I didn't found much of translation related issue. One of the best translation I have seen.
There are a couple of syntax issues which I have reported, once you are done with fixing those, it will be good to go from my end.
Also, do read #23 which has our review process

content/docs/lifting-state-up.md Outdated Show resolved Hide resolved
content/docs/lifting-state-up.md Outdated Show resolved Hide resolved
content/docs/lifting-state-up.md Outdated Show resolved Hide resolved
content/docs/lifting-state-up.md Outdated Show resolved Hide resolved
content/docs/lifting-state-up.md Outdated Show resolved Hide resolved
content/docs/lifting-state-up.md Outdated Show resolved Hide resolved
content/docs/lifting-state-up.md Outdated Show resolved Hide resolved
content/docs/lifting-state-up.md Outdated Show resolved Hide resolved
content/docs/lifting-state-up.md Outdated Show resolved Hide resolved
content/docs/lifting-state-up.md Outdated Show resolved Hide resolved
Copy link
Member

@arshadkazmi42 arshadkazmi42 left a comment

Choose a reason for hiding this comment

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

Great work. Its good to go from my end.
For the next steps, we will have the second phase of review, which will be done by @saranshkataria
Thank you for working on this

@saranshkataria
Copy link
Member

added comments till line 171

@SambhavSacheti
Copy link
Author

@saranshkataria I have made changes as per your comments.

@SambhavSacheti
Copy link
Author

Hi @saranshkataria please let me know when you have reviewed the rest of the file.


In React, sharing state is accomplished by moving it up to the closest common ancestor of the components that need it. This is called "lifting state up". We will remove the local state from the `TemperatureInput` and move it into the `Calculator` instead.
React में, state साझाकरण का कार्य उसे कौम्पोनॅन्टस के निकटतम सामान्य पूर्वज तक ले जाकर पूरा किया जाता है। यह "लिफ्टिंग स्टेट अप" कहलाता है। हम लोकल स्टेट को `TemperatureInput` से हटा देंगे एवं `Calculator` में ले जायेंगे।
Copy link
Member

Choose a reason for hiding this comment

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

साझाकरण -> too complex?

Copy link
Member

Choose a reason for hiding this comment

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

revisit line gramatically too

Copy link
Member

Choose a reason for hiding this comment

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

साझा is too complex, this still has not been resolved


If the `Calculator` owns the shared state, it becomes the "source of truth" for the current temperature in both inputs. It can instruct them both to have values that are consistent with each other. Since the props of both `TemperatureInput` components are coming from the same parent `Calculator` component, the two inputs will always be in sync.
यदि साझा स्टेट का मालिक `Calculator` हे, तो वह दोनों इन्पुट्स में वर्तमान तापमान के लिए "सत्य का स्रोत" बन जाता है। यह उन दोनों को एक दूसरे के अनुरूप वैल्यूज रखने का निर्देश दे सकता है। चूंकि दोनों `TemperatureInput` कौम्पोनॅन्टस के props एक ही `Calculator` पैरेंट कौम्पोनॅन्ट से हैं, यह दोनों हमेशा sync में रहेंगे।
Copy link
Member

Choose a reason for hiding this comment

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

साझा स्टेट -> better wording

Copy link
Member

Choose a reason for hiding this comment

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

should we translate source of truth?

Copy link
Author

Choose a reason for hiding this comment

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

साझा स्टेट -> better wording

Hi Saransh - I am out of ideas to replace साझा स्टेट. Could you please advise?

Copy link
Author

Choose a reason for hiding this comment

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

should we translate source of truth?

सत्य का स्रोत is better than सोर्स ऑफ़ ट्रुथ ! What do you think? Should I just revert it back to 'source of truth' ?

Copy link
Member

Choose a reason for hiding this comment

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

सत्य का स्रोत sounds better

@saranshkataria
Copy link
Member

done till line 202

@arshadkazmi42
Copy link
Member

@SambhavSacheti Any updates on this? Let us know if you need any help with this.

@SambhavSacheti
Copy link
Author

@SambhavSacheti Any updates on this? Let us know if you need any help with this.

Hi @arshadkazmi42 , Just saw your message. Will work on this and get back soon.

@arshadkazmi42
Copy link
Member

@SambhavSacheti Any updates on this? Let us know if you need any help with this.

Hi @arshadkazmi42 , Just saw your message. Will work on this and get back soon.

Cool. Thanks

@saranshkataria
Copy link
Member

@SambhavSacheti any updates?

@SambhavSacheti
Copy link
Author

SambhavSacheti commented Jul 2, 2019

@SambhavSacheti any updates?

I got distracted with other things. Please check now.

content/docs/lifting-state-up.md Outdated Show resolved Hide resolved
content/docs/lifting-state-up.md Outdated Show resolved Hide resolved

We will store the current input's `temperature` and `scale` in its local state. This is the state we "lifted up" from the inputs, and it will serve as the "source of truth" for both of them. It is the minimal representation of all the data we need to know in order to render both inputs.
हम वर्तमान इनपुट के `temperature` और `scale` को उसके लोकल state में जमा करेंगे। यह वही state है जिसे हमने इनपुट्स से "ऊपर उठा लिया", और यह उन दोनों के लिए "सत्य का एक स्रोत" के रूप में काम करेगी। यह दोनों इनपुट्स को रेंडर करने के लिए हमारे द्वारा आवश्यक सभी डेटा का न्यूनतम प्रतिनिधित्व है।
Copy link
Member

Choose a reason for hiding this comment

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

जमा करेंगे does not seem to be the right translation

Copy link
Member

Choose a reason for hiding this comment

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

ऊपर उठा लिया tha

Copy link
Member

Choose a reason for hiding this comment

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

सत्य का एक स्रोत -> सत्य ke स्रोत

Copy link
Member

Choose a reason for hiding this comment

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

यह दोनों इनपुट्स को रेंडर करने के लिए हमारे द्वारा आवश्यक सभी डेटा का न्यूनतम प्रतिनिधित्व है। -> revisit once

Copy link
Author

Choose a reason for hiding this comment

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

done

Copy link
Member

Choose a reason for hiding this comment

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

यह उन सभी डेटा का न्यूनतम प्रतिनिधित्व है जिन्हें हमें जानना आवश्यक है, दोनों इनपुट को रेंडर करने के लिए| could be reordered a bit to make better sense

content/docs/lifting-state-up.md Outdated Show resolved Hide resolved
content/docs/lifting-state-up.md Outdated Show resolved Hide resolved
@arshadkazmi42
Copy link
Member

@SambhavSacheti Any updates on this? let us know if you need any help

@SambhavSacheti
Copy link
Author

this? let us know

Will work today.

@saranshkataria
Copy link
Member

@SambhavSacheti any updates on this?

@SambhavSacheti
Copy link
Author

@SambhavSacheti any updates on this?

Made the changes as per review.

@arshadkazmi42
Copy link
Member

@SambhavSacheti any updates on this?

Made the changes as per review.

@SambhavSacheti this is already reviewed from my end. @saranshkataria will be handling the current review process


Now, no matter which input you edit, `this.state.temperature` and `this.state.scale` in the `Calculator` get updated. One of the inputs gets the value as is, so any user input is preserved, and the other input value is always recalculated based on it.
अब, कोई फर्क नहीं पड़ता कि आप किस इनपुट को संपादित करते हैं, `Calculator` के `this.state.temperature` और `this.state.scale` अपडेट हो जायेंगे। इनपुट्स में से एक को वैल्यू मिलती है, इसलिए कोई भी user input संरक्षित रहता है, और अन्य इनपुट वैल्यू हमेशा इसके आधार पर पुनर्गणना होता है।
Copy link
Member

Choose a reason for hiding this comment

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

इनपुट्स में से एक को वैल्यू मिलती है, इसलिए कोई भी user input संरक्षित रहता है, और अन्य इनपुट वैल्यू हमेशा इसके आधार पर पुनर्गणना होता है। -> revisit once

@saranshkataria
Copy link
Member

You missed a few before, added comments on those, and will add more after line 304 soon

@arshadkazmi42
Copy link
Member

Closing due to inactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants