Skip to content

Commit cd42b29

Browse files
authored
Merge pull request #5 from javascript-tutorial/master
Merge latest updates
2 parents d57c017 + 9661ffb commit cd42b29

88 files changed

Lines changed: 2206 additions & 2172 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,46 @@
1-
# Code editors
1+
# محررات الأكواد
22

3-
A code editor is the place where programmers spend most of their time.
3+
محرر الأكواد هو المكان الذي يقضي فيه المبرمجون معظم وقتهم.
44

5-
There are two main types of code editors: IDEs and lightweight editors. Many people use one tool of each type.
5+
يوجد نوعين من محررات الأكواد: IDEs ( بيئة التطوير الكاملة)و المحررات البسيطة. العديد من الناس يستخدمون أداة واحدة لكل نوع.
66

77
## IDE
88

9-
The term [IDE](https://en.wikipedia.org/wiki/Integrated_development_environment) (Integrated Development Environment) refers to a powerful editor with many features that usually operates on a "whole project." As the name suggests, it's not just an editor, but a full-scale "development environment."
9+
مصطلح [IDE](https://en.wikipedia.org/wiki/Integrated_development_environment) (Integrated Development Environment) يشير إلى محرر بإمكانات هائلة، مع العديد من المميزات التي تعمل عادة على " مشروع كامل". كما يوحي الاسم، فهو ليس مجرد محرر أكواد، ولكنه "بيئة تطوير" واسعة النطاق.
1010

11-
An IDE loads the project (which can be many files), allows navigation between files, provides autocompletion based on the whole project (not just the open file), and integrates with a version management system (like [git](https://git-scm.com/)), a testing environment, and other "project-level" stuff.
11+
IDE تقوم بتحميل المشروع ) الذي يمكن أن يتكون من العديد من الملفات)، ويسمح بالتنقل بين الملفات، ويوفر خاصة الإكمال التلقائي المعتمدة على المشروع ككل ( وليس الملف المفتوح فقط) , كما أنه يمكن أن يرتبط مع أنظمة إدارة الإصدار (مثل [git](https://git-scm.com/)), وبيئة الاختبار, وغيرها من الأشياء على مستوى المشروع.
1212

13-
If you haven't selected an IDE yet, consider the following options:
13+
إذا لم تقم باختيار IDE بعد ، ففكر في الخيارات التالية:
1414

15-
- [Visual Studio Code](https://code.visualstudio.com/) (cross-platform, free).
16-
- [WebStorm](http://www.jetbrains.com/webstorm/) (cross-platform, paid).
15+
- [فيجوال ستديو كود](https://code.visualstudio.com/) (يعمل على أكثر من نظام تشغيل, مجاني).
16+
- [ويب ستورم](http://www.jetbrains.com/webstorm/) (يعمل على أكثر من نظام تشغيل, مدفوع).
1717

18-
For Windows, there's also "Visual Studio", not to be confused with "Visual Studio Code". "Visual Studio" is a paid and mighty Windows-only editor, well-suited for the .NET platform. It's also good at JavaScript. There's also a free version [Visual Studio Community](https://www.visualstudio.com/vs/community/).
18+
بالنسبة للويندوز، يمكن استخدام برنامج فيجوال ستديو، لايجب الخلط بينه وبين الفيجوال ستديو كود، فيجوال ستديو هو محرر مدفوع يعمل على نظام ويندوز فقك، ومناسب تماماً لبيئة الدوت نت. أنه أيضاً جيد للجافاسكريبت. كما يوجد إصدار مجاني منه [Visual Studio Community](https://www.visualstudio.com/vs/community/).
1919

20-
Many IDEs are paid, but have a trial period. Their cost is usually negligible compared to a qualified developer's salary, so just choose the best one for you.
20+
.عادة ما تكون تكلفتها ضئيلة للغاية مقارنة براتب المطور المؤهل ، لذلك فقط اختر الأفضل بالنسبة لك.العديد من بيئات التطوير مدفوعة، لكن لها فترة سماحية
2121

22-
## Lightweight editors
22+
## المحررات البسيطة
2323

24-
"Lightweight editors" are not as powerful as IDEs, but they're fast, elegant and simple.
24+
المحررات البسيطة" ليست بقوة ال" IDEs لكنها سريعة, وأنيقة وبسيطة
2525

26-
They are mainly used to open and edit a file instantly.
26+
يتم استخدامها بشكل رئيسي لفتح وتحرير ملف على الفور.
2727

28-
The main difference between a "lightweight editor" and an "IDE" is that an IDE works on a project-level, so it loads much more data on start, analyzes the project structure if needed and so on. A lightweight editor is much faster if we need only one file.
28+
الفارق الرئيسي بين المحررات البسيطة و "بيئة التطوير" هو أن بيئة التطوير تعمل على مستوى المشروع، لذلك فإنها تقوم بتحميل المزيد من البيانات عند البدء، وتحليل هيكل المشروع إذا لزم ذلك. أما المحررات البسيطة فإنها أسرع في حال نريد ملف واحد فقط.
2929

30-
In practice, lightweight editors may have a lot of plugins including directory-level syntax analyzers and autocompleters, so there's no strict border between a lightweight editor and an IDE.
30+
من الناحية العملية ، قد تحتوي المحررات البسيطة على الكثير من المكونات الإضافية بما في ذلك محللات بناء الجملة على مستوى الدليل وأجهزة الإكمال التلقائي ، لذلك لا توجد حدود صارمة بين المحرر البسيط و IDE.
3131

32-
The following options deserve your attention:
32+
الخيارات التالية تستحق انتباهك:
3333

34-
- [Atom](https://atom.io/) (cross-platform, free).
35-
- [Visual Studio Code](https://code.visualstudio.com/) (cross-platform, free).
36-
- [Sublime Text](http://www.sublimetext.com) (cross-platform, shareware).
37-
- [Notepad++](https://notepad-plus-plus.org/) (Windows, free).
38-
- [Vim](http://www.vim.org/) and [Emacs](https://www.gnu.org/software/emacs/) are also cool if you know how to use them.
34+
- [Atom](https://atom.io/) (يعمل على العديد من أنظمة التشغيل, مجاني).
35+
- [Visual Studio Code](https://code.visualstudio.com/) (يعمل على العديد من أنظمة التشغيل, مجاني).
36+
- [Sublime Text](http://www.sublimetext.com) (يعمل على العديد من أنظمة التشغيل, برنامج مشاركة).
37+
- [Notepad++](https://notepad-plus-plus.org/) (الويندوز, مجاني).
38+
- [Vim](http://www.vim.org/) و [Emacs](https://www.gnu.org/software/emacs/) رائعة إذا كنت تعرف كيفية استخدامها.
3939

40-
## Let's not argue
40+
## دعونا لانتشاجر
4141

42-
The editors in the lists above are those that either I or my friends whom I consider good developers have been using for a long time and are happy with.
42+
المحررات التي بالقائمة الأعلى هي التي نقوم باستخدامها أنا وأصدقائي، والذين أعتقد أنهم مطورون جيدون يستخدمونها منذ وقت طويل وتسعدهم.
4343

44-
There are other great editors in our big world. Please choose the one you like the most.
44+
يوجد أيضاً محررات رائعة في عالمنا الكبير، الرجاء اختيار المحرر الذي تفضله.
4545

46-
The choice of an editor, like any other tool, is individual and depends on your projects, habits, and personal preferences.
46+
اختيار المحرر، مثل أي أداة أخرى، هو اختيار فردي ويعتمد على مشروعاتك، وعاداتك، وتفضيلاتك الشخصية.

1-js/01-getting-started/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# مقدمة
22

3-
عن لغة جافا سكريبت و البيئة التي تُطَوّرْ بها.
3+
عن لغة جافا سكريبت والبيئة التي تُطَوّرْ بها.
Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
# Hello, world!
1+
# أهلاً, بالعالم!
22

3-
This part of the tutorial is about core JavaScript, the language itself.
3+
هذا الجزء من البرنامج التعليمي عن أساسيات لغة الجافا سكريبت، اللغة نفسها.
44

5-
But we need a working environment to run our scripts and, since this book is online, the browser is a good choice. We'll keep the amount of browser-specific commands (like `alert`) to a minimum so that you don't spend time on them if you plan to concentrate on another environment (like Node.js). We'll focus on JavaScript in the browser in the [next part](/ui) of the tutorial.
5+
لكن نحتاج إلى بيئة عمل من أجل تشغيل النصوص الخاصة بنا، وبما أن هذا الكتاب عبر الانترنت، لذافإن المتصفح خيار جيد.سوف نقوم بالاحتفاظ بالأوامر الخاصة بالمتصفح (مثل `alert`) للحد الأدنى بحيث لا تقضي وقتًا عليها إذا كنت تخطط للتركيز على بيئة أخرى (مثل Node.js). سوف نركز على الجافا سكريبت في المتصفح [الجزء التالي](/ui) من البرنامج التعليمي.
66

7-
So first, let's see how we attach a script to a webpage. For server-side environments (like Node.js), you can execute the script with a command like `"node my.js"`.
7+
لذا أولاً, دعونا نرفق نص برمجي في صفحة الويب. بالنسبة للبيئات التي تعمل على الخوادم (مثل Node.js), يمكنك تنفيذها من خلال استخدام أمر مثل `"node my.js"`.
88

99

10-
## The "script" tag
10+
## الوسم "script"
1111

12-
JavaScript programs can be inserted into any part of an HTML document with the help of the `<script>` tag.
12+
يمكن وضع برامج الجافاسكريبت في أي جزء في مستند HTML باستخدام وسم`<script>`.
1313

14-
For instance:
14+
على سبيل المثال:
1515

1616
```html run height=100
1717
<!DOCTYPE HTML>
@@ -23,7 +23,7 @@ For instance:
2323

2424
*!*
2525
<script>
26-
alert( 'Hello, world!' );
26+
alert( 'أهلاً, بالعالم!' );
2727
</script>
2828
*/!*
2929

@@ -35,53 +35,53 @@ For instance:
3535
```
3636

3737
```online
38-
You can run the example by clicking the "Play" button in the right-top corner of the box above.
38+
يمكن أن تقوم بتشغيل المثال بالضغط على زر "تشغيل" في الجانب الأيمن العلوي بالمربع الأعلى.
3939
```
4040

41-
The `<script>` tag contains JavaScript code which is automatically executed when the browser processes the tag.
41+
الوسم `<script>` يحتوي على شفرات جافاسكريبت التي يمكن أن تُنفذ بشكل تلقائي عندما يقوم المتصفح بمعالجة الوسم.
4242

4343

44-
## Modern markup
44+
## الترميز الحديث
4545

46-
The `<script>` tag has a few attributes that are rarely used nowadays but can still be found in old code:
46+
الوسم `<script>` يحتوي على بعض الخصائص التي نادراً مايتم استخدامها في وقتنا الحاضر، لكن يمكن أن تجدها في الشفرات البرمجية القديمة:
4747

48-
The `type` attribute: <code>&lt;script <u>type</u>=...&gt;</code>
49-
: The old HTML standard, HTML4, required a script to have a `type`. Usually it was `type="text/javascript"`. It's not required anymore. Also, the modern HTML standard totally changed the meaning of this attribute. Now, it can be used for JavaScript modules. But that's an advanced topic, we'll talk about modules in another part of the tutorial.
48+
الخاصية `type`: <code>&lt;script <u>type</u>=...&gt;</code>
49+
: معيار HTML القديم, HTML4, يتطلب أن يحتوي وسم script على `type`. عادة ما كان `type="text/javascript"`. لم تعد مطلوبة الآن. وأيضاً,معايير HTML الحديثةغيرت معني هذه الخاصية. والآن، يمكن أن تستخدم لوحدات الجافا سكريبت. لكن هذا الموضوع متقدم، وسنتحدث عن الوحدات في جزءآخر من البرنامج التعليمي.
5050

51-
The `language` attribute: <code>&lt;script <u>language</u>=...&gt;</code>
52-
: This attribute was meant to show the language of the script. This attribute no longer makes sense because JavaScript is the default language. There is no need to use it.
51+
الخاصية `language`: <code>&lt;script <u>language</u>=...&gt;</code>
52+
: كان الغرض من استخدام هذه الخاصية هو إظهار لغة النص البرمجي، لم تعد هذه الخاصية منطقية الآن لأن الجافا سكريبت هي اللغة الافتراضية. فليست هناك حاجة لاستخدامها.
5353

54-
Comments before and after scripts.
55-
: In really ancient books and guides, you may find comments inside `<script>` tags, like this:
54+
التعليقات قبل وبعد النصوص البرمجية.
55+
: في الكتب والأدلة القديمة جداً، قد تجد تعليقات داخل وسم `<script>` , مثل هذا:
5656

5757
```html no-beautify
5858
<script type="text/javascript"><!--
5959
...
6060
//--></script>
6161
```
6262

63-
This trick isn't used in modern JavaScript. These comments hide JavaScript code from old browsers that didn't know how to process the `<script>` tag. Since browsers released in the last 15 years don't have this issue, this kind of comment can help you identify really old code.
63+
لاستم استخدام هذه الخدعة في الجافاسكريبت الحديثة. تخفي هذه التعليقات شفرات الجافاسكريبت في المتصفحات القديمة التي لاتعرف كيفية عمل معالجة للوسم `<script>. نظراً لأن المتصحات التي تم إصدارها في آخر 15 عاماً لاتوجد فيها هذه المشكلة، فإن هذا النوع من التعليقات يمكن أن يساعدك في تحديد الشفرة القديمة حقاً.
6464

6565

66-
## External scripts
66+
## النصوص البرمجية الخارجية
6767

68-
If we have a lot of JavaScript code, we can put it into a separate file.
68+
إذا كان لدينا عدد كبير من أكواد الجافا سكريبت، فإننا يمكن أن نضعها في ملف منفصل.
6969

70-
Script files are attached to HTML with the `src` attribute:
70+
يتم إرفاق ملفات النصوص البرمجية HTML باستخدام خاصية `src` :
7171

7272
```html
7373
<script src="/path/to/script.js"></script>
7474
```
7575

76-
Here, `/path/to/script.js` is an absolute path to the script from the site root. One can also provide a relative path from the current page. For instance, `src="script.js"` would mean a file `"script.js"` in the current folder.
76+
هنا, `/path/to/script.js` هو مسار منفرد للنص البرمجي من جذر الموقع. يمكن أيضاً توفير مسار نسبي من خلال الصفحة الحالية.. على سبيل المثال، `src="script.js"` تعني أن الملف `"script.js"` في نفس المجلد.
7777

78-
We can give a full URL as well. For instance:
78+
يمكن أن نعطي المسار الكامل أيضاً. على سبيل المثال :
7979

8080
```html
8181
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.js"></script>
8282
```
8383

84-
To attach several scripts, use multiple tags:
84+
لكي نرفق العديد من النصوص البرمجية، استخدم To attach several scripts, use الوسوم بصورة مضاعفة:
8585

8686
```html
8787
<script src="/js/script1.js"></script>
@@ -90,29 +90,29 @@ To attach several scripts, use multiple tags:
9090
```
9191

9292
```smart
93-
As a rule, only the simplest scripts are put into HTML. More complex ones reside in separate files.
93+
كقاعدة، يتم وضع النصوص البرمجية البسيطة داخل HTML. والنصوص المعقدة يتم وضعها في ملفات منفصلة.
9494
95-
The benefit of a separate file is that the browser will download it and store it in its [cache](https://en.wikipedia.org/wiki/Web_cache).
95+
فائدة الملفات المنفصلة هي أن المتصفح يقوم بتحميلهاوتخزينها في[ذاكرة التخزين المؤقتة](https://en.wikipedia.org/wiki/Web_cache).
9696
97-
Other pages that reference the same script will take it from the cache instead of downloading it, so the file is actually downloaded only once.
97+
الصفحات الأخرى التي تشير إلى نفس النص البرمجي سوف تحصل عليه من ذاكرة التخزين المؤقتة بدلاً من تنزيله، لذا فإن الملف يتم تحميله مرة واحدة.
9898
99-
That reduces traffic and makes pages faster.
99+
هذا يقلل من الحركة ويجعل الصفحات تكون أسرع.
100100
```
101101

102-
````warn header="If `src` is set, the script content is ignored."
103-
A single `<script>` tag can't have both the `src` attribute and code inside.
102+
````warn header="إذا `src` تم تعيين, يتم تجاهل محتوى النص البرمجي."
103+
وسم `<script>` منفرداً لايمكن أن يحتوي على خاصية `src` والكود بداخله.
104104

105-
This won't work:
105+
هذا لايعمل:
106106

107107
```html
108108
<script *!*src*/!*="file.js">
109109
alert(1); // the content is ignored, because src is set
110110
</script>
111111
```
112112

113-
We must choose either an external `<script src="…">` or a regular `<script>` with code.
113+
يجب اختيار إما خارجي `<script src="…">` أو عادي `<script>` باستخدام الكود.
114114

115-
The example above can be split into two scripts to work:
115+
يمكن تقسيم المثال أعلاه إلى نصين برمجيين لكي يعمل:
116116

117117
```html
118118
<script src="file.js"></script>
@@ -122,11 +122,11 @@ The example above can be split into two scripts to work:
122122
```
123123
````
124124
125-
## Summary
125+
## ملخص
126126
127-
- We can use a `<script>` tag to add JavaScript code to a page.
128-
- The `type` and `language` attributes are not required.
129-
- A script in an external file can be inserted with `<script src="path/to/script.js"></script>`.
127+
- يمكن استخدام وسم `<script>` لإضافة كود الجافا سكريبت إلى صفحة.
128+
- الخصائص `type` و `language` غير مطلوبة.
129+
- يمكن إدراج النص البرمجي في ملف خارجي باستخدام `<script src="path/to/script.js"></script>`.
130130
131131
132-
There is much more to learn about browser scripts and their interaction with the webpage. But let's keep in mind that this part of the tutorial is devoted to the JavaScript language, so we shouldn't distract ourselves with browser-specific implementations of it. We'll be using the browser as a way to run JavaScript, which is very convenient for online reading, but only one of many.
132+
هناك الكثير لتتعلمه عن نصوص المتصفح البرمجية وتفاعلها مع صفحة الويب. ولكن دعنا نضع في اعتبارنا أن هذا الجزء من البرنامج التعليمي مخصص للغة جافا سكريبت ، لذلك لا ينبغي أن نشتت انتباهنا بالتطبيقات الخاصة بالمتصفح. سنستخدم المتصفح كوسيلة لتشغيل جافا سكريبت ، وهو مناسب جدًا للقراءة عبر الإنترنت ، ولكن واحدًا فقط من بين العديد.

0 commit comments

Comments
 (0)