Translated shallow renderer by vermasachin · Pull Request #44 · reactjs/hi.react.dev

Conversation

@vermasachin

Translated API Reference > Shallow Renderer.

Some issues that I'm aware of and need help on:

  1. Translation for the word 'shallow'. I'm using just 'शैलो', because 'उथला' is generally used in the context of water and it's much more complicated.
  2. The first title of the page 'Importing'. Import is 'आयात', but couldn't find out present continuous translation for this.
  3. Couldn't figure out proper 'child, children' translations.
  4. For 'assert' I have used 'जांच', couldn't find better translation.

@netlify

arshadkazmi42

Choose a reason for hiding this comment

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

Great work.
I have left two small feedbacks, once those are fixed it will be good to go from my end

arshadkazmi42

Choose a reason for hiding this comment

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

Great work 💯
For next steps @saranshkataria will be doing another round of review and we will get this merge once its approved by @saranshkataria

saranshkataria

## ओवरव्यू {#overview}

When writing unit tests for React, shallow rendering can be helpful. Shallow rendering lets you render a component "one level deep" and assert facts about what its render method returns, without worrying about the behavior of child components, which are not instantiated or rendered. This does not require a DOM.
React के लिए यूनिट टेस्ट लिखते समय शैलो रेंडरिंग काफ़ी उपयोगी हो सकती है। शैलो रेंडरिंग आपको एक कौम्पोनॅन्ट को "एक स्तर गहरा" रेंडर करने देता है और आपको दृढ़ता से ये जांच करने की क्षमता प्रदान करता है कि इस कौम्पोनॅन्ट का रेंडर मेथड क्या return करेगा, child कौम्पोनॅन्टस के व्यव्हार की चिंता किये बिना, जो की instantiate या रेंडर नहीं होते। इसमें DOM की आवश्यकता नहीं होती है।

Choose a reason for hiding this comment

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

दृढ़ता could be replaced by an easier to understand word?

Choose a reason for hiding this comment

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

@saranshkataria I am thinking to work on this. And we will get this merged.
How about वास्तविकता?

Choose a reason for hiding this comment

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

आपको दृढ़ता से ये जांच करने की क्षमता प्रदान करता है => और रेंडर मेथड जो रिटर्न कर रहा है उसको अस्सर्ट कर सकते हैं

Choose a reason for hiding this comment

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

sounds good

saranshkataria

```

Then you can assert:
तब आप जांच कर सकते हैं:

Choose a reason for hiding this comment

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

assert has a specific meaning to it, we should just convert it to hindi

Choose a reason for hiding this comment

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

What should we use? असर्ट or अस्सर्ट

Choose a reason for hiding this comment

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

अस्सर्ट makes more sense in my opinion, thoughts @arshadkazmi42 ?
Also, whatever is decided, please do add it in #2 as well

Choose a reason for hiding this comment

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

I was also thinking about this अस्सर्ट. Let me add this in #2

saranshkataria

> टिप्पणी:
>
> We also recommend checking out Enzyme's [Shallow Rendering API](https://airbnb.io/enzyme/docs/api/shallow.html). It provides a nicer higher-level API over the same functionality.
> हम Enzyme के [शैलो रेंडरिंग API](https://airbnb.io/enzyme/docs/api/shallow.html) का भी परीक्षण करने की भी सलाह देते हैं। यह समान कार्यक्षमता पर एक अच्छा उच्च स्तरीय API प्रदान करता है।

Choose a reason for hiding this comment

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

यह समान कार्यक्षमता पर एक अच्छा उच्च स्तरीय API प्रदान करता है। -> can be simplified a bit?

Choose a reason for hiding this comment

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

यह उसी फंक्शनलिटी पर एक और अच्छे स्तर की API देता है ??

Choose a reason for hiding this comment

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

sounds good

saranshkataria

### `shallowRenderer.render()` {#shallowrendererrender}

You can think of the shallowRenderer as a "place" to render the component you're testing, and from which you can extract the component's output.
आप जिस कौम्पोनॅन्ट का परीक्षण कर रहे हैं, shallowRenderer को आप उसे रेंडर करने के एक "स्थान" की तरह सोच सकते हैं, और जिससे आप कौम्पोनॅन्ट के आउटपुट को निकाल सकते हैं।

Choose a reason for hiding this comment

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

जिससे आप कौम्पोनॅन्ट -> isse aap

saranshkataria

`shallowRenderer.render()` के call हो जाने के बाद आप शैलो रेंडर हुए आउटपुट को पाने के लिए `shallowRenderer.getRenderOutput()` का इस्तेमाल कर सकते हैं।

You can then begin to assert facts about the output.
तब आप आउटपुट के बारे में तथ्यों की जांच करना शुरू कर सकते हैं। No newline at end of file

Choose a reason for hiding this comment

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

same comment about assert as above

@saranshkataria

Great work! Added some comments. Once we are done with those, this is good to be merged :)

@arshadkazmi42

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

@arshadkazmi42

@saranshkataria I have made suggested changes and added few comments. Can you review that? We will get this merged as only few fixes are present

@saranshkataria

@arshadkazmi42 replied to the comments, let's get this one in once you make those changes!

@arshadkazmi42

@saranshkataria Done with those changes. Let the tests complete, you check the changes and let's get this merged