|
1 | 1 | # Developer console
|
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 | +Αλλά στο πρόγραμμα περιήγησης, οι χρήστες δεν βλέπουν τα λάθη από προεπιλογή. Έτσι, αν κάτι πάει στραβά στο script, δεν θα δούμε τι είναι σπασμένο και δεν μπορούμε να το διορθώσουμε. |
6 | 6 |
|
7 |
| -To see errors and get a lot of other useful information about scripts, "developer tools" have been embedded in browsers. |
| 7 | +Για να δούμε τα σφάλματα και να λάβουμε πολλές άλλες χρήσιμες πληροφορίες σχετικά με τα script, τα "developer tools" έχουν ενσωματωθεί στα προγράμματα περιήγησης. |
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 | +Οι περισσότεροι προγραμματιστές κλίνουν προς το Chrome ή τον Firefox για ανάπτυξη, επειδή αυτά τα προγράμματα περιήγησης έχουν τα καλύτερα developer tools. Άλλα προγράμματα περιήγησης παρέχουν επίσης developer tools, μερικές φορές με ειδικές λειτουργίες, αλλά συνήθως προσπαθούν να "προφτάσουν" στο Chrome ή τον Firefox. Έτσι, οι περισσότεροι προγραμματιστές έχουν ένα "αγαπημένο" πρόγραμμα περιήγησης και μεταβαίνουν σε άλλους, εάν ένα πρόβλημα είναι συγκεκριμένο για τον browser. |
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. |
| 11 | +Τα developer tools είναι ισχυρά, έχουν πολλά χαρακτηριστικά. Για να ξεκινήσετε, θα μάθουμε πώς να τα ανοίγουμε, να εξετάζουμε τα σφάλματα και να εκτελούμε τις εντολές της JavaScript. |
12 | 12 |
|
13 | 13 | ## Google Chrome
|
14 | 14 |
|
15 |
| -Open the page [bug.html](bug.html). |
| 15 | +Ανοίξτε τη σελίδα [bug.html](bug.html). |
16 | 16 |
|
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. Είναι κρυμμένο από τα μάτια ενός τακτικού επισκέπτη, οπότε ας ανοίξουμε developer tools για να το δούμε. |
18 | 18 |
|
19 |
| -Press `key:F12` or, if you're on Mac, then `key:Cmd+Opt+J`. |
| 19 | +Πάτησε `key:F12` ή, εάν είσαι στο Mac, τότε `key:Cmd+Opt+J`. |
20 | 20 |
|
21 |
| -The developer tools will open on the Console tab by default. |
| 21 | +Τα developer tools θα ανοίξουν στην καρτέλα Console από προεπιλογή. |
22 | 22 |
|
23 |
| -It looks somewhat like this: |
| 23 | +Φαίνεται κάπως έτσι: |
24 | 24 |
|
25 | 25 | 
|
26 | 26 |
|
27 |
| -The exact look of developer tools depends on your version of Chrome. It changes from time to time but should be similar. |
| 27 | +Η ακριβής εμφάνιση των develοper tools εξαρτάται από την έκδοση του Chrome. Αλλάζει από καιρό σε καιρό, αλλά πρέπει να είναι παρόμοια. |
28 | 28 |
|
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. |
| 29 | +- Εδώ μπορούμε να δούμε το κόκκινο μήνυμα σφάλματος. Σε αυτήν την περίπτωση, στο script περιέχει μια άγνωστη εντολή "lalala". |
| 30 | +- Στα δεξιά, υπάρχει ένας σύνδεσμος με δυνατότητα κλικ στην πηγή `bug.html: 12` με τον αριθμό γραμμής όπου παρουσιάστηκε το σφάλμα. |
31 | 31 |
|
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. |
| 32 | +Κάτω από το μήνυμα σφάλματος υπάρχει ένα μπλε σύμβολο `>`. Σηματοδοτεί μια "γραμμή εντολών" όπου μπορούμε να πληκτρολογήσουμε εντολές JavaScript. Πατήστε το πλήκτρο `Enter` για να τα εκτελέσετε (`πλήκτρο: Shift + Enter` για εισαγωγή εντολών πολλαπλών γραμμών). |
33 | 33 |
|
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>. |
| 34 | +Τώρα μπορούμε να δούμε λάθη, και αυτό είναι αρκετό για μια αρχή. Θα επιστρέψουμε αργότερα στα developer tools και θα καλύψουμε λεπτομερέστερα το σφάλμα στο κεφάλαιο <info:debugging-chrome>. |
35 | 35 |
|
36 | 36 | ```smart header="Multi-line input"
|
37 | 37 | Usually, when we put a line of code into the console, and then press `key:Enter`, it executes.
|
38 | 38 |
|
39 | 39 | To insert multiple lines, press `key:Shift+Enter`. This way one can enter long fragments of JavaScript code.
|
40 | 40 | ```
|
41 | 41 |
|
42 |
| -## Firefox, Edge, and others |
| 42 | +## Firefox, Edge, και άλλο |
43 | 43 |
|
44 |
| -Most other browsers use `key:F12` to open developer tools. |
| 44 | +Τα περισσότερα προγράμματα περιήγησης χρησιμοποιούν το `key:F12` για να ανοίξουν τα developer tools. |
45 | 45 |
|
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. |
| 46 | +Η εμφάνιση και η αίσθηση είναι αρκετά όμοια. Μόλις μάθετε πώς να χρησιμοποιήσετε ένα από αυτά τα εργαλεία (μπορείτε να ξεκινήσετε με το Chrome), μπορείτε εύκολα να μεταβείτε σε άλλο. |
47 | 47 |
|
48 | 48 | ## Safari
|
49 | 49 |
|
50 |
| -Safari (Mac browser, not supported by Windows/Linux) is a little bit special here. We need to enable the "Develop menu" first. |
| 50 | +Το Safari (πρόγραμμα περιήγησης του Mac, που δεν υποστηρίζεται από τα Windows / Linux) είναι λίγο ιδιαίτερο εδώ. Πρέπει πρώτα να ενεργοποιήσουμε το μενού "Develop menu". |
51 | 51 |
|
52 |
| -Open Preferences and go to the "Advanced" pane. There's a checkbox at the bottom: |
| 52 | +Ανοίξτε τις Προτιμήσεις και μεταβείτε στο παράθυρο "Για προχωρημένους". Υπάρχει ένα πλαίσιο ελέγχου στο κάτω μέρος: |
53 | 53 |
|
54 | 54 | 
|
55 | 55 |
|
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. |
| 56 | +Τώρα, το πλήκτρο: `Cmd + Opt + C` μπορεί να αλλάξει την κονσόλα. Επίσης, σημειώστε ότι εμφανίστηκε το νέο στοιχείο μενού με τίτλο "Develop". Έχει πολλές εντολές και επιλογές. |
57 | 57 |
|
58 |
| -## Summary |
| 58 | +```smart header="Multi-line input" |
| 59 | +Συνήθως, όταν βάζουμε μια γραμμή κώδικα στην κονσόλα, και στη συνέχεια πατάμε το πλήκτρο 'Enter', εκτελείται. |
| 60 | +
|
| 61 | +Για να εισαγάγετε πολλές γραμμές, πατήστε το πλήκτρο 'Shift + Enter'. Με αυτό τον τρόπο μπορείτε να εισάγετε μεγάλα κομμάτια κώδικα JavaScript. |
| 62 | +``` |
| 63 | + |
| 64 | +## Περίληψη |
59 | 65 |
|
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). |
| 66 | +- Τα Developer tools μας επιτρέπουν να βλέπουμε σφάλματα, να τρέχουμε εντολές, να εξετάζουμε μεταβλητές και πολλά άλλα. |
| 67 | +- Μπορούν να ανοίξουν με `key: F12` για τα περισσότερα προγράμματα περιήγησης στα Windows. Το Chrome για Mac χρειάζεται `key:Cmd + Opt + J`, Safari:` key: Cmd + Opt + C` (πρέπει πρώτα να ενεργοποιηθεί). |
62 | 68 |
|
63 |
| -Now we have the environment ready. In the next section, we'll get down to JavaScript. |
| 69 | +Τώρα έχουμε έτοιμο το περιβάλλον. Στην επόμενη ενότητα, θα διεισδύσουμε στην JavaScript. |
0 commit comments