Skip to content

Commit 9a79134

Browse files
authored
Merge pull request #4 from christianhegedues/de/01-hello-world
Translation of 01-hello-world
2 parents 68dfe71 + 07714b3 commit 9a79134

File tree

5 files changed

+54
-54
lines changed

5 files changed

+54
-54
lines changed

1-js/02-first-steps/01-hello-world/1-hello-alert/solution.view/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<body>
55

66
<script>
7-
alert( "I'm JavaScript!" );
7+
alert( "Ich bin JavaScript!" );
88
</script>
99

1010
</body>

1-js/02-first-steps/01-hello-world/1-hello-alert/task.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ importance: 5
22

33
---
44

5-
# Show an alert
5+
# Zeige einen Alarm
66

7-
Create a page that shows a message "I'm JavaScript!".
7+
Erstelle eine Seite, die eine Nachricht "Ich bin JavaScript!" anzeigt.
88

9-
Do it in a sandbox, or on your hard drive, doesn't matter, just ensure that it works.
9+
Egal ob in einer Sandbox oder auf deiner Festplatte, stelle nur sicher, dass es funktioniert.
1010

1111
[demo src="solution"]
1212

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
The HTML code:
1+
Der HTML-Code:
22

33
[html src="index.html"]
44

5-
For the file `alert.js` in the same folder:
5+
Für die Datei `alert.js` im selben Ordner:
66

77
[js src="alert.js"]
88

1-js/02-first-steps/01-hello-world/2-hello-alert-ext/task.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ importance: 5
22

33
---
44

5-
# Show an alert with an external script
5+
# Zeig einen Alarm mit einem externen Skript
66

7-
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.
7+
Nimm die Lösung der vorherigen Aufgabe <info:task/hello-alert>. Modifiziere sie durch auslagern des Skript-Contents in eine externe Datei, innerhalb des gleichen Ordners.
88

9-
Open the page, ensure that the alert works.
9+
Öffne die Seite, stelle sicher, dass der Alarm funktioniert.
Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,87 @@
1-
# Hello, world!
1+
# Hallo, Welt!
22

3-
This part of the tutorial is about core JavaScript, the language itself.
3+
Dieser Teil des Tutorials behandelt den Kern von JavaScript, die Sprache selbst.
44

5-
But we need a working environment to run our scripts and, since this book is online, the browser is a good choice. We'll keep the amount of browser-specific commands (like `alert`) to a minimum so that you don't spend time on them if you plan to concentrate on another environment (like Node.js). We'll focus on JavaScript in the browser in the [next part](/ui) of the tutorial.
5+
Aber wir brauchen eine Arbeitsumgebung um unsere Skripte auszuführen und, da dies ein Online-Buch ist, ist der Browser eine gute Wahl. Wir werden die Anzahl browser-spezifischer Befehle (wie `alert`) auf ein Minimum beschränken, so dass du damit keine Zeit verschwendest, solltest du planen dich auf eine andere Umgebung (wie Node.js) zu konzentrieren. Wir fokusieren uns auf JavaScript im Browser im [nächsten Teil](/ui) des Tutorials.
66

7-
So first, let's see how we attach a script to a webpage. For server-side environments (like Node.js), you can execute the script with a command like `"node my.js"`.
7+
Als erstes, lass uns sehen wie wir ein Skript einer Webseite hinzufügen. Für eine serverseitige Umgebung (wie Node.js), kannst du das Skript mit einem Befehl wie `"node mein.js"` ausführen.
88

99

10-
## The "script" tag
10+
## Der "script"-Tag
1111

12-
JavaScript programs can be inserted into any part of an HTML document with the help of the `<script>` tag.
12+
JavaScript-Programme können an jeder beliebigen Stelle eines HTML-Dokuments mit Hilfe des `<script>`-Tag eingefügt werden.
1313

14-
For instance:
14+
Beispielsweise:
1515

1616
```html run height=100
1717
<!DOCTYPE HTML>
1818
<html>
1919

2020
<body>
2121

22-
<p>Before the script...</p>
22+
<p>Vor dem Skript...</p>
2323

2424
*!*
2525
<script>
26-
alert( 'Hello, world!' );
26+
alert( 'Hallo, Welt!' );
2727
</script>
2828
*/!*
2929

30-
<p>...After the script.</p>
30+
<p>...Nach dem Skript</p>
3131

3232
</body>
3333

3434
</html>
3535
```
3636

3737
```online
38-
You can run the example by clicking the "Play" button in the right-top corner of the box above.
38+
Du kannst das Beispiel durch klicken des "Play"-Buttons, in der rechten oberen Ecke der darüberliegenden Box, ausführen.
3939
```
4040

41-
The `<script>` tag contains JavaScript code which is automatically executed when the browser processes the tag.
41+
Der `<script>`-Tag beinhaltet JavaScript-Code, welcher automatisch ausgeführt wird, wenn der Browser den Tag verarbeitet.
4242

4343

44-
## Modern markup
44+
## Modernes Markup
4545

46-
The `<script>` tag has a few attributes that are rarely used nowadays but can still be found in old code:
46+
Der `<script>`-Tag hat einige Attribute die heutzutage nur selten Verwendung finden, aber noch immer in alten Code vorhanden sind:
4747

48-
The `type` attribute: <code>&lt;script <u>type</u>=...&gt;</code>
49-
: The old HTML standard, HTML4, required a script to have a `type`. Usually it was `type="text/javascript"`. It's not required anymore. Also, the modern HTML standard totally changed the meaning of this attribute. Now, it can be used for JavaScript modules. But that's an advanced topic; we'll talk about modules in another part of the tutorial.
48+
Das `type`-Attribute: <code>&lt;script <u>type</u>=...&gt;</code>
49+
: Der alte HTML-Standard, HTML4, setzte bei einem Skript den `Typ` voraus. Üblicherweise war es `type="text/javascript"`. Dies wird nicht länger benötigt. Zudem, der moderne HTML-Standard hat die Bedeutung des Attributs völlig verändert. Jetzt kann es für JavaScript-Module verwendet werden. Aber dies ist ein weiterführendes Thema; wir werden über Module in einem anderen Teil des Tutorials sprechen.
5050

51-
The `language` attribute: <code>&lt;script <u>language</u>=...&gt;</code>
52-
: This attribute was meant to show the language of the script. This attribute no longer makes sense because JavaScript is the default language. There is no need to use it.
51+
Das `language`-Attribute: <code>&lt;script <u>language</u>=...&gt;</code>
52+
: Dieses Attribute war gedacht, um die Sprache des Skripts anzuzeigen. Dieses Attribute macht nicht länger Sinn, weil JavaScript die Standard-Sprache ist. Es gibt keinen Grund es zu nutzen.
5353

54-
Comments before and after scripts.
55-
: In really ancient books and guides, you may find comments inside `<script>` tags, like this:
54+
Kommentare vor und nach Skripten.
55+
: In wirklich alten Büchern und Anleitungen findest du vielleicht, innerhalb von `<script>`-Tags, Kommentare wie diese:
5656

5757
```html no-beautify
5858
<script type="text/javascript"><!--
5959
...
6060
//--></script>
6161
```
6262

63-
This trick isn't used in modern JavaScript. These comments hide JavaScript code from old browsers that didn't know how to process the `<script>` tag. Since browsers released in the last 15 years don't have this issue, this kind of comment can help you identify really old code.
63+
Dieser Trick wird im modernen JavaScript nicht verwendet. Diese Kommentare verstecken JavaScript-Code für alte Browser, die nicht wissen wie der `<script>`-Tag verarbeitet wird. Da Browser-Veröffentlichungen der letzten 15 Jahre dieses Problem nicht haben, kann dir diese Art von Kommentar helfen wirklich alten Code zu identifizieren.
6464

6565

66-
## External scripts
66+
## Externe Skripte
6767

68-
If we have a lot of JavaScript code, we can put it into a separate file.
68+
Wenn wir viel JavaScript-Code haben, können wir diesen in eine separate Datei legen.
6969

70-
Script files are attached to HTML with the `src` attribute:
70+
Skript-Dateien werden zu HTML mit dem `src`-Attribute hinzugefügt:
7171

7272
```html
73-
<script src="/path/to/script.js"></script>
73+
<script src="/pfad/zum/script.js"></script>
7474
```
7575

76-
Here, `/path/to/script.js` is an absolute path to the script from the site root. One can also provide a relative path from the current page. For instance, `src="script.js"` would mean a file `"script.js"` in the current folder.
76+
Hier ist `/pfad/zum/script.js` ein absoluter Pfad zu dem Skript, aus dem Wurzelverzeichnis der Seite. Auch ein relativer Pfad der aktuellen Seite kann angeben werden. Beispielsweise, `src="script.js"` würde eine Datei `"script.js"` im aktuellen Verzeichnis bedeuten.
7777

78-
We can give a full URL as well. For instance:
78+
Außerdem können wir auch eine komplette URL angeben. Beispielsweise:
7979

8080
```html
8181
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.2.0/lodash.js"></script>
8282
```
8383

84-
To attach several scripts, use multiple tags:
84+
Um mehrere Skripte einzufügen, nutze Mehrfach-Tags:
8585

8686
```html
8787
<script src="/js/script1.js"></script>
@@ -90,43 +90,43 @@ To attach several scripts, use multiple tags:
9090
```
9191

9292
```smart
93-
As a rule, only the simplest scripts are put into HTML. More complex ones reside in separate files.
93+
Normalerweise werden nur die einfachsten Skripte ins HTML eingefügt. Komplexere liegen in separaten Dateien.
9494
95-
The benefit of a separate file is that the browser will download it and store it in its [cache](https://en.wikipedia.org/wiki/Web_cache).
95+
Der Vorteil einer separaten Datei ist, dass der Browser sie heruntlädt und in seinem [Puffer-Speicher](https://de.wikipedia.org/wiki/Browser-Cache) ablegt.
9696
97-
Other pages that reference the same script will take it from the cache instead of downloading it, so the file is actually downloaded only once.
97+
Andere Seiten die zum selben Skript referenzieren werden es aus dem Speicher nehmen anstatt es herunterzuladen, die Datei wird so tatsächlich nur einmal geladen.
9898
99-
That reduces traffic and makes pages faster.
99+
Das reduziert Datenverkehr und macht Seiten schneller.
100100
```
101101

102-
````warn header="If `src` is set, the script content is ignored."
103-
A single `<script>` tag can't have both the `src` attribute and code inside.
102+
````warn header="Wenn `src` gesetzt ist, wird der Skript-Content ignoriert."
103+
Ein einzelner `<script>`-Tag kann nicht beides haben, das `src`-Attribute und Code innerhalb.
104104

105-
This won't work:
105+
Dies funktioniert nicht:
106106

107107
```html
108-
<script *!*src*/!*="file.js">
109-
alert(1); // the content is ignored, because src is set
108+
<script *!*src*/!*="datei.js">
109+
alert(1); // der Inhalt wird ignoriert, weil src ist gesetzt.
110110
</script>
111111
```
112112

113-
We must choose either an external `<script src="…">` or a regular `<script>` with code.
113+
Wir müssen wählen, entweder ein externes `<script src="…">` oder ein reguläres `<script>` mit Code.
114114

115-
The example above can be split into two scripts to work:
115+
Um zu funktionieren kann das obige Beispiel in zwei Skripte unterteilt werden:
116116

117117
```html
118-
<script src="file.js"></script>
118+
<script src="datei.js"></script>
119119
<script>
120120
alert(1);
121121
</script>
122122
```
123123
````
124124
125-
## Summary
125+
## Zusammenfassung
126126
127-
- We can use a `<script>` tag to add JavaScript code to a page.
128-
- The `type` and `language` attributes are not required.
129-
- A script in an external file can be inserted with `<script src="path/to/script.js"></script>`.
127+
- Wir können einen `<script>`-Tag nutzen, um JavaScript-Code einer Seite hinzuzufügen.
128+
- Die `type`- und `language`-Attribute sind nicht erforderlich.
129+
- Ein Skript in einer externen Datei kann mit `<script src="pfad/zum/skript.js"></script>` eingefügt werden.
130130
131131
132-
There is much more to learn about browser scripts and their interaction with the webpage. But let's keep in mind that this part of the tutorial is devoted to the JavaScript language, so we shouldn't distract ourselves with browser-specific implementations of it. We'll be using the browser as a way to run JavaScript, which is very convenient for online reading, but only one of many.
132+
Es gibt noch viel mehr über Browser-Skripte und ihre Interaktion mit Webseiten zu lernen. Aber vergessen wir nicht, dass dieser Teil des Tutorials JavaScript selbst gewidmet ist, wir sollten uns nicht von browser-spezifischen Implementierungen ablenken lassen. Wir werden den Browser als Methode zum Ausführen von JavaScript verwenden, was für das Online-Lesen sehr praktisch ist, aber nur eine von vielen.

0 commit comments

Comments
 (0)