Skip to content

Commit 2ab325c

Browse files
author
Omar Dulaimi
committed
full translation
1 parent 9174fb6 commit 2ab325c

File tree

3 files changed

+37
-30
lines changed

3 files changed

+37
-30
lines changed

content/docs/rendering-elements.md

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: rendering-elements
3-
title: Rendering Elements
3+
title: تصيير العناصر
44
permalink: docs/rendering-elements.html
55
redirect_from:
66
- "docs/displaying-data.html"
@@ -10,66 +10,72 @@ next: components-and-props.html
1010

1111
العناصر (Elements) هي أصغر الوحدات البنائية في التطبيقات المبنية باستخدام رياكت (React).
1212

13-
An element describes what you want to see on the screen:
13+
يصف العنصر الواحد ما تريد رؤيته على الشاشة:
1414

1515
```js
16-
const element = <h1>Hello, world</h1>;
16+
const element = <h1>مرحباً بالعالم!</h1>;
1717
```
1818

19-
Unlike browser DOM elements, React elements are plain objects, and are cheap to create. React DOM takes care of updating the DOM to match the React elements.
2019

21-
>**Note:**
22-
>
23-
>One might confuse elements with a more widely known concept of "components". We will introduce components in the [next section](/docs/components-and-props.html). Elements are what components are "made of", and we encourage you to read this section before jumping ahead.
20+
على عكس عناصر الـ DOM للمتصفح, فإن عناصر رياكت (React) ما هي إلا كائنات بسيطة, ولا تتطلب الكثير لإنشاءها. حيث تتحمل الـ DOM لـ رياكت (React) مسؤولية تحديث الـ DOM لمماثلتها مع عناصر الرياكت (React).
21+
2422

25-
## Rendering an Element into the DOM {#rendering-an-element-into-the-dom}
23+
>**ملاحظة:**
24+
>
25+
>من الممكن الخلط بين العناصر وأحد المفاهيم المعروفة "المكونات". سنقوم بتقديم المكونات في [القسم التالي] (/docs/components-and-props.html). تصنع المكونات من العناصر, ونشجعك على الإطلاع على هذا القسم قبل القفز إلى مواضيع أخرى.
2626
27-
Let's say there is a `<div>` somewhere in your HTML file:
27+
## تصيير عنصر واحد إلى الـ DOM {#rendering-an-element-into-the-dom}
2828

29+
دعنا نفترض أن هنالك عنصر `div` في مكان ما في ملف الـ HTML خاصتك:
2930
```html
3031
<div id="root"></div>
3132
```
3233

33-
We call this a "root" DOM node because everything inside it will be managed by React DOM.
34+
نطلق على هذا العنصر اسم عقدة DOM "الجذر" وذلك لأن كل ما تحتويها سيتم التحكم به من قبل رياكت DOM.
3435

35-
Applications built with just React usually have a single root DOM node. If you are integrating React into an existing app, you may have as many isolated root DOM nodes as you like.
36+
تتألف التطبيقات المبنية باستخدام رياكت في العادة, من عقدة DOM جذر وحيدة. أما إن كنت تقوم بعمل التكامل لـرياكت إلى تطبيق موجود مسبقاً, من الممكن أن يتوفر لديك أي عدد ترغب به من عقد DOM الجذر.
3637

37-
To render a React element into a root DOM node, pass both to `ReactDOM.render()`:
3838

39+
لتصيير عنصر رياكت إلى عقدة DOM جذر وحيدة, مررهما معاَ إلى `ReactDOM.render()`
3940
`embed:rendering-elements/render-an-element.js`
4041

4142
[](codepen://rendering-elements/render-an-element)
4243

43-
It displays "Hello, world" on the page.
44+
يعرض هذا المثال عند تنفيذه "مرحباً بالعالم".
45+
46+
## تحديث العنصر المصير {#updating-the-rendered-element}
4447

45-
## Updating the Rendered Element {#updating-the-rendered-element}
48+
عناصر رياكت غير قابلة للتغيير [immutable](https://en.wikipedia.org/wiki/Immutable_object). عند انشائك عنصراَ, فإنه حينها لا يكون بإمكانك تغيير عناصره الأبناء أو صفاته. العنصر يشبه إطار الفيلم الواحد في كونه يمثل واجهة المستخدم خلال فترة معينة من الزمان.
4649

47-
React elements are [immutable](https://en.wikipedia.org/wiki/Immutable_object). Once you create an element, you can't change its children or attributes. An element is like a single frame in a movie: it represents the UI at a certain point in time.
4850

49-
With our knowledge so far, the only way to update the UI is to create a new element, and pass it to `ReactDOM.render()`.
51+
وبهذا القدر البسيط من المعرفة التي امتلكناها لحد الآن, فإن الطريقة الوحيدة لتحديث واجهة المستخدم تتم من خلال إنشاء عنصر جديد, ومن ثم تمريره إلى `ReactDOM.render()`.
5052

51-
Consider this ticking clock example:
53+
خذ على سبيل المثال هذه الساعة الداقة:
5254

5355
`embed:rendering-elements/update-rendered-element.js`
5456

5557
[](codepen://rendering-elements/update-rendered-element)
5658

57-
It calls `ReactDOM.render()` every second from a [`setInterval()`](https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setInterval) callback.
5859

59-
>**Note:**
60+
حيث تقوم بمناداة `ReactDOM.render()` كل ثانية من خلال رد النداء [`setInterval()`](https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setInterval).
61+
62+
>**ملاحظة:**
6063
>
61-
>In practice, most React apps only call `ReactDOM.render()` once. In the next sections we will learn how such code gets encapsulated into [stateful components](/docs/state-and-lifecycle.html).
64+
>عملياً, معظم التطبيقات المبنية مع رياكت تقوم بنداء `ReactDOM.render()` مرة واحدة فقط. في القسم التالي سنعرف أكثر عن كم الشيفرة التي يتم تغليفها إلى [مكوًن صنف](/docs/state-and-lifecycle.html).
6265
>
63-
>We recommend that you don't skip topics because they build on each other.
66+
>نقترح عليك بألا تتخطى أية من المواضيع, لأنها تبني على بعضها البعض.
67+
6468

65-
## React Only Updates What's Necessary {#react-only-updates-whats-necessary}
69+
## يحدث رياكت واجهة المستخدم فقط عندما تدعو الحاجة لذلك {#react-only-updates-whats-necessary}
6670

67-
React DOM compares the element and its children to the previous one, and only applies the DOM updates necessary to bring the DOM to the desired state.
71+
يقارن ReactDOM العنصر وأبنائه مع سابقه, ويقوم يتطبيق تحديثات DOM الضرورية لتحويل الـ DOM إلى الحالة المرغوب بها.
6872

69-
You can verify by inspecting the [last example](codepen://rendering-elements/update-rendered-element) with the browser tools:
73+
74+
تستطيع تأكيد ذلك من خلال تفحص [المثال الأخير](codepen://rendering-elements/update-rendered-element) باستخدام أدوات المتصفح:
7075

7176
![DOM inspector showing granular updates](../images/docs/granular-dom-updates.gif)
7277

73-
Even though we create an element describing the whole UI tree on every tick, only the text node whose contents has changed gets updated by React DOM.
7478

75-
In our experience, thinking about how the UI should look at any given moment rather than how to change it over time eliminates a whole class of bugs.
79+
بالرغم من أننا ننشئ عنصراً يصف شجرة واجهة المستخدم بأكملها عند كل دقة ساعة, فإن ما يتم تحديثه بواسطة ReactDOM ما هو إلا عقدة النص التي تغيرت محتوياتها.
80+
81+
بحسب خبرتنا, التفكير بالكيفية التي ستبدو عليها واجهة المستخدم في أي لحظة من الزمان بدل التفكير بآلية تغييرها بمرور الوقت يقضي على العديد من الأخطاء البرمجية bugs.

src/components/CodeEditor/CodeEditor.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ class CodeEditor extends Component {
6565
لم يتم تحميل Babel
6666
<br />
6767
<br />
68-
يمكن أن يحدث هذا بسبب تطبيقات منع الإعلانات. إن كنت تستعمل أحدها، أضف reactjs.org
69-
إلى قائمة المواقع المسموح لها حتى تتمكن من تشغيل أمثلة الشيفرة البرمجية.
68+
يمكن أن يحدث هذا بسبب تطبيقات منع الإعلانات. إن كنت تستعمل أحدها، أضف
69+
reactjs.org إلى قائمة المواقع المسموح لها حتى تتمكن من تشغيل أمثلة
70+
الشيفرة البرمجية.
7071
</span>
7172
);
7273
} else if (error != null) {

src/components/ErrorDecoder/ErrorDecoder.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ function ErrorResult(props: {|code: ?string, msg: string|}) {
6969
if (!code) {
7070
return (
7171
<p>
72-
عندما تُواجه خطأ ما، سيتمّ تحويلك إلى هذه الصفحة الخاصة بذلك الخطأ بالتحديد
73-
وسنعرض لك نص رسالة الخطأ بالكامل.
72+
عندما تُواجه خطأ ما، سيتمّ تحويلك إلى هذه الصفحة الخاصة بذلك الخطأ
73+
بالتحديد وسنعرض لك نص رسالة الخطأ بالكامل.
7474
</p>
7575
);
7676
}

0 commit comments

Comments
 (0)