-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathlesson-5-your-first-function.pot
291 lines (255 loc) · 9.63 KB
/
lesson-5-your-first-function.pot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
# Translations template for Learn GDScript From Zero.
# Copyright (C) 2024 GDQuest
# This file is distributed under the same license as the Learn GDScript From
# Zero project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Learn GDScript From Zero \n"
"Report-Msgid-Bugs-To: https://github.com/GDQuest/learn-gdscript\n"
"POT-Creation-Date: 2024-12-12 14:39+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.10.1\n"
#: course/lesson-5-your-first-function/lesson.tres:14
msgid ""
"So far, we have called existing functions that other developers wrote.\n"
"\n"
"In this lesson, we'll talk more about what functions are and see some "
"examples. Then, you will learn how to define your own functions."
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:24
msgid "Functions are named sequences of instructions"
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:26
msgid ""
"Functions are [i]sequences of instructions[/i] we give a name. We call "
"that name an [i]identifier[/i].\n"
"\n"
"Using the identifier, we can get the computer to execute all the "
"instructions inside the function as many times as we need. This is what a"
" [i]function call[/i] does."
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:36
msgid "Learn more about identifiers"
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:38
msgid ""
"In computer programming, we talk about [i]identifiers[/i] rather than "
"\"names\".\n"
"\n"
"It is because a function name is a label the computer uses to precisely "
"[i]identify[/i] and refer to a function or other code elements.\n"
"\n"
"Identifiers are unique: you cannot reuse the same name in a given "
"[i]space[/i] in your code.\n"
"\n"
"If you try to name two functions the same, the computer will raise an "
"error."
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:54
msgid ""
"If there is any code that you need to run multiple times, you can put it "
"inside a function and give it a name.\n"
"\n"
"The instructions inside a function can be any code you want, and they "
"will all run every time you call the function.\n"
"\n"
"Here's the example of a [code]move_and_rotate()[/code] function that "
"moves the turtle forward and then turns it 90°."
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:78
msgid ""
"The [code]move_and_rotate()[/code] function consists of two instructions,"
" each on a separate line. Both of those instructions call another "
"familiar function.\n"
"\n"
"You could write another function that calls "
"[code]move_and_rotate()[/code] four times to draw a square of length 200 "
"pixels."
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:100
msgid ""
"Every time we call [code]move_and_rotate()[/code], the two functions "
"[code]move_forward(200)[/code] and [code]turn_right(90)[/code] are called"
" in sequence.\n"
"\n"
"In this simple example, it may not feel super useful. Here's a more "
"useful and realistic one: a function to draw any square.\n"
"\n"
"The following function uses [i]parameters[/i], which we will explore in "
"the next lesson.\n"
"\n"
"[i]Drag the slider to change the square's size.[/i]"
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:124
msgid "How to define your own functions"
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:126
msgid ""
"Let's break down how you define a function.\n"
"\n"
"A function definition starts with the [code]func[/code] keyword followed "
"by a space, the function's name, parentheses, and a colon."
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:148
msgid ""
"The instructions inside the function [b]must[/b] all start with a leading"
" tab character. You can insert that tab character by pressing the "
"[b]Tab[/b] key.\n"
"\n"
"We call those leading tabs [i]indents[/i]. They're important: the "
"computer uses them to know which instructions are part of the same code "
"block."
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:158
msgid "Why do we use functions?"
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:161
msgid ""
"Functions are groups of instructions we reuse every time we call the "
"function.\n"
"\n"
"Because we give functions a name, they also allow us to name a set of "
"instructions, which is handy!"
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:164
#: course/lesson-5-your-first-function/lesson.tres:165
msgid "To reuse code multiple times. "
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:164
#: course/lesson-5-your-first-function/lesson.tres:165
msgid "To run multiple instructions in one go."
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:164
#: course/lesson-5-your-first-function/lesson.tres:165
msgid "To put a name on multiple lines of code."
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:172
msgid "Names in code have rules"
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:174
msgid ""
"Function identifiers cannot contain spaces. In general, names in "
"programming languages cannot contain spaces.\n"
"\n"
"The computer uses spaces to detect the separation between different "
"keywords and identifiers.\n"
"\n"
"Instead of spaces, in GDScript, we use underscores (\"_\"). You saw this "
"already with functions like [code]move_forward()[/code] or "
"[code]move_local_x()[/code]. This is the convention we follow in "
"GDScript.\n"
"\n"
"There's another convention programmers use in some other programming "
"languages.\n"
"\n"
"Instead of using underscores, they start words with capital letters "
"except for the first one. With that convention, you'd write function "
"names like [code]moveForward()[/code] or [code]moveLocalX()[/code]\n"
"\n"
"Identifiers also [i]have[/i] to start with a letter or an underscore; You"
" [i]can't[/i] begin with a number, but you can use numbers after the "
"first character."
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:192
msgid "Which of the following names are valid function names?"
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:193
msgid "Note that it's fine to use capital letters."
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:195
msgid ""
"You can't name a function [code]move forward[/code] because it contains a"
" space. Names in code cannot contain spaces.\n"
"\n"
"They can't start with numbers either, which is why "
"[code]45_degree_turn[/code] is also invalid. \n"
"\n"
"However, having numbers elsewhere in a function name is fine. That's why "
"[code]make3NewCharacters[/code] works."
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:200
msgid "move forward"
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:200
#: course/lesson-5-your-first-function/lesson.tres:201
msgid "jump"
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:200
#: course/lesson-5-your-first-function/lesson.tres:201
msgid "make3NewCharacters"
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:200
#: course/lesson-5-your-first-function/lesson.tres:201
msgid "move_forward"
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:200
msgid "45_degree_turn"
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:208
msgid "Instantly moving the turtle to a different position"
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:210
msgid ""
"In order to draw multiple squares in different positions, we introduce a "
"new function for our turtle to use.\n"
"\n"
"The [code]jump()[/code] function picks up the turtle and places it "
"relative to where it is.\n"
"\n"
"So calling [code]jump(-100, 50)[/code] moves the turtle by 100 pixels to "
"the [b]left[/b] and 50 pixels [b]down[/b] without drawing any lines."
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:232
msgid "A function to draw squares"
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:233
msgid ""
"Code a function named [code]draw_square()[/code] to draw one square of "
"length 200 pixels. The function should take no parameters.\n"
"\n"
"Use the [code]move_forward()[/code] and [code]turn_right()[/code] "
"functions to instruct the turtle.\n"
"\n"
"In the following practice, you'll use the [code]draw_square()[/code] "
"function to draw multiple squares by calling your own function."
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:246
msgid ""
"Until now, you've had to write code by hand, and it's boring. It's time "
"to code a reusable function. You'll use it to draw multiple squares."
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:251
msgid "Drawing multiple squares"
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:252
msgid ""
"You have a function to draw one square: [code]draw_square()[/code]. Use "
"it to draw three squares.\n"
"\n"
"We already created [code]draw_square()[/code] for you. Create a function "
"named [code]draw_three_squares[/code] that calls "
"[code]draw_square()[/code] three times.\n"
"\n"
"If you just call the function, all three squares will overlap. To stack "
"them diagonally, call [code]jump(300, 300)[/code] between two calls to "
"[code]draw_square()[/code].\n"
"\n"
"Calling [code]jump(300, 300)[/code] makes the turtle jump by 300 pixels "
"to the right and 300 pixels down without drawing any lines."
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:275
msgid ""
"Now you created a function to draw squares, you can reuse it by calling "
"it multiple times."
msgstr ""
#: course/lesson-5-your-first-function/lesson.tres:279
msgid "Coding Your First Function"
msgstr ""