Javascript in jsx with curly braces bengali translate by nazmulweb · Pull Request #24 · reactjs/bn.react.dev

@nazmulweb

Md. Nazmul Hasan added 2 commits

May 16, 2023 01:35

sudiptob2

Choose a reason for hiding this comment

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

translation seems OK

moshfiqrony

Comment on lines +20 to +22

## quotes এর সাথে strings পাসিং {/*passing-strings-with-quotes*/}

When you want to pass a string attribute to JSX, you put it in single or double quotes:
আপনি যখন JSX-এ একটি স্ট্রিং attribute পাস করতে চান, আপনাকে এটি single বা double quotes রাখতে হবে:

Choose a reason for hiding this comment

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

You used strings and স্ট্রিং both. I would pick স্ট্রিং for both here.

sudiptob2

</Sandpack>

Notice the difference between `className="avatar"`, which specifies an `"avatar"` CSS class name that makes the image round, and `src={avatar}` that reads the value of the JavaScript variable called `avatar`. That's because curly braces let you work with JavaScript right there in your markup!
`className="avatar"` এর মধ্যে পার্থক্য লক্ষ্য করুন, যা একটি `"avatar"` CSS ক্লাসের নাম নির্দিষ্ট করে যা ইমেজটিকে গোলাকার করে, এবং `src={avatar}` যেটি `avatar` নামে জাভাস্ক্রিপ্ট ভেরিয়েবলের value পড়ে। কারণ curly braces আপনাকে আপনার মার্কআপে জাভাস্ক্রিপ্টের সাথে কাজ করতে দেয়!

Choose a reason for hiding this comment

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

`className="avatar"` এর মধ্যে পার্থক্য লক্ষ্য করুন, যা একটি `"avatar"` CSS ক্লাসের নাম নির্দিষ্ট করে যা ইমেজটিকে গোলাকার করে, এবং `src={avatar}` যেটি `avatar` নামে জাভাস্ক্রিপ্ট ভেরিয়েবলের value পড়ে। কারণ curly braces আপনাকে আপনার মার্কআপে জাভাস্ক্রিপ্টের সাথে কাজ করতে দেয়!
`className="avatar"` এবং `src={avatar}` এর মধ্যে পার্থক্য লক্ষ্য করুন`className="avatar"` একটি `"avatar"` নামের CSS ক্লাসকে নির্দিষ্ট করে ও ইমেজকে গোলাকার করে অপরদিকে, `src={avatar}`, `avatar` নামের জাভাস্ক্রিপ্ট ভেরিয়েবলের value পড়ে। এর কারণ হচ্ছে, কারলি ব্রেসেস আপনাকে আপনার মার্কআপ এর ভিতরেই জাভাস্ক্রিপ্ট এর কাজ করতে দেয়!
…slation, and change request implemented

@moshfiqrony

@nazmulweb

Yes, working on it. 70% is done.

@moshfiqrony

Hi @nazmulweb if the translation is done please mark it ready to review.

Thanks

@nazmulweb

Please review this task and approve

@github-actions

Size changes

Details

📦 Next.js Bundle Analysis for react-dev

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

nafistiham

Choose a reason for hiding this comment

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

খুব সামান্য কিছু বিষয় চিহ্নিত করে দিয়েছি।


1. **As text** directly inside a JSX tag: `<h1>{name}'s To Do List</h1>` works, but `<{tag}>Gregorio Y. Zara's To Do List</{tag}>` will not.
2. **As attributes** immediately following the `=` sign: `src={avatar}` will read the `avatar` variable, but `src="{avatar}"` will pass the string `"{avatar}"`.
1. সরাসরি JSX ট্যাগের ভিতরে **text হিসাবে**: `<h1>{name}'s To Do List</h1>` এভাবে কাজ করে, কিন্তু `<{tag}>Gregorio Y. Zara's To Do List</{tag}>` এভাবে করবে না৷

Choose a reason for hiding this comment

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

এখানে লাইনে লাইনে মিলে নাই।

<Intro>

JSX lets you write HTML-like markup inside a JavaScript file, keeping rendering logic and content in the same place. Sometimes you will want to add a little JavaScript logic or reference a dynamic property inside that markup. In this situation, you can use curly braces in your JSX to open a window to JavaScript.
JSX আপনাকে একটি জাভাস্ক্রিপ্ট ফাইলের ভিতরে HTML-এর মতো মার্কআপ লিখতে দেয়, logic এবং content একই জায়গায় রেন্ডার করে। কখনও কখনও মার্কআপের ভিতরে জাভাস্ক্রিপ্ট logic বা dynamic property লেখার প্রয়োজন পরে। এই পরিস্থিতিতে, আপনি JSX-এ curly braces ব্যবহার করে জাভাস্ক্রিপ্ট লিখতে পারেন।

Choose a reason for hiding this comment

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

JSX আপনাকে একটি জাভাস্ক্রিপ্ট ফাইলের ভিতরে HTML-এর মতো মার্কআপ লিখতে দেয়, logic এবং content একই জায়গায় রেন্ডার করে। কখনও কখনও মার্কআপের ভিতরে জাভাস্ক্রিপ্ট logic বা dynamic property লেখার প্রয়োজন পরে। এই পরিস্থিতিতে, আপনি JSX-এ curly braces ব্যবহার করে জাভাস্ক্রিপ্ট লিখতে পারেন।
JSX আপনাকে একটি জাভাস্ক্রিপ্ট ফাইলের ভিতরে HTML-এর মতো মার্কআপ লিখতে দেয়, logic এবং content একই জায়গায় রেন্ডার করে। কখনও কখনও মার্কআপের ভিতরে জাভাস্ক্রিপ্ট logic বা dynamic property লেখার প্রয়োজন পড়ে। এই পরিস্থিতিতে, আপনি JSX-এ curly braces ব্যবহার করে জাভাস্ক্রিপ্ট লিখতে পারেন।
```js
<div style={person.theme}>
<h1>{person.name}'s Todos</h1>
<h1>{person.name}'s Todos</h1>

Choose a reason for hiding this comment

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

কোড বদলানো যাবে না।

#### ভুলটা ঠিক করুন {/*fix-the-mistake*/}

This code crashes with an error saying `Objects are not valid as a React child`:
এই কোডটি একটি ত্রুটির কারণে ক্র্যাশ হয়েছে যে `অবজেক্টগুলি React child হিসাবে বৈধ নয়`:

Choose a reason for hiding this comment

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

এই কোডটি একটি ত্রুটির কারণে ক্র্যাশ হয়েছে যে `অবজেক্টগুলি React child হিসাবে বৈধ নয়`:
এই কোডটি ক্র্যাশ করেছে একটি ত্রুটির কারণে, যা বলচহে, `অবজেক্টগুলি React child হিসাবে বৈধ নয়`:

@nafistiham nafistiham added wip

Work in progress

stale

Any PR that is inactive for more than a month

labels

Sep 6, 2025