Skip to content

Commit afb020f

Browse files
committed
translate Devtools article
1 parent e6dd629 commit afb020f

File tree

6 files changed

+31
-30
lines changed

6 files changed

+31
-30
lines changed
Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,65 @@
1-
# Developer console
1+
# Інструменти розробника
22

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+
Будь-який код так і тяжіє до помилок. Швидше за все, ви будете робити помилки... Хоча, про що я говорю? Ви *точно* будете робити помилки, принаймні, якщо ви людина, а не робот [robot](https://uk.wikipedia.org/wiki/Бендер_(Футурама)).
44

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+
Зазвичай, користувачі не бачать помилок в браузері. Тому, якщо в скрипті щось трапиться на так, ми не побачимо помилки, і не зможемо її виправити.
66

7-
To see errors and get a lot of other useful information about scripts, "developer tools" have been embedded in browsers.
7+
Щоб побачити помилки і отримати багато інформації про скрипти, було розроблено і вбудовано в браузери "інструменти розробника".
88

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+
Більшість розробників для розробки надають перевагу Chrome чи Firefox, тому що ці браузери мають найкращі інструменти розробника. Інші браузери теж мають інструменти розробника, деколи навіть зі спеціальними функціями, проте, вони не настільки функціональні і зручні, як в Chrome чи Firefox. Тому більшість розробників мають "улюблений" браузер і переключаються на інші браузери, якщо проблема специфічна для браузера.
1010

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.
11+
Інструменти розробника потужні; вони мають багато функцій. Для початку, ми вивчемо, як їх відкрити, як дивитися на помилки і як виконувати JavaScript команди.
1212

1313
## Google Chrome
1414

15-
Open the page [bug.html](bug.html).
15+
Відкрийте сторінку [bug.html](bug.html).
1616

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.
17+
На цій сторінці є помилка в JavaScript коді. Вона прихована для звичайних користувачів, тому потрібно відкрити інструменти розробника, щоб її побачити.
1818

19-
Press `key:F12` or, if you're on Mac, then `key:Cmd+Opt+J`.
19+
Натисніть клавішу `key:F12` або, якщо у вас Mac, комбінацію клавіш `key:Cmd+Opt+J`.
2020

21-
The developer tools will open on the Console tab by default.
21+
Інструменти розробника усталено відкриваються на вкладі "Console".
2222

23-
It looks somewhat like this:
23+
Ось так відображається помилка в консолі:
2424

2525
![chrome](chrome.png)
2626

27-
The exact look of developer tools depends on your version of Chrome. It changes from time to time but should be similar.
27+
Точний вигляд інструментів розробника може відрізнятися в залежності від вашої версії Chrome. Вони міняються час від часу, але в основному це вікно пивинно бути схожим.
28+
Ці інструменти показуються лише англійською мовою, незалежно від мови браузера.
2829

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.
30+
- Тут ми можемо побачити червоне повідомлення. У нашому випадку, скрипт має невизначену команду "lalala".
31+
- З правого боку є посилання на джерело `bug.html:12` з номером рядка, де ця помилка виникла. При натисканні на це посилання, інструмент перейде на вкладку "Source", де відкриє файл і перейде на рядок, в якому трапилася помилка.
3132

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 (`key:Shift+Enter` to input multi-line commands).
33+
Нижче повідомлення про помилку є синій символ `>`. Цей символ позначає "командний рядок", де ми можемо вводити JavaScript команди. Натисніть `key:Enter`, щоб виконати їх (`key:Shift+Enter` щоб вводити команди на декілька рядків).
3334

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+
Тепер ми бачимо помилки, цього достатньо, щоб почати. Ми пізніше повернемося до інструментів розробника, щоб розглянути відлагодження в розділі <info:debugging-chrome>.
3536

3637

37-
## Firefox, Edge, and others
38+
## Firefox, Edge, та інші
3839

39-
Most other browsers use `key:F12` to open developer tools.
40+
Більшість браузерів використовують клавішу `key:F12`, щоб відкрити консоль розробника.
4041

41-
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.
42+
Їх вигляд зазвичай схожий. Якщо ви навчитеся використовувати однин з них (можете почати з Chrome), ви зможете легко переключитися на інший інструмент.
4243

4344
## Safari
4445

45-
Safari (Mac browser, not supported by Windows/Linux) is a little bit special here. We need to enable the "Develop menu" first.
46+
Safari (браузер в Mac, не підтримується Windows/Linux) дещо особливий. Спочатку нам потрібно увімкнути меню "Розробка".
4647

47-
Open Preferences and go to the "Advanced" pane. There's a checkbox at the bottom:
48+
Відкрийте Параметри і перейдіть на панель "Експертні". Знизу буде галочка, яку необхідно вибрати:
4849

4950
![safari](safari.png)
5051

51-
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.
52+
Тепер комбінація клавіш `key:Cmd+Opt+C` може переключати консоль. Також, зауважте, що з'явився новий пункт "Розробка" в верхньому меню. Це меню має багато команд та опцій.
5253

53-
## Multi-line input
54+
## Багаторядкове введення
5455

55-
Usually, when we put a line of code into the console, and then press `key:Enter`, it executes.
56+
Зазвичай, коли ми вводимо один рядок коду в консоль і натискаємо `key:Enter`, він виконується.
5657

57-
To insert multiple line, press `key:Shift+Enter`.
58+
Щоб вставити декілька рядків, натисніть `key:Shift+Enter`.
5859

59-
## Summary
60+
## Підсумки
6061

61-
- Developer tools allow us to see errors, run commands, examine variables, and much more.
62-
- 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+
- Інструменти розробника дозволяють нам переглядати помилки, виконувати команди, досліджувати змінні та багато іншого.
63+
- Їх можна відкрити клавішою `key:F12` для більшості браузерів в Windows. В Chrome для Mac потрібно натиснути комбінацію клавіш `key:Cmd+Opt+J`, в Safari: `key:Cmd+Opt+C` (але спочатку потрібно увімкнути).
6364

64-
Now we have the environment ready. In the next section, we'll get down to JavaScript.
65+
Тепер в нас є готове середовище. В наступному розділі ми приступимо до самого JavaScript.

1-js/01-getting-started/3-devtools/bug.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<body>
99

10-
There is an error in the script on this page.
10+
На цій сторінці є помилка в скрипті.
1111
<script>
1212
lalala
1313
</script>
-5.99 KB
Loading
Loading
125 KB
Loading
Loading

0 commit comments

Comments
 (0)