Skip to content

Commit 5b73381

Browse files
authoredMay 21, 2021
Merge pull request #4 from jnsjknn/master
Developer console
2 parents 59a53ba + 4623480 commit 5b73381

File tree

2 files changed

+30
-30
lines changed

2 files changed

+30
-30
lines changed
 
+29-29
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,63 @@
1-
# Developer console
1+
# Kehityskonsoli
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+
Koodi on altis virheille. Tulet todennäköisesti tekemään virheitä.. Tai siis, mitä höpisen? Tulet *takuuvarmasti* tekemään virheitä ainakin, jos olet ihminen etkä [robotti](https://en.wikipedia.org/wiki/Bender_(Futurama)).
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+
Selaimessa virheitä ei kuitenkaan oletuksena näe. Jos jokin skriptissä menee pieleen, emme näe mikä on rikki emmekä voi korjata sitä.
66

7-
To see errors and get a lot of other useful information about scripts, "developer tools" have been embedded in browsers.
7+
Nähdäksemme virheet ja paljon muuta hyödyllistä skripteihin liittyvää, selaimiin on upotettu "kehitystyökaluja".
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+
Useimmat sovelluskehittäjät käyttävät Chromea tai Firefoxia, koska niissä on parhaat kehitystyökalut. Muissakin selaimissa on kehitystyökaluja, mutta ne seuraavat yleensä Chromen ja Firefoxin esimerkkiä. Useimmilla kehittäjillä onkin yksi "lempiselain" ja he käyttävät muita, jos ongelma on selainkohtainen.
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+
Kehitystyökalut ovat tehokkaita; niissä on monia toimintoja. Aluksi opimme, miten työkalut saa näkyviin, katsomme virheitä ja ajamme JavaScript -komentoja.
1212

1313
## Google Chrome
1414

15-
Open the page [bug.html](bug.html).
15+
Avaa tämä sivu: [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+
Sivun JavaScript -koodissa on virhe. Se on piilossa tavallisille vierailijoille, joten avataanpa kehitystyökalut, niin näemme sen.
1818

19-
Press `key:F12` or, if you're on Mac, then `key:Cmd+Opt+J`.
19+
Paina `key:F12` tai, jos käytät Macciä, paina `key:Cmd+Opt+J`.
2020

21-
The developer tools will open on the Console tab by default.
21+
Kehitystyökalut avautuvat oletuksena konsoliin (Console).
2222

23-
It looks somewhat like this:
23+
Sen pitäisi näyttää suurin piirtein tältä:
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+
Työkalujen tarkka ulkoasu riippuu Chromen versiosta. Tarkka ulkoasu muuttuu silloin tällöin, mutta sen pitäisi näyttää samankaltaiselta.
2828

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+
- Täällä näemme punaisen virhetekstin. Tässä tapauksessa skripti sisältää tuntemattoman komennon "lalala".
30+
- Oikealla on klikattava linkki lähteeseen `bug.html:12`, jossa näkyy sen rivin numero, jolta virhe löytyy.
3131

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+
Virhetekstin alla näkyy sininen `>` symboli. Se osoittaa "komentoriviä", johon voimme kirjoittaa JavaScript -komentoja. Paina `key:Enter` suorittaaksesi niitä.
3333

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+
Näemme nyt virheet, ja se riittää alkuun. Palaamme kehitystyökaluihin myöhemmin ja käymme virheenkorjausta tarkemmin kappaleessa <info:debugging-chrome>.
3535

36-
```smart header="Multi-line input"
37-
Usually, when we put a line of code into the console, and then press `key:Enter`, it executes.
36+
```smart header="Monirivinen syöttö"
37+
Kun syötämme rivin koodia konsoliin ja painamme `key:Enter`, koodi suoritetaan.
3838
39-
To insert multiple lines, press `key:Shift+Enter`. This way one can enter long fragments of JavaScript code.
39+
Voimme painaa `key:Shift+Enter` syöttääksemme useamman rivin. Näin voimme syöttää pidempiä JavaScript -koodipätkiä.
4040
```
4141

42-
## Firefox, Edge, and others
42+
## Firefox, Edge ja muut
4343

44-
Most other browsers use `key:F12` to open developer tools.
44+
Suurimmassa osassa selaimista kehittäjätyökalut saa avattua painamalla `key:F12`.
4545

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+
Niiden ulkoasu ja tuntuma on melko samanlainen. Kun opit käyttämään yhden selaimen työkaluja (voit aloittaa Chromella), toiseen selaimeen vaihtaminen on helppoa.
4747

4848
## Safari
4949

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 (Macin selain, jota Windows/Linux eivät tue) on vähän erityinen. Meidän täytyy ensin ottaa "Develop menu" (suom. "kehitysvalikko") käyttöön.
5151

52-
Open Preferences and go to the "Advanced" pane. There's a checkbox at the bottom:
52+
Avaa "Preferences" (suom. "Asetukset") ja mene kohtaan "Advanced" (suom. "Lisäasetukset"). Alaosasta löytyy valinta:
5353

5454
![safari](safari.png)
5555

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+
Nyt näppäinyhdistelmällä `key:Cmd+Opt+C` saa avattua konsolin. Huomaa myös, että yläpalkkiin on ilmestynyt uusi valinta "Develop" (suom. "Kehitä"). Sieltä löytyy monia komentoja ja valintoja.
5757

58-
## Summary
58+
## Yhteenveto
5959

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).
60+
- Kehitystyökalujen avulla voimme nähdä virheet, suorittaa komentoja, tutkia muuttujia ja paljon muuta.
61+
- Työkalut saa suurimmassa osassa Windows-selaimista auki painamalla `key:F12`. Chrome Macillä vaatii näppäinyhdistelmää `key:Cmd+Opt+J`, Safari `key:Cmd+Opt+C` (kun työkalut on ensin otettu käyttöön).
6262

63-
Now we have the environment ready. In the next section, we'll get down to JavaScript.
63+
Nyt meillä on kehitysympäristö valmiina. Seuraavassa osiossa paneudumme JavaScriptiin.

‎1-js/01-getting-started/4-devtools/bug.html

+1-1
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+
Tällä sivulla on virhe.
1111
<script>
1212
lalala
1313
</script>

0 commit comments

Comments
 (0)
Please sign in to comment.