Skip to content

Commit b51c092

Browse files
committed
translate using a component and what the browser sees
1 parent 23c8a28 commit b51c092

2 files changed

Lines changed: 19 additions & 16 deletions

File tree

src/components/Layout/Page.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ export function Page({children, toc, routeTree, meta, section}: PageProps) {
135135
<Suspense fallback={null}>
136136
<main className="min-w-0 isolate">
137137
<article
138+
dir="rtl"
138139
className="break-words font-normal text-primary dark:text-primary-dark"
139140
key={asPath}>
140141
{content}

src/content/learn/your-first-component.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ title: مكوّنك الأول
2525
<h1>مكوّني الأول</h1>
2626
<ol>
2727
<li>المكوّنات: حجر بناء واجهة المستخدم</li>
28-
<li>تعريف مكوّن</li>
29-
<li>إستخدام مكوّن</li>
28+
<li>تعريف المكوّن</li>
29+
<li>إستخدام المكوّن</li>
3030
</ol>
3131
</article>
3232
```
@@ -53,7 +53,7 @@ title: مكوّنك الأول
5353

5454
مع نمو مشروعك, ستلاحظ انه يمكن تجميع العديد من تصاميمك بواسطة إعادة استخدام مكوّنات كتبتها مسبقا, مما يسرع عملية التطوير. يمكن إضافة فهرس المحتويات أعلاه الى أي شاشة عن طريق `<TableOfContents />`! يمكنك أيضا الإنطلاق بسرعة في مشروعك باستخدام آلاف المكوّنات المشتركة من قبل مجتمع React مفتوحة المصدر مثل [Chakra UI](https://chakra-ui.com/) و [Material UI.](https://material-ui.com/).
5555

56-
## تعريف مكوّن {/*defining-a-component*/}
56+
## تعريف المكوّن {/*defining-a-component*/}
5757

5858
تقليديًا، عند إنشاء صفحات الويب، يقوم مطورو الويب بترميز المحتوى الخاص بهم ومن ثم يضيفون التفاعل عن طريق إضافة بعض JavaScript. نجح هذا بشكل رائع عندما كان التفاعل مجرد ميزة اضافية جيدة على الويب. الآن يُتوقع وجود التفاعل في العديد من المواقع وجميع التطبيقات. تضع React التفاعلية في المقام الأول مع الاستمرار في استخدام نفس التقنية: **مكوّن React هو دالة JavaScript يمكنك أن تُضف إليها ترميز مرئي.** هنا مثال لذلك (يمكنك تحرير المثال أدناه):
5959

@@ -118,9 +118,9 @@ return (
118118

119119
</Pitfall>
120120

121-
## Using a component {/*using-a-component*/}
121+
## استخدام المكوّن {/*using-a-component*/}
122122

123-
Now that you've defined your `Profile` component, you can nest it inside other components. For example, you can export a `Gallery` component that uses multiple `Profile` components:
123+
الآن بعد تعريفك لمكون `Profile`، يمكنك تضمينه داخل مكوّنات أخرى. على سبيل المثال، يمكنك تصدير مكون `Gallery` الذي يستخدم عدة مكونات `Profile`:
124124

125125
<Sandpack>
126126

@@ -129,15 +129,15 @@ function Profile() {
129129
return (
130130
<img
131131
src="https://i.imgur.com/MK3eW3As.jpg"
132-
alt="Katherine Johnson"
132+
alt="كاثرين جونسون"
133133
/>
134134
);
135135
}
136136

137137
export default function Gallery() {
138138
return (
139139
<section>
140-
<h1>Amazing scientists</h1>
140+
<h1>علماء رائعون</h1>
141141
<Profile />
142142
<Profile />
143143
<Profile />
@@ -152,25 +152,27 @@ img { margin: 0 10px 10px 0; height: 90px; }
152152

153153
</Sandpack>
154154

155-
### What the browser sees {/*what-the-browser-sees*/}
155+
### ما يراه المتصفح {/*what-the-browser-sees*/}
156156

157-
Notice the difference in casing:
157+
لاحظ الفرق في حالة الأحرف:
158158

159-
* `<section>` is lowercase, so React knows we refer to an HTML tag.
160-
* `<Profile />` starts with a capital `P`, so React knows that we want to use our component called `Profile`.
159+
* `<section>` هو بحروف صغيرة، لذا تعرف React أننا نشير إلى وسم HTML.
160+
* `<Profile />` يبدأ بحرف `P` كبير, لذا تعرف React أننا نريد استخدام مكوّننا الذي إسمه `Profile`.
161161

162162
And `Profile` contains even more HTML: `<img />`. In the end, this is what the browser sees:
163163

164+
ومكوّن `Profile` يحتوي على المزيد من HTML:`<img />`. في النهاية, هذا ما يراه المتصفح:
165+
164166
```html
165167
<section>
166-
<h1>Amazing scientists</h1>
167-
<img src="https://i.imgur.com/MK3eW3As.jpg" alt="Katherine Johnson" />
168-
<img src="https://i.imgur.com/MK3eW3As.jpg" alt="Katherine Johnson" />
169-
<img src="https://i.imgur.com/MK3eW3As.jpg" alt="Katherine Johnson" />
168+
<h1>علماء رائعون</h1>
169+
<img src="https://i.imgur.com/MK3eW3As.jpg" alt="كاثرين جونسون" />
170+
<img src="https://i.imgur.com/MK3eW3As.jpg" alt="كاثرين جونسون" />
171+
<img src="https://i.imgur.com/MK3eW3As.jpg" alt="كاثرين جونسون" />
170172
</section>
171173
```
172174

173-
### Nesting and organizing components {/*nesting-and-organizing-components*/}
175+
### تضمين وتنظيم المكوّنات {/*nesting-and-organizing-components*/}
174176

175177
Components are regular JavaScript functions, so you can keep multiple components in the same file. This is convenient when components are relatively small or tightly related to each other. If this file gets crowded, you can always move `Profile` to a separate file. You will learn how to do this shortly on the [page about imports.](/learn/importing-and-exporting-components)
176178

0 commit comments

Comments
 (0)