Skip to content

Commit f9e644c

Browse files
docs(ar): translate RSC reference, rules of React, preconnect/prefetchDNS
Made-with: Cursor
1 parent 6d111b4 commit f9e644c

10 files changed

Lines changed: 383 additions & 384 deletions

src/content/reference/react-dom/preconnect.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: preconnect
44

55
<Intro>
66

7-
`preconnect` lets you eagerly connect to a server that you expect to load resources from.
7+
`preconnect` يتيح لك الاتصال مسبقاً بخادم تتوقع تحميل موارد منه.
88

99
```js
1010
preconnect("https://example.com");
@@ -16,11 +16,11 @@ preconnect("https://example.com");
1616

1717
---
1818

19-
## Reference {/*reference*/}
19+
## المرجع {/*reference*/}
2020

2121
### `preconnect(href)` {/*preconnect*/}
2222

23-
To preconnect to a host, call the `preconnect` function from `react-dom`.
23+
للاتصال المسبق بمضيف، استدعِ الدالة `preconnect` من `react-dom`.
2424

2525
```js
2626
import { preconnect } from 'react-dom';
@@ -32,34 +32,34 @@ function AppRoot() {
3232

3333
```
3434

35-
[See more examples below.](#usage)
35+
[المزيد من الأمثلة أدناه.](#usage)
3636

37-
The `preconnect` function provides the browser with a hint that it should open a connection to the given server. If the browser chooses to do so, this can speed up the loading of resources from that server.
37+
توفّر `preconnect` للمتصفّح تلميحاً بأن يفتح اتصالاً بالخادم المحدّد. إن اختار المتصفّح ذلك، قد يسرّع تحميل الموارد من ذلك الخادم.
3838

39-
#### Parameters {/*parameters*/}
39+
#### المعاملات {/*parameters*/}
4040

41-
* `href`: a string. The URL of the server you want to connect to.
41+
* `href`: سلسلة نصية. عنوان URL للخادم الذي تريد الاتصال به.
4242

4343

44-
#### Returns {/*returns*/}
44+
#### القيمة المُرجَعة {/*returns*/}
4545

46-
`preconnect` returns nothing.
46+
لا تُرجِع `preconnect` شيئاً.
4747

48-
#### Caveats {/*caveats*/}
48+
#### ملاحظات {/*caveats*/}
4949

50-
* Multiple calls to `preconnect` with the same server have the same effect as a single call.
51-
* In the browser, you can call `preconnect` in any situation: while rendering a component, in an Effect, in an event handler, and so on.
52-
* In server-side rendering or when rendering Server Components, `preconnect` only has an effect if you call it while rendering a component or in an async context originating from rendering a component. Any other calls will be ignored.
53-
* If you know the specific resources you'll need, you can call [other functions](/reference/react-dom/#resource-preloading-apis) instead that will start loading the resources right away.
54-
* There is no benefit to preconnecting to the same server the webpage itself is hosted from because it's already been connected to by the time the hint would be given.
50+
* عدة استدعاءات لـ `preconnect` لنفس الخادم لها نفس أثر استدعاء واحد.
51+
* في المتصفّح يمكن استدعاء `preconnect` في أي موضع: أثناء تصيير مكوّن، أو في Effect، أو في معالج حدث، إلخ.
52+
* في التصيير على الخادم أو عند تصيير مكوّنات الخادم، لا يكون لـ `preconnect` أثر إلا إذا استُدعي أثناء تصيير مكوّن أو في سياق async منبثق من تصيير مكوّن. تُتجاهل أي استدعاءات أخرى.
53+
* إن كنت تعرف الموارد المحدّدة التي تحتاجها، يمكنك استدعاء [دوال أخرى](/reference/react-dom/#resource-preloading-apis) تبدأ تحميل الموارد فوراً.
54+
* لا فائدة من الاتصال المسبق بنفس الخادم الذي يستضيف الصفحة لأن الاتصال قائم بالفعل قبل أن يُعطى التلميح.
5555

5656
---
5757

58-
## Usage {/*usage*/}
58+
## الاستخدام {/*usage*/}
5959

60-
### Preconnecting when rendering {/*preconnecting-when-rendering*/}
60+
### الاتصال المسبق أثناء التصيير {/*preconnecting-when-rendering*/}
6161

62-
Call `preconnect` when rendering a component if you know that its children will load external resources from that host.
62+
استدعِ `preconnect` أثناء تصيير مكوّن إن كنت تعلم أن الأبناء سيحمّلون موارد خارجية من ذلك المضيف.
6363

6464
```js
6565
import { preconnect } from 'react-dom';
@@ -70,9 +70,9 @@ function AppRoot() {
7070
}
7171
```
7272

73-
### Preconnecting in an event handler {/*preconnecting-in-an-event-handler*/}
73+
### الاتصال المسبق في معالج حدث {/*preconnecting-in-an-event-handler*/}
7474

75-
Call `preconnect` in an event handler before transitioning to a page or state where external resources will be needed. This gets the process started earlier than if you call it during the rendering of the new page or state.
75+
استدعِ `preconnect` في معالج حدث قبل الانتقال إلى صفحة أو حالة سيُحمّل فيها موارد خارجية. يبدأ ذلك مبكراً أكثر من الاستدعاء أثناء تصيير الصفحة أو الحالة الجديدة.
7676

7777
```js
7878
import { preconnect } from 'react-dom';

src/content/reference/react-dom/prefetchDNS.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: prefetchDNS
44

55
<Intro>
66

7-
`prefetchDNS` lets you eagerly look up the IP of a server that you expect to load resources from.
7+
`prefetchDNS` يتيح لك البحث المسبق عن عنوان IP لخادم تتوقع تحميل موارد منه.
88

99
```js
1010
prefetchDNS("https://example.com");
@@ -16,11 +16,11 @@ prefetchDNS("https://example.com");
1616

1717
---
1818

19-
## Reference {/*reference*/}
19+
## المرجع {/*reference*/}
2020

2121
### `prefetchDNS(href)` {/*prefetchdns*/}
2222

23-
To look up a host, call the `prefetchDNS` function from `react-dom`.
23+
للبحث عن مضيف، استدعِ الدالة `prefetchDNS` من `react-dom`.
2424

2525
```js
2626
import { prefetchDNS } from 'react-dom';
@@ -32,34 +32,34 @@ function AppRoot() {
3232

3333
```
3434

35-
[See more examples below.](#usage)
35+
[المزيد من الأمثلة أدناه.](#usage)
3636

37-
The prefetchDNS function provides the browser with a hint that it should look up the IP address of a given server. If the browser chooses to do so, this can speed up the loading of resources from that server.
37+
توفّر `prefetchDNS` للمتصفّح تلميحاً بأن يبحث عن عنوان IP لخادم معيّن. إن اختار المتصفّح ذلك، قد يسرّع تحميل الموارد من ذلك الخادم.
3838

39-
#### Parameters {/*parameters*/}
39+
#### المعاملات {/*parameters*/}
4040

41-
* `href`: a string. The URL of the server you want to connect to.
41+
* `href`: سلسلة نصية. عنوان URL للخادم.
4242

43-
#### Returns {/*returns*/}
43+
#### القيمة المُرجَعة {/*returns*/}
4444

45-
`prefetchDNS` returns nothing.
45+
لا تُرجِع `prefetchDNS` شيئاً.
4646

47-
#### Caveats {/*caveats*/}
47+
#### ملاحظات {/*caveats*/}
4848

49-
* Multiple calls to `prefetchDNS` with the same server have the same effect as a single call.
50-
* In the browser, you can call `prefetchDNS` in any situation: while rendering a component, in an Effect, in an event handler, and so on.
51-
* In server-side rendering or when rendering Server Components, `prefetchDNS` only has an effect if you call it while rendering a component or in an async context originating from rendering a component. Any other calls will be ignored.
52-
* If you know the specific resources you'll need, you can call [other functions](/reference/react-dom/#resource-preloading-apis) instead that will start loading the resources right away.
53-
* There is no benefit to prefetching the same server the webpage itself is hosted from because it's already been looked up by the time the hint would be given.
54-
* Compared with [`preconnect`](/reference/react-dom/preconnect), `prefetchDNS` may be better if you are speculatively connecting to a large number of domains, in which case the overhead of preconnections might outweigh the benefit.
49+
* عدة استدعاءات لـ `prefetchDNS` لنفس الخادم لها نفس أثر استدعاء واحد.
50+
* في المتصفّح يمكن استدعاء `prefetchDNS` في أي موضع: أثناء تصيير مكوّن، أو في Effect، أو في معالج حدث، إلخ.
51+
* في التصيير على الخادم أو عند تصيير مكوّنات الخادم، لا يكون لـ `prefetchDNS` أثر إلا إذا استُدعي أثناء تصيير مكوّن أو في سياق async منبثق من تصيير مكوّن. تُتجاهل أي استدعاءات أخرى.
52+
* إن كنت تعرف الموارد المحدّدة، يمكنك استدعاء [دوال أخرى](/reference/react-dom/#resource-preloading-apis) تبدأ التحميل فوراً.
53+
* لا فائدة من prefetch لنفس خادم الصفحة لأن البحث قد تم بالفعل.
54+
* مقارنةً بـ [`preconnect`](/reference/react-dom/preconnect)، قد يكون `prefetchDNS` أفضل إذا اتصلت تخمينياً بعدد كبير من النطاقات، حيث قد يفوق عبء الاتصالات المسبقة الفائدة.
5555

5656
---
5757

58-
## Usage {/*usage*/}
58+
## الاستخدام {/*usage*/}
5959

60-
### Prefetching DNS when rendering {/*prefetching-dns-when-rendering*/}
60+
### prefetch لـ DNS أثناء التصيير {/*prefetching-dns-when-rendering*/}
6161

62-
Call `prefetchDNS` when rendering a component if you know that its children will load external resources from that host.
62+
استدعِ `prefetchDNS` أثناء تصيير مكوّن إن كنت تعلم أن الأبناء سيحمّلون موارد من ذلك المضيف.
6363

6464
```js
6565
import { prefetchDNS } from 'react-dom';
@@ -70,9 +70,9 @@ function AppRoot() {
7070
}
7171
```
7272

73-
### Prefetching DNS in an event handler {/*prefetching-dns-in-an-event-handler*/}
73+
### prefetch لـ DNS في معالج حدث {/*prefetching-dns-in-an-event-handler*/}
7474

75-
Call `prefetchDNS` in an event handler before transitioning to a page or state where external resources will be needed. This gets the process started earlier than if you call it during the rendering of the new page or state.
75+
استدعِ `prefetchDNS` في معالج حدث قبل الانتقال إلى صفحة أو حالة سيُحمّل فيها موارد خارجية.
7676

7777
```js
7878
import { prefetchDNS } from 'react-dom';

src/content/reference/rsc/directives.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ title: "التوجيهات (Directives)"
44

55
<RSC>
66

7-
Directives are for use in [React Server Components](/reference/rsc/server-components).
7+
التوجيهات مخصّصة للاستخدام مع [مكوّنات خادم React](/reference/rsc/server-components).
88

99
</RSC>
1010

1111
<Intro>
1212

13-
تستخدم React علامتي توجيه، لإعلام أدوات التجميع (bundlers) بأن ملفاتك تحتوي على [مكونات من جانب الخادم RSC](/learn/creating-a-react-app#full-stack-frameworks)، والتعليمات اللازمة لذلك.
13+
تستخدم React علامتي توجيه لإعلام أدوات التجميع (bundlers) بأن ملفاتك تحتوي على [مكوّنات خادم React (RSC)](/learn/creating-a-react-app#full-stack-frameworks)، والتعليمات اللازمة لذلك.
1414
</Intro>
1515

1616
---
1717

18-
## توجيهات الكود {/*source-code-directives*/}
18+
## توجيهات الشيفرة {/*source-code-directives*/}
1919

20-
* [`'use client'`](/reference/rsc/use-client) تميز الملف بأن ما فيه مكون من جانب العميل (client-side).
21-
* [`'use server'`](/reference/rsc/use-server) تميز الدوال من جانب الخادم (server-side) التي يمكن استدعاؤها من الكود من جانب العميل (client-side).
20+
* [`'use client'`](/reference/rsc/use-client) يوسّم الملف بأن ما فيه يُنفَّذ على جانب العميل (client).
21+
* [`'use server'`](/reference/rsc/use-server) يوسّم الدوال التي تعمل على الخادم ويمكن استدعاؤها من شيفرة العميل.

0 commit comments

Comments
 (0)