Skip to content

Commit ab2a94b

Browse files
committed
translate 'challenges' section
1 parent 4f3b331 commit ab2a94b

1 file changed

Lines changed: 20 additions & 20 deletions

File tree

src/content/learn/javascript-in-jsx-with-curly-braces.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,9 @@ JSX هي لغة قوالب بسيطة جدًا لأنها تسمح لك بتنظ
244244
245245
<Challenges>
246246
247-
#### Fix the mistake {/*fix-the-mistake*/}
247+
#### أصلح الخطأ {/*fix-the-mistake*/}
248248
249-
This code crashes with an error saying `Objects are not valid as a React child`:
249+
هذا الكود يتعطل ويظهر خطأ `Objects are not valid as a React child`:
250250
251251
<Sandpack>
252252
@@ -286,15 +286,15 @@ body > div > div { padding: 20px; }
286286
287287
</Sandpack>
288288
289-
Can you find the problem?
289+
هل يمكنك إيجاد المشكلة؟
290290
291-
<Hint>Look for what's inside the curly braces. Are we putting the right thing there?</Hint>
291+
<Hint>ابحث عن ما يوجد داخل الأقواس المجعدة. هل يتم وضع الشيء الصحيح هناك؟</Hint>
292292
293293
<Solution>
294294
295-
This is happening because this example renders *an object itself* into the markup rather than a string: `<h1>{person}'s Todos</h1>` is trying to render the entire `person` object! Including raw objects as text content throws an error because React doesn't know how you want to display them.
295+
يحدث هذا بسبب أن هذا المثال يقوم بتصيير *كائن بذاته* في الترميز بدلاً من string: `<h1>{person}'s قائمة المهام</h1>` يحاول عرض كائن `person` بأكمله! إدراج الكائنات المباشرة كمحتوى نصي يُثير خطأ لأن React لا يعرف كيف ترغب في عرضها.
296296
297-
To fix it, replace `<h1>{person}'s Todos</h1>` with `<h1>{person.name}'s Todos</h1>`:
297+
لحل هذه المشكلة، قم بتبديل `<h1>{person}'s Todos</h1>` بـ `<h1>{person.name}'s Todos</h1>`:
298298
299299
<Sandpack>
300300
@@ -336,9 +336,9 @@ body > div > div { padding: 20px; }
336336
337337
</Solution>
338338
339-
#### Extract information into an object {/*extract-information-into-an-object*/}
339+
#### استخرج المعلومات إلى كائن {/*extract-information-into-an-object*/}
340340
341-
Extract the image URL into the `person` object.
341+
استخرج عنوان URL للصورة إلى كائن `person`.
342342
343343
<Sandpack>
344344
@@ -380,7 +380,7 @@ body > div > div { padding: 20px; }
380380
381381
<Solution>
382382
383-
Move the image URL into a property called `person.imageUrl` and read it from the `<img>` tag using the curlies:
383+
قم بنقل عنوان URL للصورة إلى خاصية تسمى `person.imageUrl` وقم بقراءتها من وسم `<img>` باستخدام الأقواس المعقوفة:
384384
385385
<Sandpack>
386386
@@ -423,13 +423,13 @@ body > div > div { padding: 20px; }
423423
424424
</Solution>
425425
426-
#### Write an expression inside JSX curly braces {/*write-an-expression-inside-jsx-curly-braces*/}
426+
#### اكتب تعبيراً داخل أقواس JSX المعقوفة. {/*write-an-expression-inside-jsx-curly-braces*/}
427427
428-
In the object below, the full image URL is split into four parts: base URL, `imageId`, `imageSize`, and file extension.
428+
في الكائن أدناه، يتم تقسيم العنوان الكامل للصورة إلى أربعة أجزاء: العنوان الأساس و`imageId` و`imageSize` وامتداد الملف.
429429
430-
We want the image URL to combine these attributes together: base URL (always `'https://i.imgur.com/'`), `imageId` (`'7vQD0fP'`), `imageSize` (`'s'`), and file extension (always `'.jpg'`). However, something is wrong with how the `<img>` tag specifies its `src`.
430+
نريد أن يتم دمج عنوان URL للصورة باستخدام هذه الخصائص معًا: العنوان الأساس (دائمًا `'https://i.imgur.com/'`) و`imageId` (`'7vQD0fP'`) و `imageSize` (`'s'`)، وامتداد الملف (دائمًا `'.jpg'`). ومع ذلك، هناك خطأ في كيفية تحديد الوسم `<img>` لخاصية `src` الخاصة به.
431431

432-
Can you fix it?
432+
هل يمكنك إصلاح الخطأ؟
433433

434434
<Sandpack>
435435

@@ -473,15 +473,15 @@ body > div > div { padding: 20px; }
473473

474474
</Sandpack>
475475

476-
To check that your fix worked, try changing the value of `imageSize` to `'b'`. The image should resize after your edit.
476+
للتحقق من نجاح حلك، جرب تغيير قيمة `imageSize` إلى `'b'`. يفترض أن يتغير حجم الصورة بعد تعديلك.
477477

478478
<Solution>
479479

480-
You can write it as `src={baseUrl + person.imageId + person.imageSize + '.jpg'}`.
480+
يمكنك كتابته على هذا النحو `src={baseUrl + person.imageId + person.imageSize + '.jpg'}`.
481481

482-
1. `{` opens the JavaScript expression
483-
2. `baseUrl + person.imageId + person.imageSize + '.jpg'` produces the correct URL string
484-
3. `}` closes the JavaScript expression
482+
1. `{` تفتح التعبير الخاص بـ JavaScript
483+
2. `baseUrl + person.imageId + person.imageSize + '.jpg'` ينتج string URL الصحيح
484+
3. `{` تغلق التعبير الخاص بـ JavaScript
485485

486486
<Sandpack>
487487

@@ -524,7 +524,7 @@ body > div > div { padding: 20px; }
524524

525525
</Sandpack>
526526

527-
You can also move this expression into a separate function like `getImageUrl` below:
527+
يمكنك أيضًا نقل هذا التعبير إلى دالة منفصلة مثل `getImageUrl` في الأسفل:
528528

529529
<Sandpack>
530530

@@ -579,7 +579,7 @@ body > div > div { padding: 20px; }
579579

580580
</Sandpack>
581581

582-
Variables and functions can help you keep the markup simple!
582+
المتغيرات والدوال يمكنها مساعدتك في إبقاء الترميز بسيط!
583583

584584
</Solution>
585585

0 commit comments

Comments
 (0)