-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
lesson-8-defining-variables.pot
208 lines (187 loc) · 7.01 KB
/
lesson-8-defining-variables.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
# 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-8-defining-variables/lesson.tres:13
msgid ""
"In the previous lesson, you used a predefined member variable named "
"[code]position[/code].\n"
"\n"
"In your projects, you will need to define your own variables.\n"
"\n"
"Imagine that you need to track the player's health in your game.\n"
"\n"
"They may start with [code]5[/code] health points. When taking a hit, the "
"health should go down to [code]4[/code]. After another hit, it should be "
"[code]3[/code]. And so on.\n"
"\n"
"To keep track of that, you can create a variable named "
"[code]health[/code] to which you add and subtract points.\n"
"\n"
"The example below introduces the [code]print()[/code] function, which "
"outputs its argument to the output box on the left.\n"
"\n"
"Click the [i]run()[/i] button to instantly run the entire function, and "
"click the [i]step[/i] button to execute lines of code one by one.\n"
"\n"
"The [i]Debugger[/i] panel at the bottom shows the current value of the "
"[code]health[/code] variable."
msgstr ""
#: course/lesson-8-defining-variables/lesson.tres:47
msgid ""
"After executing the first two lines of code, you will have a health "
"variable storing a value of [code]4[/code].\n"
"\n"
"Below, we'll break down how you define new variables and explain the "
"[code]print()[/code] function."
msgstr ""
#: course/lesson-8-defining-variables/lesson.tres:57
msgid "Defining a variable"
msgstr ""
#: course/lesson-8-defining-variables/lesson.tres:59
msgid ""
"To use a variable, you must first define it so the computer registers its"
" name.\n"
"\n"
"To do so, you start a line of code with the [code]var[/code] keyword "
"followed by your desired variable name. Like [code]func[/code] stands for"
" [i]function[/i], [code]var[/code] stands for [i]variable[/i].\n"
"\n"
"Variables are case-sensitive, which means [code]health[/code] and "
"[code]Health[/code] are technically different variables. Be careful to "
"use the same capitalization wherever you refer to the same variable, or "
"you could be reading or writing to a different variable.\n"
"\n"
"The following line defines a [code]health[/code] variable pointing to no "
"value. You can think of it as creating a product label you have yet to "
"stick onto something."
msgstr ""
#: course/lesson-8-defining-variables/lesson.tres:85
msgid ""
"Like with functions, a member variable's name must be unique inside a "
"given code file. Creating two variables next to each other with the same "
"name will cause an error."
msgstr ""
#: course/lesson-8-defining-variables/lesson.tres:105
msgid ""
"To use a variable, you want to assign it a starting value. You can do so "
"using the equal sign (=).\n"
"\n"
"This code assigns the value [code]100[/code] to a new variable named "
"[code]health[/code]."
msgstr ""
#: course/lesson-8-defining-variables/lesson.tres:127
msgid ""
"After defining your variable, you can access its value by writing the "
"variable's name."
msgstr ""
#: course/lesson-8-defining-variables/lesson.tres:147
msgid ""
"The code above will display the number [code]100[/code] to some output "
"window.\n"
"\n"
"Notice we don't use the [code]var[/code] keyword anymore as we only need "
"it to [i]define[/i] a variable.\n"
"\n"
"Also, once you define a variable, you can change its value anytime with "
"the equal sign."
msgstr ""
#: course/lesson-8-defining-variables/lesson.tres:169
msgid "About the print function"
msgstr ""
#: course/lesson-8-defining-variables/lesson.tres:171
msgid ""
"The [code]print()[/code] function is generally the first function you "
"learn in academic programming courses.\n"
"\n"
"It sends (\"prints\") the message or value you give it to some output "
"window, often a black window with plain white text."
msgstr ""
#: course/lesson-8-defining-variables/lesson.tres:183
msgid ""
"Programmers often use [code]print()[/code] to quickly check the value of "
"their variables when their game runs.\n"
"\n"
"In the app, we made a special output window that captures calls to "
"[code]print()[/code] and displays a card to make it friendlier for you."
msgstr ""
#: course/lesson-8-defining-variables/lesson.tres:205
msgid ""
"Here, the verb [i]print[/i] means \"to send information to display on the"
" screen.\"\n"
"\n"
"The function \"prints\" things on your computer display; It does not "
"relate to printers."
msgstr ""
#: course/lesson-8-defining-variables/lesson.tres:215
msgid "Variables are like labels"
msgstr ""
#: course/lesson-8-defining-variables/lesson.tres:217
msgid ""
"As we hinted above, in GDScript, variables work a bit like labels.\n"
"\n"
"Assigning a value to a variable is like taking your label (the variable) "
"and sticking it onto some item (the value)."
msgstr ""
#: course/lesson-8-defining-variables/lesson.tres:229
msgid ""
"Like a supermarket has a database of product labels, the computer keeps a"
" list of all variables in your code.\n"
"\n"
"Given the variable name, the computer can look up the attached value.\n"
"\n"
"It has an important consequence. In GDScript, you can stick that label to"
" any other value."
msgstr ""
#: course/lesson-8-defining-variables/lesson.tres:253
msgid ""
"The above code is like taking a label from the appropriate item and "
"sticking it to the wrong thing:\n"
"\n"
"- At line 2, the [code]health[/code] variable holds a number.\n"
"- From line 3, [code]health[/code] holds text.\n"
"\n"
"The computer will let you do that! The code's syntax and \"grammar\" are "
"correct, but it's not good.\n"
"\n"
"Variable names should describe the value they contain, so a "
"[code]health[/code] variable with a text value will confuse your future "
"self and other coders. It can also cause errors in your game.\n"
"\n"
"Later on, we'll see how to avoid this issue with [i]variable types[/i]. "
"For now, let's practice creating variables!"
msgstr ""
#: course/lesson-8-defining-variables/lesson.tres:270
msgid "Define a health variable"
msgstr ""
#: course/lesson-8-defining-variables/lesson.tres:271
msgid ""
"Define a variable named [code]health[/code] with a starting value of "
"[code]100[/code].\n"
"\n"
"You can define variables inside or outside functions. In this practice, "
"you shouldn't create a function."
msgstr ""
#: course/lesson-8-defining-variables/lesson.tres:282
msgid ""
"In this practice, you'll define your first variable and give it a "
"specific starting value."
msgstr ""
#: course/lesson-8-defining-variables/lesson.tres:286
msgid "Defining Your Own Variables"
msgstr ""