|
1 |
| -# Developer console |
| 1 | +# کۆنسۆلی گەشەپێدەر |
2 | 2 |
|
3 |
| -Code is prone to errors. You will quite likely make errors... Oh, what am I talking about? You are *absolutely* going to make errors, at least if you're a human, not a [robot](https://en.wikipedia.org/wiki/Bender_(Futurama)). |
| 3 | +کۆدە تووشی هەڵە دەبێت. بە ئەگەرێکی زۆرەوە هەڵە دەکەن ، ئەوەی من باسی دەکەم *لانیکەم* ئەگەر مرۆڤ بیت تووشی هەڵە دەبیت لە کۆد نووسین، بەڵام ئەگەر [ڕۆبۆت](https://en.wikipedia.org/wiki/Bender_(Futurama)). بیت دۆخەکە فەرق دەکات. |
4 | 4 |
|
5 |
| -But in the browser, users don't see errors by default. So, if something goes wrong in the script, we won't see what's broken and can't fix it. |
| 5 | +بەڵام لە وێبگەڕەکەدا بەکارهێنەران بە شێوازی پێشوەختە هەڵە نابینن. بۆیە ئەگەر شتێک لە کۆدی سکڕێپت ئێمە هەڵە بوو، ناتوانین بزانین چی هەڵەیە و ناتوانین چاکی بکەینەوە. |
6 | 6 |
|
7 |
| -To see errors and get a lot of other useful information about scripts, "developer tools" have been embedded in browsers. |
| 7 | +وێبگەڕەکان "ئامرازی گەشەپێدەر"ی ناوەکییان هەیە بۆ بینینی هەڵەکان و وەرگرتنی زانیاری زۆر بەسوود و تر سەبارەت بە سکریپتەکان. |
8 | 8 |
|
9 |
| -Most developers lean towards Chrome or Firefox for development because those browsers have the best developer tools. Other browsers also provide developer tools, sometimes with special features, but are usually playing "catch-up" to Chrome or Firefox. So most developers have a "favorite" browser and switch to others if a problem is browser-specific. |
| 9 | +زۆربەی گەشەپێدەران کرۆم یان فایەرفۆکسیان پێ باشترە بۆ پەرەپێدان چونکە ئەم وێبگەڕانە باشترین ئامرازی گەشەپێدەریان هەیە. هەروەها وێبگەڕەکانی تر ئامرازی گەشەپێدەر پێشکەش دەکەن، کە هەندێک جار تایبەتمەندی زۆر باشیان هەیە، بەڵام بەزۆری هەمان تایبەتمەندی کرۆم یان فایەرفۆکس بەکاردەهێنن.بۆیە زۆربەی گەشەپێدەران وێبگەڕێکی "دڵخواز"یان هەیە و ئەگەر کێشەکە پەیوەندی بە وێبگەڕەکەوە هەبێت، ئەوا وێبگەڕەکانی تر تاقی دەکەنەوە بۆ چارەسەرکردنی کێشەکە. |
10 | 10 |
|
11 |
| -Developer tools are potent; they have many features. To start, we'll learn how to open them, look at errors, and run JavaScript commands. |
12 | 11 |
|
13 |
| -## Google Chrome |
| 12 | +ئامرازەکانی گەشەپێدەر بەهێزن. چەندین تایبەتمەندییان هەیە. بۆ دەستپێکردن فێر دەبین چۆن بیانکەینەوە و چۆن پشکنین لەسەر هەڵەکان بکەین و فەرمانەکانی جاڤاسکڕێپت جێبەجێ بکەین. |
14 | 13 |
|
15 |
| -Open the page [bug.html](bug.html). |
| 14 | +## گووگڵ کرۆم |
16 | 15 |
|
17 |
| -There's an error in the JavaScript code on it. It's hidden from a regular visitor's eyes, so let's open developer tools to see it. |
| 16 | +لاپەڕەی [bug.html](bug.html) بکەرەوە. |
18 | 17 |
|
19 |
| -Press `key:F12` or, if you're on Mac, then `key:Cmd+Opt+J`. |
| 18 | +هەڵەیەک لە کۆدی جاڤاسکڕێپتدا هەیە لەسەری. لە چاوی سەردانکەرێکی ئاسایی شاراوەتەوە، بۆیە با ئامرازەکانی گەشەپێدەر بکەینەوە بۆ بینینی. |
20 | 19 |
|
21 |
| -The developer tools will open on the Console tab by default. |
| 20 | +ئەمە کارە بکە :`key:F12` یان ئەگەر ماک بەکاردەهێنیت، `key:Cmd+Opt+J` فشار بە. |
22 | 21 |
|
23 |
| -It looks somewhat like this: |
| 22 | +ئامرازەکانی گەشەپێدەر لە تابی Console بە شێوازی پێشوەختە دەکرێنەوە. |
| 23 | + |
| 24 | +شتێکی لەم شێوەیە دەچێت: |
24 | 25 |
|
25 | 26 | 
|
26 | 27 |
|
27 |
| -The exact look of developer tools depends on your version of Chrome. It changes from time to time but should be similar. |
| 28 | +دەرکەوتنی ئامرازەکانی گەشەپێدەر بەندە بە وەشانی کرۆمەکەتەوە. جار جار دەگۆڕێت بەڵام دەبێ هاوشێوە بێت. |
| 29 | + |
| 30 | +- لێرەدا دەتوانین پەیامی هەڵەی سوور ببینین. لەم حاڵەتەدا سکریپتەکە فرمانێکی نەناسراوی "lalala" لەخۆدەگرێت. |
| 31 | +- لە لای ڕاستەوە بەستەرێک هەیە کە دەتوانرێت کلیک بکرێت بۆ سەرچاوەی `bug.html:12` لەگەڵ ژمارەی دێڕەکە کە هەڵەکە تێیدا ڕوویداوە. |
28 | 32 |
|
29 |
| -- Here we can see the red-colored error message. In this case, the script contains an unknown "lalala" command. |
30 |
| -- On the right, there is a clickable link to the source `bug.html:12` with the line number where the error has occurred. |
| 33 | +لە خوارەوەی پەیامی هەڵەکە ئایکۆنێکی شین `>` هەیە. ئەمەش "هێڵی فەرمان" دیاری دەکات کە دەتوانین فەرمانەکانی جاڤاسکڕێپت تێیدا بنووسین.`key:Enter` فشار بە بۆ ئەوە جێبەجێ بێت. |
31 | 34 |
|
32 |
| -Below the error message, there is a blue `>` symbol. It marks a "command line" where we can type JavaScript commands. Press `key:Enter` to run them. |
| 35 | +ئێستا دەتوانین هەڵەکان ببینین و ئەوە بەسە بۆ دەستپێکردن.دواتر دەگەڕێینەوە سەر ئامرازەکانی گەشەپێدەر و لە بەشی <info:debugging-chrome> دەچینە ناو چاککردنەوەی زیاتر. |
33 | 36 |
|
34 |
| -Now we can see errors, and that's enough for a start. We'll come back to developer tools later and cover debugging more in-depth in the chapter <info:debugging-chrome>. |
35 | 37 |
|
36 | 38 | ```smart header="Multi-line input"
|
37 |
| -Usually, when we put a line of code into the console, and then press `key:Enter`, it executes. |
| 39 | +بەزۆری کاتێک جێبەجێ دەکرێت کە دێڕێکی کۆد دەخەینە ناو کۆنسۆڵەکەوە و پاشان `کلیلی :Enter` دادەگرین. |
38 | 40 |
|
39 |
| -To insert multiple lines, press `key:Shift+Enter`. This way one can enter long fragments of JavaScript code. |
| 41 | +بۆ دانانی چەندین دێڕ،` Shift+Enter` فشار بە. بەم شێوەیە دەتوانرێت پارچە درێژەکانی کۆدی جاڤاسکڕێپت بخرێتە ناوەوە. |
40 | 42 | ```
|
41 | 43 |
|
42 |
| -## Firefox, Edge, and others |
| 44 | +## فایەرفۆکس و ئێدج و ئەوانی تر |
43 | 45 |
|
44 |
| -Most other browsers use `key:F12` to open developer tools. |
| 46 | +زۆربەی وێبگەڕەکانی تر `key:F12` بەکاردەهێنن بۆ کردنەوەی ئامرازەکانی گەشەپێدەر. |
45 | 47 |
|
46 |
| -The look & feel of them is quite similar. Once you know how to use one of these tools (you can start with Chrome), you can easily switch to another. |
| 48 | +ڕوخسار و هەستیان بە تەواوی وەک یەک. کاتێک زانیت چۆن یەکێک لەم ئامرازانە بەکاربهێنیت (دەتوانیت لە کرۆمەوە دەست پێبکەیت)، دەتوانیت بە ئاسانی لەگەڵ ئامرازەکانی تر ڕابێیت چونکە هەموویان هەمان بناغە و پێکهاتە بەکاردەهێنن. |
47 | 49 |
|
48 |
| -## Safari |
| 50 | +## سەفاری |
49 | 51 |
|
50 |
| -Safari (Mac browser, not supported by Windows/Linux) is a little bit special here. We need to enable the "Develop menu" first. |
| 52 | +سەفاری (کە لەلایەن ویندۆز/لینوکسەوە پشتگیری ناکرێ) لێرەدا کەمێک تایبەتە. سەرەتا پێویستە "مێنۆی پەرەپێدان" چالاک بکەین. |
51 | 53 |
|
52 |
| -Open Preferences and go to the "Advanced" pane. There's a checkbox at the bottom: |
| 54 | +Preferences بکەرەوە و بچۆ بۆ لاپەڕەی "Advanced". لە خوارەوە بۆکسێکی هەڵبژاردن هەیە: |
53 | 55 |
|
54 | 56 | 
|
55 | 57 |
|
56 |
| -Now `key:Cmd+Opt+C` can toggle the console. Also, note that the new top menu item named "Develop" has appeared. It has many commands and options. |
57 | 58 |
|
58 |
| -## Summary |
| 59 | +شۆرتکات `key:Cmd+Opt+C` ئێستا دەتوانێت کۆنسۆڵەکە بگۆڕێت. هەروەها تێبینی بکە کە بابەتی نوێی سەرەوەی مینیو بە ناوی "Develop" دەرکەوتووە. چەندین فەرمان و بژاردەی هەیە. |
| 60 | + |
| 61 | + |
| 62 | +## پوختە |
| 63 | + |
| 64 | +- ئامرازەکانی گەشەپێدەر ڕێگەمان پێدەدەن هەڵەکان ببینین، فەرمانەکان جێبەجێ بکەین، گۆڕاوەکان بپشکنین و زۆر شتی تر. |
| 65 | +- دەتوانرێت بە `key:F12` بۆ زۆربەی وێبگەڕەکانی ویندۆز بکرێتەوە. کرۆم بۆ ماک پێویستی بە `کلیل:Cmd+Opt+J` هەیە، سەفاری: `کلیل: Cmd+Opt+C` (پێویستە سەرەتا چالاک بکرێت). |
59 | 66 |
|
60 |
| -- Developer tools allow us to see errors, run commands, examine variables, and much more. |
61 |
| -- They can be opened with `key:F12` for most browsers on Windows. Chrome for Mac needs `key:Cmd+Opt+J`, Safari: `key:Cmd+Opt+C` (need to enable first). |
62 | 67 |
|
63 |
| -Now we have the environment ready. In the next section, we'll get down to JavaScript. |
| 68 | +ئێستا ژینگەمان ئامادە کردووە. لە بەشی داهاتوودا باس لە جاڤاسکڕێپت دەکەین. |
0 commit comments