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 rendering-lists #321

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vishnupprajapat
Copy link

@vishnupprajapat vishnupprajapat commented Jan 7, 2025

New Hindi Translation Progress #168

@arshadkazmi42

Changes Proposed

Translation of rendering-lists

@vishnupprajapat
Copy link
Author

New Hindi Translation Progress #168
@arshadkazmi42

@arshadkazmi42
Copy link
Member

@vishnupprajapat Thank you for the PR. I will review it soon.

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.

Thank you for working on this. Overall looks good 👍

I have left a few minor comments, can you fix those? Once those are fixed we can merge the PR.


```js
const listItems = people.map(person => <li>{person}</li>);
```

3. **Return** `listItems` from your component wrapped in a `<ul>`:
3. **Return** अपने कंपोनेंट में `listItems` को `<ul>` में wrapped करें:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
3. **Return** अपने कंपोनेंट में `listItems` को `<ul>` में wrapped करें:
3. **Return** अपने कौम्पोनॅन्ट में `listItems` को `<ul>` में wrapped करें:

we are using this spelling of component कौम्पोनॅन्ट can you update this everywhere in the file


1. **Create** a new array of just “chemist” people, `chemists`, by calling `filter()` on the `people` filtering by `person.profession === 'chemist'`:
1. एक नई array `chemists` **Create** करें जो केवल "chemist" वाले लोगों को दिखाती हो, `filter()` method का उपयोग करके `person.profession === 'chemist'`:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
1. एक नई array `chemists` **Create** करें जो केवल "chemist" वाले लोगों को दिखाती हो, `filter()` method का उपयोग करके `person.profession === 'chemist'`:
1. एक नई array `chemists` **Create** करें जो केवल chemist वाले लोगों को दिखाती हो, `people` पर `filter()` कॉल करके इससे `person.profession === 'chemist'` फ़िल्टर करें:

@@ -153,7 +153,7 @@ const listItems = chemists.map(person =>
);
```

3. Lastly, **return** the `listItems` from your component:
3. अब, अपने कंपोनेंट से `listItems` को **return** करें :
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
3. अब, अपने कंपोनेंट से `listItems` को **return** करें :
3. अब, अपने कौम्पोनॅन्ट से `listItems` को **return** करें :

Comment on lines 291 to 293
Keys tell React which array item each component corresponds to, so that it can match them up later. This becomes important if your array items can move (e.g. due to sorting), get inserted, or get deleted. A well-chosen `key` helps React infer what exactly has happened, and make the correct updates to the DOM tree.

Rather than generating keys on the fly, you should include them in your data:
Copy link
Member

Choose a reason for hiding this comment

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

You forgot to remove the english version for this. Can you remove the lines 291 - 293


</Note>

Keys tell React which array item each component corresponds to, so that it can match them up later. This becomes important if your array items can move (e.g. due to sorting), get inserted, or get deleted. A well-chosen `key` helps React infer what exactly has happened, and make the correct updates to the DOM tree.

Rather than generating keys on the fly, you should include them in your data:

Keys React को यह बताती हैं कि कौन सा array आइटम प्रत्येक कंपोनेंट से संबंधित है, ताकि React बाद में उन्हें मेल कर सके। यह महत्वपूर्ण हो जाता है यदि आपके array आइटम्स को स्थानांतरित (जैसे कि सॉर्टिंग के कारण), जोड़ा, या हटाया जा सकता है। एक अच्छे तरीके से चुनी गई `key` React को यह अनुमान लगाने में मदद करती है कि क्या हुआ है, और DOM वृक्ष में सही अपडेट्स कराती है।
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Keys React को यह बताती हैं कि कौन सा array आइटम प्रत्येक कंपोनेंट से संबंधित है, ताकि React बाद में उन्हें मेल कर सके। यह महत्वपूर्ण हो जाता है यदि आपके array आइटम्स को स्थानांतरित (जैसे कि सॉर्टिंग के कारण), जोड़ा, या हटाया जा सकता है। एक अच्छे तरीके से चुनी गई `key` React को यह अनुमान लगाने में मदद करती है कि क्या हुआ है, और DOM वृक्ष में सही अपडेट्स कराती है।
Keys React को यह बताती हैं कि कौन सा array आइटम प्रत्येक कौम्पोनॅन्ट से संबंधित है, ताकि React बाद में उन्हें मेल कर सके। यह महत्वपूर्ण हो जाता है यदि आपके array आइटम्स को स्थानांतरित (जैसे कि सॉर्टिंग के कारण), जोड़ा, या हटाया जा सकता है। एक अच्छे तरीके से चुनी गई `key` React को यह अनुमान लगाने में मदद करती है कि क्या हुआ है, और DOM ट्री में सही अपडेट्स कराती है।

Comment on lines 773 to 775
A very attentive reader might notice that with two `filter` calls, we check each person's profession twice. Checking a property is very fast, so in this example it's fine. If your logic was more expensive than that, you could replace the `filter` calls with a loop that manually constructs the arrays and checks each person once.

In fact, if `people` never change, you could move this code out of your component. From React's perspective, all that matters is that you give it an array of JSX nodes in the end. It doesn't care how you produce that array:
Copy link
Member

Choose a reason for hiding this comment

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

You forgot to remove the english version here. Can you remove lines from 767 - 769


Make a list of recipes from this array! For each recipe in the array, display its name as an `<h2>` and list its ingredients in a `<ul>`.

#### एक कंपोनेंट में नेस्टेड सूचियाँ {/*nested-lists-in-one-component*/}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
#### एक कंपोनेंट में नेस्टेड सूचियाँ {/*nested-lists-in-one-component*/}
#### एक कौम्पोनॅन्ट में नेस्टेड सूचियाँ {/*nested-lists-in-one-component*/}


</Solution>

#### Extracting a list item component {/*extracting-a-list-item-component*/}
#### एक सूची आइटम कंपोनेंट निकालना {/*extracting-a-list-item-component*/}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
#### एक सूची आइटम कंपोनेंट निकालना {/*extracting-a-list-item-component*/}
#### एक सूची आइटम कौम्पोनॅन्ट निकालना {/*extracting-a-list-item-component*/}


This `RecipeList` component contains two nested `map` calls. To simplify it, extract a `Recipe` component from it which will accept `id`, `name`, and `ingredients` props. Where do you place the outer `key` and why?
यह `RecipeList` कंपोनेंट दो नेस्टेड `map` कॉल्स को शामिल करता है। इसे सरल बनाने के लिए, इससे एक `Recipe` कंपोनेंट निकालें जो `id`, `name`, और `ingredients` प्रॉप्स को स्वीकार करेगा। आप बाहरी `key` को कहां रखें और क्यों?
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
यह `RecipeList` कंपोनेंट दो नेस्टेड `map` कॉल्स को शामिल करता है। इसे सरल बनाने के लिए, इससे एक `Recipe` कंपोनेंट निकालें जो `id`, `name`, और `ingredients` प्रॉप्स को स्वीकार करेगा। आप बाहरी `key` को कहां रखें और क्यों?
यह `RecipeList` कौम्पोनॅन्ट दो नेस्टेड `map` कॉल्स को शामिल करता है। इसे सरल बनाने के लिए, इससे एक `Recipe` कौम्पोनॅन्ट निकालें जो `id`, `name`, और `ingredients` प्रॉप्स को स्वीकार करेगा। आप बाहरी `key` को कहां रखें और क्यों?


<Hint>

You'll either need to convert `map` to a manual loop, or use a Fragment.
आपको या तो `map` को एक मैनुअल लूप में बदलने की आवश्यकता होगी, या एक Fragment का उपयोग करना होगा।

</Hint>

<Solution>

You can write a manual loop, inserting `<hr />` and `<p>...</p>` into the output array as you go:
Copy link
Member

Choose a reason for hiding this comment

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

Remove english version of the line 1156

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