Skip to content

Translated missed lines #315

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions 1-js/02-first-steps/01-hello-world/1-hello-alert/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ importance: 5

---

# Show an alert
# أظهر تحذير

Create a page that shows a message "I'm JavaScript!".
اكتب صفحة تعرض الرسالة "I'm JavaScript!".

Do it in a sandbox, or on your hard drive, doesn't matter, just ensure that it works.
قم بها في sandbox .او في قرصك المحلي , لا يهم , المهم ان تتأكد من عمله

[demo src="solution"]

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
The HTML code:
نص الـHTML:

[html src="index.html"]

For the file `alert.js` in the same folder:
من اجل الملف `alert.js` في نفس المجلد:

[js src="alert.js"]

6 changes: 3 additions & 3 deletions 1-js/02-first-steps/01-hello-world/2-hello-alert-ext/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ importance: 5

---

# Show an alert with an external script
# أظهر تحذير باستخدام سكريبت خارجي

Take the solution of the previous task <info:task/hello-alert>. Modify it by extracting the script content into an external file `alert.js`, residing in the same folder.
قم باخذ الحل السابق <info:task/hello-alert>. عدل عليه باستخراج محتوى السكريبت الى ملف خارجي `alert.js` , مع وضعه في نفس المجلد.

Open the page, ensure that the alert works.
أفتح الصفحة وتأكد من انه يعمل.
10 changes: 5 additions & 5 deletions 1-js/02-first-steps/01-hello-world/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@

<body>

<p>Before the script...</p>
<p>قبل السكريبت...</p>

*!*
<script>
alert( 'أهلاً، بالعالم!' );
</script>
*/!*

<p>...After the script.</p>
<p>...بعد السكريبت.</p>

</body>

Expand Down Expand Up @@ -60,7 +60,7 @@
//--></script>
```

لا يتم استخدام هذه الخدعة في جافا سكريبت الحديثة. تخفي هذه التعليقات شفرات جافا سكريبت في المتصفحات القديمة التي لاتعرف كيفية عمل معالجة للوسم `<script>. نظراً لأن المتصفحات التي تم إصدارها في آخر 15 عاماً لا توجد فيها هذه المشكلة، فإن هذا النوع من التعليقات يمكن أن يساعدك في تحديد الشفرة القديمة حقاً.
لا يتم استخدام هذه الخدعة في جافا سكريبت الحديثة. تخفي هذه التعليقات شفرات جافا سكريبت في المتصفحات القديمة التي لاتعرف كيفية عمل معالجة للوسم `<script>`. نظراً لأن المتصفحات التي تم إصدارها في آخر 15 عاماً لا توجد فيها هذه المشكلة، فإن هذا النوع من التعليقات يمكن أن يساعدك في تحديد الشفرة القديمة حقاً.


## النصوص البرمجية الخارجية
Expand All @@ -81,7 +81,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.js"></script>
```

لكي نرفق العديد من النصوص البرمجية، استخدم To attach several scripts، use الوسوم بصورة مضاعفة:
لكي نرفق العديد من النصوص البرمجية، استخدم الوسوم بصورة مضاعفة:

```html
<script src="/js/script1.js"></script>
Expand All @@ -106,7 +106,7 @@

```html
<script *!*src*/!*="file.js">
alert(1); // the content is ignored, because src is set
alert(1); // المحتوى يتم تجاهله, لأن المصدر تم تحديده
</script>
```

Expand Down
12 changes: 6 additions & 6 deletions 1-js/02-first-steps/04-variables/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,18 +135,18 @@ alert(hello); // Hello world!
alert(message); // Hello world!
```

````warn header="Declaring twice triggers an error"
A variable should be declared only once.
````warn header="يؤدي التعريف مرتين الى حدوث خطأ"
يجب تعريف المتغير مره واحدة فقط.

A repeated declaration of the same variable is an error:
التعريف المتكرر لنفس المتغير خطأ:

```js run
let message = "This";

// repeated 'let' leads to an error
// تكرار 'let' يؤدي الى خطأ
let message = "That"; // SyntaxError: 'message' has already been declared
```
So, we should declare a variable once and then refer to it without `let`.
اذا يجب علينا تعريف المتغير مرة واحدة ثم نشير اليه بدون استخدام `let`.
````

```smart header="Functional languages"
Expand Down Expand Up @@ -226,7 +226,7 @@ let return = 5; // وأيضا لا تستطيع تسميته "return", خطأ!
بشكل طبيعي, نحن نحتاج تعريف المتغير قبل أستخدامه. ولكن في الماضي ، كان من الممكن من الناحية الفنية إنشاء متغير بمجرد تخصيص القيمة بدون استخدام `let`. وهذه الطريقة مازالت تعمل حتي الان أذا لم نكتب `use strict` في الملفات ولكن للحصول علي توافق مع الكتابة القديمة.

```js run no-strict
// note: no "use strict" in this example
// لاحظ: لم نستخدم "use strict" في هذا المثال

num = 5; // المتغير "num" أنشئ ولم يكن موجود

Expand Down
14 changes: 7 additions & 7 deletions 1-js/02-first-steps/05-types/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const bigInt = 1234567890123456789012345678901234567890n;
الأن `BigInt` متوافق مع فايرفوكس/كروم/ايدج/سفاري ،لكن ليست متوافقة مع إنترنت اكسبلورر
```

You can check [*MDN* BigInt compatibility table](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt#Browser_compatibility) to know which versions of a browser are supported.
يمكنك التحقق من [*MDN* BigInt compatibility table](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt#Browser_compatibility) لمعرفة اي نسخة من المتصفح مدعومة.

## النص

Expand All @@ -98,7 +98,7 @@ let str2 = 'Single quotes are ok too';
let phrase = `can embed another ${str}`;
```

In JavaScript, there are 3 types of quotes.
فالـ JavaScript, هناك 3 انواع من علامات التنصيص.

1. علامات التنصيص المزدوجة: `"Hello"`.
2. علامات التنصيص المفردة: `'Hello'`.
Expand Down Expand Up @@ -128,12 +128,12 @@ alert( "the result is ${1 + 2}" ); // the result is ${1 + 2} (علامات ال
سنغطي النصوص بشئ من التفصيل في هذا الفصل <info:string>.

```smart header="لا يوجد نوع *character* ."
في بعض اللغات، يوجد نوع خاص "character" يعبر عن الحرف الواحد. For example,على سبيل المثال، في لغة سي وجافا يدعى "char".
في بعض اللغات، يوجد نوع خاص "character" يعبر عن الحرف الواحد. على سبيل المثال، في لغة سي وجافا يدعى "char".

في جافا سكريبت، لا يوجد مثل هذا النوع. يوجد نوع واحد فقط: `string`. النص قد يتكون من صفر حرف (نص فارغ), حرف واحد أو أكثر.
```

## Boolean (logical type)
## Boolean (نوع منطقي)

النوع boolean لديه قيمتين فقط: `صواب` and `خطأ`.

Expand All @@ -156,7 +156,7 @@ alert( isGreater ); // نعم (نتيجة المقارنة هي "نعم")

سنغطي القيم المنطقية بشكل أعمق في الفصل <info:logical-operators>.

## The "null" value
## القيمة "null"

القيمة الخاصة `null` لا ينتمي إلى أي نوع تم شرحه بالأعلى.

Expand All @@ -172,7 +172,7 @@ let age = null;

الكود أعلاه يوضح أن `age` غير معروفة.

## The "undefined" value
## القيمة "undefined"

القيمة الخاصة `undefined` أيضاً قيمة محايدة. أنها تصنع نوع من نفسها مثل `null`.

Expand All @@ -199,7 +199,7 @@ alert(age); // "undefined"

...لكن لا ننصح بذلك. في الطبيعي، الشخص يستخدم `null` لتعيين قيمة "فارغ" أو "غير معروف" لمتغير، بينما `undefined` محجوزة كقيمة إفتراضية أساسية للأشياء غير المعينة.

## Objects and Symbols
## الكائنات و الرموز

النوع `كائن` هو نوع خاص.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
```js run no-beautify
let a = 1, b = 1;

alert( ++a ); // 2, prefix form returns the new value
alert( b++ ); // 1, postfix form returns the old value
alert( ++a ); // 2, prefix ترجع القيمة الجديدة
alert( b++ ); // 1, postfix ترجع القيمة القديمة

alert( a ); // 2, incremented once
alert( b ); // 2, incremented once
alert( a ); // 2, الزيادة 1
alert( b ); // 2, الزيادة 1
```

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
الإجابة هي:

- `a = 4` (multiplied by 2)
- `x = 5` (calculated as 1 + 4)
- `a = 4` (ضرب بالعدد 2)
- `x = 5` (حسبت كـ 1 + 4)

12 changes: 6 additions & 6 deletions 1-js/02-first-steps/08-operators/4-fix-prompt/solution.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

حتى المتغيرات لها قيم "1" و "2" على التوالي.
```js run
let a = "1"; // prompt("First number?", 1);
let b = "2"; // prompt("Second number?", 2);
let a = "1"; // prompt("العدد الأول؟", 1);
let b = "2"; // prompt("العدد الثاني؟", 2);

alert(a + b); // 12
```
Expand All @@ -13,17 +13,17 @@ alert(a + b); // 12
على سبيل المثال ، قبل "prompt" مباشرةً:

```js run
let a = +prompt("First number?", 1);
let b = +prompt("Second number?", 2);
let a = +prompt("العدد الأول؟", 1);
let b = +prompt("العدد الثاني؟", 2);

alert(a + b); // 3
```

أو في `alert`:

```js run
let a = prompt("First number?", 1);
let b = prompt("Second number?", 2);
let a = prompt("العدد الأول؟", 1);
let b = prompt("العدد الثاني؟", 2);

alert(+a + +b); // 3
```
Expand Down
4 changes: 2 additions & 2 deletions 1-js/02-first-steps/08-operators/4-fix-prompt/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
لماذا ا؟ اصلحه. يجب أن تكون النتيجة `3`.

```js run
let a = prompt("First number?", 1);
let b = prompt("Second number?", 2);
let a = prompt("العدد الأول ؟", 1);
let b = prompt("العدد الثاني ؟", 2);

alert(a + b); // 12
```
Loading