Skip to content

Commit 12b6ddc

Browse files
authored
Merge pull request #472 from algorizr/translate/describing-the-ui
[DONE]: Translate `Describing the UI` page
2 parents 55bc515 + 8a5048c commit 12b6ddc

File tree

1 file changed

+46
-46
lines changed

1 file changed

+46
-46
lines changed

src/content/learn/describing-the-ui.md

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
---
2-
title: Describing the UI
2+
title: وصف واجهات المستخدم (UI)
33
---
44

55
<Intro>
66

7-
React is a JavaScript library for rendering user interfaces (UI). UI is built from small units like buttons, text, and images. React lets you combine them into reusable, nestable *components.* From web sites to phone apps, everything on the screen can be broken down into components. In this chapter, you'll learn to create, customize, and conditionally display React components.
7+
تعد React من مكتبات JavaScript المخصَّصة لبناء واجهات المستخدم (UI). يتم بناء واجهات المستخدم من وحدات صغيرة مثل الأزرار والنصوص والصور. تسمح لك React بتجميع هذه العناصر في مكونات (Components) يمكن إعادة استخدامها أو تضمينها داخل بعضها البعض. من مواقع الويب إلى تطبيقات الهاتف الجوال يمكن تقسم كل شئ إلى مكونات. في هذا الفصل، سوف تتعلم كيفية إنشاء وتعديل وعرض مكونات حسب الشروط.
88

99
</Intro>
1010

1111
<YouWillLearn isChapter={true}>
1212

13-
* [How to write your first React component](/learn/your-first-component)
14-
* [When and how to create multi-component files](/learn/importing-and-exporting-components)
15-
* [How to add markup to JavaScript with JSX](/learn/writing-markup-with-jsx)
16-
* [How to use curly braces with JSX to access JavaScript functionality from your components](/learn/javascript-in-jsx-with-curly-braces)
17-
* [How to configure components with props](/learn/passing-props-to-a-component)
18-
* [How to conditionally render components](/learn/conditional-rendering)
19-
* [How to render multiple components at a time](/learn/rendering-lists)
20-
* [How to avoid confusing bugs by keeping components pure](/learn/keeping-components-pure)
13+
* [كيفية كتابة أول مكون React لك](/learn/your-first-component)
14+
* [متى وكيف تنشأ ملفات تحتوى على أكثر من مكون](/learn/importing-and-exporting-components)
15+
* [كيفية إضافة ترميزات (Markup) إلى JavaScript باستخدام JSX](/learn/writing-markup-with-jsx)
16+
* [كيفية استخدام الأقواس المجعدة في JSX لاستخدام وظائف JavaScript في مكوناتك (Components)](/learn/javascript-in-jsx-with-curly-braces)
17+
* [كيفية إعداد المكونات باستخدام الخصائص (Props)](/learn/passing-props-to-a-component)
18+
* [(Conditional rendering) كيفية عرض المكونات بشكل مشروط](/learn/conditional-rendering)
19+
* [كيفية عرض أكثر من مكون مرة واحدة](/learn/rendering-lists)
20+
* [كيفية تجنب الثغرات المحيرة عن طريق الحفاظ على المكونات نقية](/learn/keeping-components-pure)
2121

2222
</YouWillLearn>
2323

24-
## Your first component {/*your-first-component*/}
24+
## أول مكون لك {/*your-first-component*/}
2525

26-
React applications are built from isolated pieces of UI called *components*. A React component is a JavaScript function that you can sprinkle with markup. Components can be as small as a button, or as large as an entire page. Here is a `Gallery` component rendering three `Profile` components:
26+
يتم بناء تطبيقات React باستخدام قطع معزولة من واجهات المستخدم تسمى مكونات. المكون في React هو عبارة عن دالة JavaScript التى يمكنك إضافة ترميزات إليها. المكونات يمكن أن تكون صغيرة كزرار أو كبيرة كصفحة كاملة. هنا المكون `Gallery` يقوم بعرض ثلاث مكونات `Profile`:
2727

2828
<Sandpack>
2929

@@ -57,13 +57,13 @@ img { margin: 0 10px 10px 0; height: 90px; }
5757

5858
<LearnMore path="/learn/your-first-component">
5959

60-
Read **[Your First Component](/learn/your-first-component)** to learn how to declare and use React components.
60+
اقرأ **[مكونك الأول](/learn/your-first-component)** لتتعلم كيفية تعريف واستخدام مكونات React.
6161

6262
</LearnMore>
6363

64-
## Importing and exporting components {/*importing-and-exporting-components*/}
64+
## استيراد وتصدير المكونات {/*importing-and-exporting-components*/}
6565

66-
You can declare many components in one file, but large files can get difficult to navigate. To solve this, you can *export* a component into its own file, and then *import* that component from another file:
66+
يمكنك تعريف أكثر من مكون في ملف واحد، ولكن الملفات الكبيرة يمكن أن تصبح صعبة التصفح. لحل هذه المشكلة يمكنك أن تصدر *export* مكون من الملف الخاص به، ثم استخدام *import* لتستخدم هذا المكون في ملف آخر:
6767

6868

6969
<Sandpack>
@@ -112,15 +112,15 @@ img { margin: 0 10px 10px 0; }
112112

113113
<LearnMore path="/learn/importing-and-exporting-components">
114114

115-
Read **[Importing and Exporting Components](/learn/importing-and-exporting-components)** to learn how to split components into their own files.
115+
اقرأ **[استيراد وتصدير المكونات](/learn/importing-and-exporting-components)** لتتعلم كيفية تقسيم المكونات إلى ملفات خاصة بها.
116116

117117
</LearnMore>
118118

119-
## Writing markup with JSX {/*writing-markup-with-jsx*/}
119+
## كتابة ترميزات (Markup) باستخدام JSX {/*writing-markup-with-jsx*/}
120120

121-
Each React component is a JavaScript function that may contain some markup that React renders into the browser. React components use a syntax extension called JSX to represent that markup. JSX looks a lot like HTML, but it is a bit stricter and can display dynamic information.
121+
كل مكون في React عبارة عن دالة JavaScript التى يمكن أن تحتوي على بعض الترميزات التي يمكن لـ React أن تعرضها في المتصفح. المكونات في React تستخدم صيغة معدلة تسمى JSX لكى تمثل هذه الترميزات. JSX تشبه HTML كثيرا، ولكنها صارمة قليلا وتستطيع أن تعرض محتوى ديناميكي.
122122

123-
If we paste existing HTML markup into a React component, it won't always work:
123+
إذا قمنا بنسخ ترميزات HTML موجودة سابقا داخل مكون React، لن تعمل دائما:
124124

125125
<Sandpack>
126126

@@ -149,7 +149,7 @@ img { height: 90px; }
149149
150150
</Sandpack>
151151
152-
If you have existing HTML like this, you can fix it using a [converter](https://transform.tools/html-to-jsx):
152+
إذا كان لديك ترميزات HTML مثل هذه، يمكنك أن تصلحها باستخدام [محوّل](https://transform.tools/html-to-jsx):
153153
154154
<Sandpack>
155155
@@ -181,13 +181,13 @@ img { height: 90px; }
181181

182182
<LearnMore path="/learn/writing-markup-with-jsx">
183183

184-
Read **[Writing Markup with JSX](/learn/writing-markup-with-jsx)** to learn how to write valid JSX.
184+
اقرأ **[كتابة ترميزات (Markup) باستخدام JSX](/learn/writing-markup-with-jsx)** لتتعلم كيفية كتابة JSX صحيحة
185185

186186
</LearnMore>
187187

188-
## JavaScript in JSX with curly braces {/*javascript-in-jsx-with-curly-braces*/}
188+
## استخدام JavaScript في JSX باستخدام الأقواس المجعدة {/*javascript-in-jsx-with-curly-braces*/}
189189

190-
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:
190+
تتيح لك JSX أن تكتب ترميزات مشابهة إلى HTML بداخل ملفات JavaScript وأن تعرض محتوى وتبقى المنطق الخاص بالمكونات في نفس المكان. في بعض الأحيان، قد ترغب في إضافة بعض المنطق المكتوب باستخدام JavaScript أو الإشارة إلى خاصية ديناميكية داخل هذا الترميز. في هذا الموقف، يمكنك استخدام الأقواس المجعدة في JSX الخاص بك لفتح نافذة إلى JavaScript:
191191

192192
<Sandpack>
193193

@@ -229,13 +229,13 @@ body > div > div { padding: 20px; }
229229
230230
<LearnMore path="/learn/javascript-in-jsx-with-curly-braces">
231231
232-
Read **[JavaScript in JSX with Curly Braces](/learn/javascript-in-jsx-with-curly-braces)** to learn how to access JavaScript data from JSX.
232+
اقرأ **[استخدام JavaScript في JSX باستخدام الأقواس المجعدة](/learn/javascript-in-jsx-with-curly-braces)** لتتعلم كيفية الوصول إلى بيانات JavaScript في JSX
233233
234234
</LearnMore>
235235
236-
## Passing props to a component {/*passing-props-to-a-component*/}
236+
## تمرير الخصائص (Props) إلى مكون {/*passing-props-to-a-component*/}
237237
238-
React components use *props* to communicate with each other. Every parent component can pass some information to its child components by giving them props. Props might remind you of HTML attributes, but you can pass any JavaScript value through them, including objects, arrays, functions, and even JSX!
238+
المكونات في React تتواصل مع بعضها البعض عن طريق الخصائص (Props). كل مكون أب يمكن له أن يمرر بعض المعلومات إلى المكونات الأبناء عن طريق إعطائهم خصائص. الخصائص يمكن أن تذكرك بـ"خصائص HTML"، ولكن يمكنك أن تمرر أي قيمة JavaScript عن طريقهم، هذا يمكن أن يكون كائن (object) أو مصفوفة (array) أو دالة function أو حتى JSX!
239239
240240
<Sandpack>
241241
@@ -310,15 +310,15 @@ export function getImageUrl(person, size = 's') {
310310

311311
<LearnMore path="/learn/passing-props-to-a-component">
312312

313-
Read **[Passing Props to a Component](/learn/passing-props-to-a-component)** to learn how to pass and read props.
313+
اقرأ **[تمرير الخصائص (Props) إلى مكون](/learn/passing-props-to-a-component)** لتتعلم كيفية تمرير وقراءة الخصائص.
314314

315315
</LearnMore>
316316

317-
## Conditional rendering {/*conditional-rendering*/}
317+
## العرض المشروط (Conditional rendering) {/*conditional-rendering*/}
318318

319-
Your components will often need to display different things depending on different conditions. In React, you can conditionally render JSX using JavaScript syntax like `if` statements, `&&`, and `? :` operators.
319+
غالبًا ما تحتاج مكوناتك إلى عرض أشياء مختلفة تعتمد على شروط مختلفة. في React، يمكنك عرض JSX حسب شروط باستخدام صيغ شبيهه بـ JavaScript مثل التعبيرات الشرطية `if` والمعاملات `&&` و `condition ? if true : else`.
320320

321-
In this example, the JavaScript `&&` operator is used to conditionally render a checkmark:
321+
في هذا المثال، معامل `&&` في JavaScript يستخدم لعرض علامة صح بشكل مشروط:
322322

323323
<Sandpack>
324324

@@ -358,15 +358,15 @@ export default function PackingList() {
358358
359359
<LearnMore path="/learn/conditional-rendering">
360360
361-
Read **[Conditional Rendering](/learn/conditional-rendering)** to learn the different ways to render content conditionally.
361+
اقرأ **[العرض المشروط (Conditional rendering)](/learn/conditional-rendering)** لتتعلم الطرق المختلفة لعرض المحتوى بشكل شرطي.
362362
363363
</LearnMore>
364364
365-
## Rendering lists {/*rendering-lists*/}
365+
## عرض القوائم (lists) {/*rendering-lists*/}
366366
367-
You will often want to display multiple similar components from a collection of data. You can use JavaScript's `filter()` and `map()` with React to filter and transform your array of data into an array of components.
367+
غالبًا ما سترغب في عرض عدة مكونات متشابهة من مجموعة البيانات. يمكن استخدام `filter()` و `map()` في JavaScript مع React لتصفية وتحويل مصفوفة البيانات الخاصة بك إلى مصفوفة من المكونات.
368368
369-
For each array item, you will need to specify a `key`. Usually, you will want to use an ID from the database as a `key`. Keys let React keep track of each item's place in the list even if the list changes.
369+
يتعين عليك تحديد مفتاح `key` لكل عنصر في المصفوفة. عادةً سترغب في استخدام ID من قاعدة البيانات كمفتاح `key`. يتيح المفتاح `key` إلى React أن تتبع مكان كل عنصر في القائمة حتى لو تغيرت القائمة.
370370
371371
<Sandpack>
372372
@@ -458,26 +458,26 @@ h2 { font-size: 20px; }
458458

459459
<LearnMore path="/learn/rendering-lists">
460460

461-
Read **[Rendering Lists](/learn/rendering-lists)** to learn how to render a list of components, and how to choose a key.
461+
اقرأ **[عرض القوائم (lists)](/learn/rendering-lists)** لتتعلم كيفية عرض قوائم من المكونات، وكيفية اختيار مفتاح.
462462

463463
</LearnMore>
464464

465-
## Keeping components pure {/*keeping-components-pure*/}
465+
## الحفاظ على المكونات نقية {/*keeping-components-pure*/}
466466

467-
Some JavaScript functions are *pure.* A pure function:
467+
بعض دوال JavaScript *نقية*. الدالة النقية:
468468

469-
* **Minds its own business.** It does not change any objects or variables that existed before it was called.
470-
* **Same inputs, same output.** Given the same inputs, a pure function should always return the same result.
469+
* **تهتم بشؤونها فقط.** لا تغيّر أي كائنات (objects) أو متغيرات (variables) كانت موجودة من قبل عند استدعائها.
470+
* **نفس المدخلات، نفس المخرجات.** يجب أن تعيد الدالة النقية دائمًا نفس النتيجة عندما تمرر لها نفس المُدخلات.
471471

472-
By strictly only writing your components as pure functions, you can avoid an entire class of baffling bugs and unpredictable behavior as your codebase grows. Here is an example of an impure component:
472+
من خلال كتابة مكوناتك بشكل صارم، حيث تكون دوالا نقية فقط، يمكنك تجنب فئة كاملة من الأخطاء صعبة التفسير والسلوك غير المتوقع مع تطور قاعدة الكود (codebase) الخاصّة بك. هنا مثال على مكوّن غير نقي:
473473

474474
<Sandpack>
475475

476476
```js
477477
let guest = 0;
478478

479479
function Cup() {
480-
// Bad: changing a preexisting variable!
480+
// سيء: تعديل متغير موجود مسبقًا
481481
guest = guest + 1;
482482
return <h2>Tea cup for guest #{guest}</h2>;
483483
}
@@ -495,7 +495,7 @@ export default function TeaSet() {
495495

496496
</Sandpack>
497497

498-
You can make this component pure by passing a prop instead of modifying a preexisting variable:
498+
يمكنك جعل هذا المكون نقي عن طريق تمرير الخاصية بدلا عن تعديل متغير موجود بالفعل:
499499

500500
<Sandpack>
501501

@@ -519,12 +519,12 @@ export default function TeaSet() {
519519

520520
<LearnMore path="/learn/keeping-components-pure">
521521

522-
Read **[Keeping Components Pure](/learn/keeping-components-pure)** to learn how to write components as pure, predictable functions.
522+
اقرأ **[الحفاظ على المكونات نقية](/learn/keeping-components-pure)** لتتعلم كيفية كتابة مكونات نقية ودوال متنبئة.
523523

524524
</LearnMore>
525525

526-
## What's next? {/*whats-next*/}
526+
## ماذا بعد ذلك؟ {/*whats-next*/}
527527

528-
Head over to [Your First Component](/learn/your-first-component) to start reading this chapter page by page!
528+
توجه إلى [المكون الأول الخاص بك](/learn/your-first-component) لبدء قراءة هذا الفصل صفحة بصفحة!
529529

530-
Or, if you're already familiar with these topics, why not read about [Adding Interactivity](/learn/adding-interactivity)?
530+
أو، إذا كنت بالفعل على دراية بهذه المواضيع، لماذا لا تقرأ عن [إضافة التفاعلية (Interactivity)](/learn/adding-interactivity)?

0 commit comments

Comments
 (0)