Skip to content

Commit 25a6daf

Browse files
Averyhmdne
authored andcommitted
de: Section #6 translated
Signed-off-by: Avery <>
1 parent 4f33677 commit 25a6daf

8 files changed

Lines changed: 157 additions & 130 deletions

File tree

translations/de/try_ruby_380.md

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,37 @@
11
---
2-
lang: EN
3-
title: The world is our oyster
2+
lang: DE
3+
title: Die Welt liegt uns zu Füßen
44
answer: ^\{\"William
5-
ok: Good. Bit difficult to read.
5+
ok: Gut. Etwas schwierig zu lesen.
66
error:
77
load: def get_shakey; {"William Shakespeare"=>{"1"=>{"title"=>"The Two Gentlemen of Verona", "finished"=>1591},"2"=>{"title"=>"The Taming of the Shrew", "finished"=>1591},"3"=>{"title"=>"Henry VI, Part 2", "finished"=>1591},"4"=>{"title"=>"Henry VI, Part 3", "finished"=>1591},"5"=>{"title"=>"Henry VI, Part 1", "finished"=>1592},"6"=>{"title"=>"Titus Andronicus", "finished"=>1592},"7"=>{"title"=>"Richard III", "finished"=>1593},"8"=>{"title"=>"Edward III", "finished"=>1593},"9"=>{"title"=>"The Comedy of Errors", "finished"=>1594},"10"=>{"title"=>"Love's Labour's Lost", "finished"=>1595},"11"=>{"title"=>"Love's Labour's Won", "finished"=>1596},"12"=>{"title"=>"Richard II", "finished"=>1595},"13"=>{"title"=>"Romeo and Juliet", "finished"=>1595},"14"=>{"title"=>"A Midsummer Night's Dream", "finished"=>1595},"15"=>{"title"=>"King John", "finished"=>1596},"16"=>{"title"=>"The Merchant of Venice", "finished"=>1597},"17"=>{"title"=>"Henry IV, Part 1", "finished"=>1597},"18"=>{"title"=>"The Merry Wives of Windsor", "finished"=>1597},"19"=>{"title"=>"Henry IV, Part 2", "finished"=>1598},"20"=>{"title"=>"Much Ado About Nothing", "finished"=>1599},"21"=>{"title"=>"Henry V", "finished"=>1599},"22"=>{"title"=>"Julius Caesar", "finished"=>1599},"23"=>{"title"=>"As You Like It", "finished"=>1600},"24"=>{"title"=>"Hamlet", "finished"=>1601},"25"=>{"title"=>"Twelfth Night", "finished"=>1601},"26"=>{"title"=>"Troilus and Cressida", "finished"=>1602},"27"=>{"title"=>"Sir Thomas More", "finished"=>1604},"28"=>{"title"=>"Measure for Measure", "finished"=>1604},"29"=>{"title"=>"Othello", "finished"=>1604},"30"=>{"title"=>"All's Well That Ends Well", "finished"=>1605},"31"=>{"title"=>"King Lear", "finished"=>1606},"32"=>{"title"=>"Timon of Athens", "finished"=>1606},"33"=>{"title"=>"Macbeth", "finished"=>1606},"34"=>{"title"=>"Antony and Cleopatra", "finished"=>1606},"35"=>{"title"=>"Pericles, Prince of Tyre", "finished"=>1608},"36"=>{"title"=>"Coriolanus", "finished"=>1608},"37"=>{"title"=>"The Winter's Tale", "finished"=>1611},"38"=>{"title"=>"Cymbeline", "finished"=>1610},"39"=>{"title"=>"The Tempest", "finished"=>1611},"40"=>{"title"=>"Cardenio", "finished"=>1613},"41"=>{"title"=>"Henry VIII", "finished"=>1613},"42"=>{"title"=>"The Two Noble Kinsmen", "finished"=>1614}}}; end;
88
---
99

10-
So far we have been running programs that only use things that we have typed ourselves.
11-
Which is nice, I mean that _Odelaying_ was epic, but this is the internet era so it is about
12-
time we included the rest of the world in our programming efforts.
10+
Bislang haben wir Programme laufen lassen, die nur Dinge verwenden, die wir
11+
selbst eingegeben haben.
12+
Was schön ist, ich meine, dass _Odelaying_ episch war, aber dies ist das
13+
Internet-Zeitalter, also ist es an der Zeit, dass wir den Rest der Welt in
14+
unsere Programmierbemühungen mit einbeziehen.
1315

14-
Many, many, many websites are available that you can ask for information. For instance
15-
this link will give you all current <a href="http://news.google.com/news/section?q=ruby&output=rss" target="_blank">Google news feeds</a>
16-
about Ruby.
16+
Es gibt viele, viele, viele Websites, die du um Informationen bitten kannst.
17+
Unter diesem Link findest du zum Beispiel alle aktuellen
18+
<a href="http://news.google.com/news/section?q=ruby&output=rss" target="_blank">Google-Nachrichten</a>
19+
über Ruby.
1720

18-
Your web browser will probably display it quite nicely for you. If you look at the source
19-
(type: control-U) you will see a long string of strangely formatted text. In the Google example
20-
it is in the __rss__ format.
21+
Dein Webbrowser wird den Text wahrscheinlich recht gut anzeigen. Wenn du dir
22+
den Quelltext ansiehst (tippe: Strg-U), wirst du eine lange Kette von seltsam
23+
formatiertem Text sehen. Im Google-Beispiel ist er im Format __rss__.
2124

22-
### Formats
23-
There are many other formats, with strange names, available and used on the web, like:
24-
html, xml and json. Yes, even this very website uses a couple of these.
25+
### Formate
26+
Es gibt viele andere Formate mit merkwürdigen Namen, die im Internet verfügbar
27+
sind und verwendet werden, wie html, xml und json. Ja, sogar diese Website
28+
verwendet einige von ihnen.
2529

26-
I have prepared a method for you that will fetch a list of the complete works of William
27-
Shakespeare from the internet.
28-
(Don't worry it actually comes from the same server that this website runs on, so
29-
we're not bothering anyone.)
30+
Ich habe eine Methode für dich vorbereitet, mit der du eine Liste der
31+
kompletten Werke von William Shakespeare aus dem Internet holt. (Keine Sorge,
32+
sie kommt vom selben Server, auf dem auch diese Website läuft, wir stören also
33+
niemanden.)
3034

31-
Get the data with:
35+
Hole die Daten mit:
3236

3337
get_shakey

translations/de/try_ruby_390.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
---
2-
lang: EN
2+
lang: DE
33
title: Noble Kinsmen
44
answer: ^The Two Noble Kinsmen$
5-
ok: That's much better
5+
ok: Viel besser
66
error:
77
load: prev
88
---
99

10-
Okay we now have a list of plays from the internet. The list was in the json format.
11-
Fortunately for us Ruby kindly provides a method to convert json data to a Ruby hash.
12-
The _get\_shakey_ method already did that for us.
10+
Okay, wir haben jetzt eine Liste von Theaterstücken aus dem Internet. Die
11+
Liste war im json-Format. Zum Glück bietet uns Ruby eine Methode, um json-Daten
12+
in einen Ruby-Hash zu konvertieren. Die Methode _get\_shakey_ hat das bereits
13+
für uns getan.
1314

14-
But since the structure of the json data is retained in the hash, it is still a bit difficult to read.
15-
Let us write a method to display the plays nicely.
15+
Aber da die Struktur der json-Daten im Hash beibehalten wird, ist es immer noch
16+
ein bisschen schwierig zu lesen. Lass uns eine Methode schreiben, welche die
17+
Stücke schön anzeigt.
1618

17-
If you inspect the list of plays carefully you will see that it has a kind of nested
18-
structure. (This is actually quite common in data you get from the internet.)
19-
Looks like this:
19+
Wenn du dir die Liste der Stücke genau ansiehst, wirst du sehen, dass sie eine
20+
Art verschachtelte Struktur hat. (Das ist bei Daten aus dem Internet ziemlich
21+
üblich.) So sieht das aus:
2022

2123
<ul>
2224
<li>"William Shakespeare"
@@ -38,13 +40,14 @@ Looks like this:
3840
</li>
3941
</ul>
4042

41-
To list the plays we first have to access the top "William Shakespeare" hash element by its name.
42-
Next we have to __iterate__ through each element below it.
43+
Um die Stücke aufzulisten, müssen wir zunächst auf das oberste Hash-Element
44+
"William Shakespeare" über seinen Namen zugreifen. Als Nächstes müssen wir
45+
durch jedes Element darunter __iterieren__.
4346

44-
Ruby has a method for iterating. It is called __each__. We have seen it before when
45-
creating our book rating system.
47+
Ruby hat eine Methode zum Iterieren. Sie heißt __each__. Wir haben sie bereits
48+
bei der Erstellung unseres Buchbewertungssystems gesehen.
4649

47-
Everything that method __each__ returns is passed to a block:
50+
Alles, was die Methode __each__ zurückgibt, wird an einen Block übergeben:
4851

4952
s = get_shakey
5053

translations/de/try_ruby_400.md

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
---
2-
lang: EN
3-
title: All together now
2+
lang: DE
3+
title: Jetzt alle zusammen
44
answer: ^4$
5-
ok: Yes, Shakespeare wrote 4 plays in 1591
6-
error: Answer for the year 1591 should be 4
5+
ok: Ja, Shakespeare hat 4 Stücke im Jahr 1591 geschrieben.
6+
error: Die Antwort für das Jahr 1591 sollte 4 sein
77
load: prev
88
---
99

10-
Now suppose we only want to know the names and number of plays written by Shakespeare
11-
in a certain year.
10+
Nehmen wir nun an, wir wollen nur die Namen und die Anzahl der Stücke wissen,
11+
die Shakespeare in einem bestimmten Jahr geschrieben hat.
1212

13-
Ruby lets us __select__ values from a hash. The select method uses a block to let us
14-
define what to select and returns what it found.
13+
Mit Ruby kann man Werte aus einem Hash __selektieren__. Die select-Methode
14+
verwendet einen Block, um zu definieren, was ausgewählt werden soll, und gibt
15+
das gefundene Ergebnis zurück.
1516

16-
We can then use the results returned by __select__ in the __each__ method as before by
17-
simply adding it after the select block. This is another example of method chaining, which we saw
18-
earlier when reversing a poem.
17+
Wir können dann die von __select__ zurückgegebenen Ergebnisse in der __each__-
18+
Methode wie zuvor verwenden, indem wir sie einfach nach dem select-Block
19+
hinzufügen. Dies ist ein weiteres Beispiel für die Methodenverkettung, die wir
20+
bereits bei der Umkehrung eines Gedichts gesehen haben.
1921

20-
I have prepared the __count\_plays__ method for you. See if you can find out how many plays
21-
were written by Shakespeare in the year __1591__. Try this:
22+
Ich habe die Methode __count\_plays__ für dich vorbereitet. Versuche
23+
herauszufinden, wie viele Stücke von Shakespeare im Jahr __1591__ geschrieben
24+
wurden. Versuche es hiermit:
2225

2326
def count_plays(year)
2427
s = get_shakey
@@ -33,9 +36,9 @@ were written by Shakespeare in the year __1591__. Try this:
3336

3437
puts count_plays(0)
3538

36-
Did you notice that I chained the count method at the end of the each method. This gives
37-
us a return value for the __count\_plays__ method.
39+
Hast du gemerkt, dass ich die count-Methode am Ende der each-Methode angehängt
40+
habe. Dadurch erhalten wir einen Rückgabewert für die Methode __count\_plays__.
3841

39-
There is another possibility for chaining here. See that lonely line __s = get_shakey__.
40-
You could add the __["William Shakespeare"].select { |k, v|__ at the end of get_shakey
41-
(no dot needed in this case).
42+
Es gibt hier eine weitere Möglichkeit der Verkettung. Siehe die einsame Zeile
43+
__s = get_shakey__. Man könnte __["William Shakespeare"].select { |k, v|__ am
44+
Ende von get_shakey hinzufügen (in diesem Fall ist kein Punkt erforderlich).

translations/de/try_ruby_410.md

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
11
---
2-
lang: EN
3-
title: All's Well That Ends Well
2+
lang: DE
3+
title: Ende gut, alles gut
44
answer: All's Well That Ends Well
5-
ok: True
6-
error: Use 1605 as the second parameter
5+
ok: Wahr
6+
error: Verwende 1605 als zweiten Parameter
77
load: prev
88
---
99

10-
Okay, we got some data from the internet, we selected what we wanted and printed it out.
11-
What is left to improve? We could print the results a bit prettier. Like add the year
12-
and align titles and years.
10+
Okay, wir haben uns ein paar Daten aus dem Internet besorgt, wir haben
11+
ausgewählt, was wir wollten und es ausgedruckt. Was können wir noch verbessern?
12+
Wir könnten die Ergebnisse etwas hübscher ausdrucken. Zum Beispiel das Jahr
13+
hinzufügen und Titel und Jahre ausrichten.
1314

14-
This means printing several values on one line. Ruby has a neat way of doing
15-
that. It is just like printing a string like: __puts "Hi, my name is Jimmy"__.
16-
But instead of the literal value _Jimmy_ we use the value of a variable.
15+
Das bedeutet, mehrere Werte in einer Zeile auszugeben. Ruby hat eine nette
16+
Art, das zu tun. Es ist so, als würde man eine Zeichenkette ausgeben wie:
17+
__puts "Hallo, mein Name ist Jimmy"__ aus. Aber anstelle des literalen Wertes
18+
_Jimmy_ verwenden wir den Wert einer Variablen.
1719

18-
First replace __Jimmy__ with __#{}__. If Ruby sees a hash symbol # followed by a curly brace {
19-
it looks for a variable between the first brace and the following closing brace }.
20-
So we can use this: __"Hi, my name is \#{name}"__.
20+
Ersetze als erstes __Jimmy__ durch __#{}__. Wenn Ruby ein Raute-Symbol #
21+
gefolgt von einer geschweiften Klammer { sieht, sucht es nach einer Variablen
22+
zwischen der ersten Klammer und der folgenden schließenden Klammer }.
23+
Wir können also Folgendes verwenden: __"Hallo, mein Name ist \#{name}"__.
2124

22-
Let's change our code a bit
25+
Ändern wir unseren Code ein wenig
2326

2427
def print_plays(year_from, year_to)
2528
get_shakey["William Shakespeare"]
@@ -32,9 +35,12 @@ Let's change our code a bit
3235
end
3336
print_plays(1600, 1605)
3437

35-
I have added __.ljust(30)__ to the title. This way the title is _left justified_ with a minimum
36-
length of 30 characters so the years align nicely.
38+
Ich habe __.ljust(30)__ zum Titel hinzugefügt. Auf diese Weise ist der Titel
39+
_linksbündig_ mit einer Mindestlänge von 30 Zeichen, so dass die Jahreszahlen
40+
hübsch angeordnet sind.
3741

38-
See if you can change the ouput of the program so that it shows the plays like this: __1600 -> As You Like It__
42+
Versuche, die Ausgabe des Programms so zu ändern, dass es die Stücke wie folgt
43+
anzeigt: __1600 -> As You Like It__
3944

40-
__All's Well That Ends Well?__ Hey we're not done yet, but the end is in sight!
45+
__Ende gut, alles gut?__ Hey, wir sind noch nicht fertig, aber das Ende ist in
46+
Sicht!

translations/de/try_ruby_420.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
11
---
2-
lang: EN
3-
title: If only I knew how to make a decision
2+
lang: DE
3+
title: Wenn ich nur wüsste, wie man eine Entscheidung trifft
44
answer:
55
ok:
66
error:
77
---
88

9-
Decision making, in real life this can be a real problem. Not for us though.
10-
Ruby makes it very easy to make decisions.
9+
Entscheidungsfindung, das kann im echten Leben ein echtes Problem sein. Aber
10+
nicht für uns.
11+
Ruby macht es sehr einfach, Entscheidungen zu treffen.
1112

1213
if 1 < 2
1314
puts "It is true: 1 is less than 2"
1415
end
1516

16-
The key word here is __if__. If can be placed before a method or after a method, like so:
17+
Das Schlüsselwort hier ist __if__. If kann vor einer Methode oder nach einer
18+
Methode platziert werden, etwa so:
1719

1820
puts "It is true: 1 is less than 2" if 1 < 2
1921

20-
__If__ is a method that requires one parameter. That parameter can be any expression that you
21-
want to test. The outcome of the expression must be either __true__ or __false__.
22-
Here are a couple of expressions with their outcomes:
22+
__If__ ist eine Methode, die einen Parameter benötigt. Dieser Parameter kann
23+
ein beliebiger Ausdruck sein, den du testen möchtest. Das Ergebnis des
24+
Ausdrucks muss entweder __true__ oder __false__ sein.
25+
Hier sind einige Ausdrücke mit ihren Ergebnissen:
2326

2427
5 <= 10 # => true
2528
'abc' == 'def' # => false
@@ -32,5 +35,5 @@ Here are a couple of expressions with their outcomes:
3235
# comparison of String with
3336
# Numeric failed
3437

35-
The _if expression_ can take many forms. It can compare literal values (1 < 2),
36-
variables (a < 1) and the return value of a method ('xyz'.empty?).
38+
Der _if-Ausdruck_ kann viele Formen annehmen. Er kann literale Werte (1 < 2),
39+
Variablen (a < 1) und den Rückgabewert einer Methode ('xyz'.empty?) vergleichen.

translations/de/try_ruby_430.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
---
2-
lang: EN
3-
title: And Now For the Startling Conclusion
2+
lang: DE
3+
title: Und nun die erstaunliche Schlussfolgerung
44
answer: is not equal to 100$
5-
ok: That's better
6-
error: This can't be right
5+
ok: So ist es besser
6+
error: Das kann nicht richtig sein
77
---
88

9-
Did you see the 2 equal signs in __'abc' == 'def'__?
9+
Hast du die 2 Gleichheitszeichen in __'abc' == 'def'__ gesehen?
1010

11-
This __==__ means __is equal to__.
12-
The single equal sign that we have seen before means __assign a value to a variable__.
11+
Dieses __==__ bedeutet __ist gleich__.
12+
Das einzelne Gleichheitszeichen, das wir bereits gesehen haben, bedeutet
13+
__einer Variablen einen Wert zuweisen__.
1314

14-
To make it more confusing: you can use the assignment after an if method like this:
15+
Um es noch verwirrender zu machen: Sie können die Zuweisung nach einer if-
16+
Methode so verwenden:
1517

1618
a = 0
1719

@@ -21,14 +23,15 @@ To make it more confusing: you can use the assignment after an if method like th
2123
puts "#{a} is not equal to 100"
2224
end
2325

24-
Change the = into == and see what happens.
26+
Ändere das = in == und sieh, was passiert.
2527

26-
I can guarantee you that you will forget typing the second equal sign regularly. I also
27-
still forget it sometimes.
28+
Ich kann dir versichern, dass du regelmäßig vergessen wirst, das zweite
29+
Gleichheitszeichen zu tippen. Auch ich vergesse es manchmal noch.
2830

2931
### else
30-
In the code above I have added an else expression. This part will be executed when the
31-
__if test-expression__ evaluates to false.
32+
In dem obigen Code habe ich einen else-Ausdruck hinzugefügt. Dieser Teil wird
33+
ausgeführt, wenn der Ausdruck __if test-expression__ zu false ausgewertet wird.
3234

33-
> There are more variations to this if-then-else theme. You can read more
34-
> <a href="http://www.ruby-doc.org/core/syntax/control_expressions_rdoc.html" target="_blank">here</a>.
35+
> Es gibt noch weitere Varianten dieses if-then-else-Themas. Du kannst
36+
> <a href="http://www.ruby-doc.org/core/syntax/control_expressions_rdoc.html" target="_blank">hier</a>.
37+
> mehr lesen (auf Englisch).

translations/de/try_ruby_440.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,32 @@
11
---
2-
lang: EN
3-
title: Me hungry
4-
answer: ^Me not hungry
5-
ok: Yes
6-
error: No way am I hungry at 10 AM!
2+
lang: DE
3+
title: Ich hungrig
4+
answer: ^Ich nicht hungrig
5+
ok: Ja
6+
error: Um 10 Uhr bin ich auf gar keinen Fall hungrig!
77
---
88

9-
Okay, this is coming along wonderfully. This is simple stuff for you, but keep in mind that you
10-
didn't know __any Ruby whatsoever__ just fifteen minutes ago!
9+
Okay, das klappt ja wunderbar. Das ist einfaches Zeug für dich, aber vergiss
10+
nicht, dass du vor fünfzehn Minuten noch __gar kein Ruby__ kanntest!
1111

12-
Last step. Let's tie it all together, you know? Let's make it chime together like a very nice set
13-
of glistening chimes on the beach in the maginificent sunlight!
12+
Letzter Schritt. Verbinden wir alles miteinander, okay? Lassen wir es zusammen
13+
erklingen wie ein schönes, glitzerndes Glockenspiel am Strand im herrlichen
14+
Sonnenlicht!
1415

15-
We'll define two methods first and then take a decision:
16+
Wir werden zunächst zwei Methoden definieren und dann eine Entscheidung treffen:
1617

17-
def hungry?(time_of_day_in_hours)
18-
puts "Me hungry"
18+
def hungrig?(uhrzeit_in_stunden)
19+
puts "Ich hungrig"
1920
true
2021
end
2122

22-
def eat_an(what)
23-
puts "Me eat #{what}\n"
23+
def iss_einen(was)
24+
puts "Ich esse #{was}\n"
2425
end
2526

26-
eat_an 'apple' if hungry?(14)
27+
iss_einen 'Apfel' if hungrig?(14)
2728

28-
eat_an 'apple' if hungry?(10)
29+
iss_einen 'Apfel' if hungrig?(10)
2930

30-
Now see if you can change the method __hungry?__ to display __"Me not hungry"__ and returning false
31-
when the time is less than 12.
31+
Nun versuche, die Methode __hungrig?__ so zu ändern, dass sie __"Ich nicht
32+
hungrig"__ anzeigt und false zurückgibt, wenn die Zeit kleiner als 12 ist.

0 commit comments

Comments
 (0)