1
# SOME DESCRIPTIVE TITLE.
2
# Copyright (C) 2012, Tom Rothamel
3
# This file is distributed under the same license as the Ren'Py Visual Novel Engine package.
4
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
9
"Project-Id-Version: Ren'Py Visual Novel Engine 6.15.7\n"
10
"Report-Msgid-Bugs-To: \n"
11
"POT-Creation-Date: 2013-10-06 11:52\n"
12
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
"Language-Team: LANGUAGE <LL@li.org>\n"
16
"Content-Type: text/plain; charset=UTF-8\n"
17
"Content-Transfer-Encoding: 8bit\n"
19
#: ../../source/language_basics.rst:6
20
# 4327d79df33440bfa7062bb422e6f0e5
21
msgid "Language Basics"
24
#: ../../source/language_basics.rst:8
25
# 3056540819ef4864832b37f9865c9e93
26
msgid "Before we can describe the Ren'Py language, we must first describe the structure of a Ren'Py script. This includes how a files are broken into blocks made up of lines, and how those lines are broken into the elements that make up statements."
29
#: ../../source/language_basics.rst:14
30
# c6bcb8585b194784af291eae5a412389
34
#: ../../source/language_basics.rst:16
35
# f7fe9d939ef947f08fb30efe55a195f3
36
msgid "The script of a Ren'Py game is made up of all the files found under the game directory ending with the .rpy extension. Ren'Py will consider each of these files (in unicode order), and will use the contents of the files as the script."
39
#: ../../source/language_basics.rst:21
40
# e26f4bd18c8c4df9ae406f6645ccf217
41
msgid "Generally, there's no difference between a script broken into multiple files, and a script that consists of one big file. Control can be transferred between files by jumping to or calling a label in another file. This makes the division of a script up into files a matter of personal style - some game-makers prefer to have small files (like one per event, or one per day), while others prefer to have one big script."
44
#: ../../source/language_basics.rst:29
45
# 2003f28896b14f0b9d02097d03ac2c12
46
msgid "To speed up loading time, Ren'Py will compile the ``.rpy`` files into .rpyc files when it starts up. When a ``.rpy`` file is changed, the ``.rpyc`` file will be updated when Ren'Py starts up. However, if a .rpyc file exists without a corresponding ``.rpy`` file, the ``.rpyc`` file will be used. This can lead to problems if a ``.rpy`` file is deleted without deleting the .rpyc file."
49
#: ../../source/language_basics.rst:38
50
# e5ed0f68bc3343c4b58cba2a7f462421
54
#: ../../source/language_basics.rst:40
55
# 659caaf6b2cc442082ea292d67693864
56
msgid "A Ren'Py script file may contain comments. A comment begins with a hash mark ('#'), and ends at the end of the line containing the comment. As an exception, a comment may not be part of a string."
59
#: ../../source/language_basics.rst:51
60
# 5e772d4ac557479881620c3700457b62
61
msgid "Ren'Py ignores comments, so the script is treated like the comment wasn't there."
64
#: ../../source/language_basics.rst:56
65
# 18088e7e1f0e441a917a6718de6aabeb
69
#: ../../source/language_basics.rst:58
70
# b4631048aa53478ea0382f73d9795986
71
msgid "A script file is broken up into :dfn:`logical lines`. A logical line always begins at the start of a line in the file. A logical line ends at the end of a line, unless:"
74
#: ../../source/language_basics.rst:62
75
# b388f4c8aaee489bb6c50db1ce17321f
76
msgid "The last character on the line is a backslash ('\\\\')."
79
#: ../../source/language_basics.rst:64
80
# 89fa6c3ccf52472b8b4c745985b8f351
81
msgid "The line contains an open parenthesis character ('(', '{', or '['), that hasn't been matched by the cooresponding close parenthesis character (')', '}', or ']', respectively)."
84
#: ../../source/language_basics.rst:68
85
# 18f02adcf0504c868f709f234a90c132
86
msgid "The end of the line occurs during a string."
89
#: ../../source/language_basics.rst:70
90
# baebf6d0a7904d23ab03991057080622
91
msgid "Once a logical line ends, the next logical line begins at the start of the next line."
94
#: ../../source/language_basics.rst:73
95
# 656f3ca99bdb45ed864ad3954752e51f
96
msgid "Most statements in the Ren'Py language consist of a single logical line, while some statements consist of multiple lines."
99
#: ../../source/language_basics.rst:86
100
# d417cb21e91f4ca792e902ce4e689b88
101
msgid "Empty logical lines are ignored."
104
#: ../../source/language_basics.rst:90
105
# 2fd760b110c04e6f8280be3ad248408a
106
msgid "Indentation and Blocks"
109
#: ../../source/language_basics.rst:92
110
# fdada435d11b45c3827ed59fcbdec805
111
msgid ":dfn:`Indentation` is the name we give to the space at the start of each logical line that's used to line up Ren'Py statements. In Ren'Py, indentation must consist only of spaces."
114
#: ../../source/language_basics.rst:96
115
# f3ad6efbd24b4c85bb52a575b186ed2f
116
msgid "Indentation is used to group statements into :dfn:`blocks`. A block is a group of lines, and often a group of statements. The rules for dividing a file into blocks are:"
119
#: ../../source/language_basics.rst:100
120
# 1ccaf9eebb824b4fb59ae97cd36d3cce
121
msgid "A block is open at the start of a file."
124
#: ../../source/language_basics.rst:102
125
# 67496b84d7214298b7c747482be05d4f
126
msgid "A new block is started whenever a logical line is indented past the previous logical line."
129
#: ../../source/language_basics.rst:105
130
# b4aa428654a84bd988f763509e5af117
131
msgid "All logical lines inside a block must have the same indentation."
134
#: ../../source/language_basics.rst:107
135
# d4b8e4d6497f41169ea6ff43d6ac3ece
136
msgid "A block ends when a logical line is encountered with less indentation than the lines in the block."
139
#: ../../source/language_basics.rst:110
140
# 2a5e2d3609fa48f0bd0bc0f6f48edaa7
141
msgid "Indentation is very important to Ren'Py, and cause syntax or logical errors when it's incorrect. At the same time, the use of indentation to convey block structure provides us a way of indicating that structure without overwhelming the script text."
144
#: ../../source/language_basics.rst:129
145
# 3117d27f80e24c808a49ef0b9dee2490
146
msgid "Elements of Statements"
149
#: ../../source/language_basics.rst:131
150
# 19f9842a3405402ca88f4c877f06d289
151
msgid "Ren'Py statements are made of a few basic parts."
154
#: ../../source/language_basics.rst:140
155
# 401ee7f748fd41e195f13ec320e0671e
156
msgid ":dfn:`Keyword`"
159
#: ../../source/language_basics.rst:134
160
# 706e5f81e7d64f50bda0d5e505a63c6e
161
msgid "A keyword is a word that must literally appear in the source code. They're used to introduce statements and properties."
164
#: ../../source/language_basics.rst:137
165
# ee09ba85d55b48b1af752e880c0e0e5c
166
msgid "Names begining with a single underscore (_) are reserved for Ren'Py internal use, unless otherwise documented. When a name begins with __ but doesn't end with __, it is changed to a file-specfic version of that name."
169
#: ../../source/language_basics.rst:146
170
# 6daeddfbb9f2449892758cdbff437d0d
174
#: ../../source/language_basics.rst:143
175
# efbdceeda3bd40d0adf8a49332302cd4
176
msgid "A name begins with a letter or underscore, which is followed by zero or more letters, numbers, and underscores. For our purpose, unicode characters between U+00a0 and U+fffd are considered to be letters."
179
#: ../../source/language_basics.rst:148
180
# 6b7664a3b12e40ceaf4c598749b198dc
181
msgid ":dfn:`Image Name`"
184
#: ../../source/language_basics.rst:150
185
# 0820d68d629640efb3ac0cb2da7d53ca
186
msgid "An :dfn:`image name` consists of one or more names, separated by spaces. The first component of the image name is called the :dfn:`image tag`. The second and later components of the name are the :dfn:`image attributes`."
189
#: ../../source/language_basics.rst:155
190
# 07587e857ec249cd8cebe535e33dee1f
191
msgid "For example, take the image name ``mary beach night happy``. The image tag is ``mary``, while the image attributes are ``mary``, ``beach``, and ``night``."
194
#: ../../source/language_basics.rst:172
195
#: ../../source/language_basics.rst:251
196
# bb3f57713989453e9a12d4347c33bc65
197
# 72a6cb43a107424ea528f3df8f62edc5
198
msgid ":dfn:`String`"
201
#: ../../source/language_basics.rst:160
202
# 7697d895dcfc4486b01db0f88398965e
203
msgid "A string begins with a quote character (one of \", ', or \\`), contains some sequence of characters, and ends with the same quote character."
206
#: ../../source/language_basics.rst:164
207
# e745d4a828fd4b7e9a394e38ab405186
208
msgid "The backslash character (\\) is used to escape quotes, special characters such as % (written as \\%) and { (written as \\{). It's also used to include newlines, using the \\n sequence."
211
#: ../../source/language_basics.rst:168
212
# dcb8dd741827427392d01e9f524927a2
213
msgid "Inside a Ren'Py string, consecutive whitespace is compressed into a single whitespace character, unless a space is preceded by a backslash. ::"
216
#: ../../source/language_basics.rst:191
217
# 5762564911f14d74839b88d8c65ef66d
218
msgid ":dfn:`Simple Expression`"
221
#: ../../source/language_basics.rst:175
222
# 33b3df20e6bd48ee97731e5e550314f4
223
msgid "A simple expression is a Python expression, used to include Python in some parts of the Ren'Py script. A simple expression begins with:"
226
#: ../../source/language_basics.rst:179
227
# ea46a16830864ecf8bf8417a9a8a401c
231
#: ../../source/language_basics.rst:180
232
# cde80843052340fc970473607b0e7a83
236
#: ../../source/language_basics.rst:181
237
# 565be6b805b84cac9fdc12895826c30b
241
#: ../../source/language_basics.rst:182
242
# 3f141b4e738e492f952258179489e5e6
243
msgid "Any python expression, in parenthesis."
246
#: ../../source/language_basics.rst:184
247
# 2f5162bac20a4c9f8124d8b47ae000b4
248
msgid "This can be followed by any number of:"
251
#: ../../source/language_basics.rst:186
252
# 735ad03eadfd48038943810cdef74b73
253
msgid "A dot followed by a name."
256
#: ../../source/language_basics.rst:187
257
# 83ecbbcdc7304dae97a06a0c6f430f4a
258
msgid "A parenthesised python expression."
261
#: ../../source/language_basics.rst:189
262
# 7146b6fb54b4487192f7e2e8112793f9
263
msgid "As an example, ``3``, ``(3 + 4)``, ``foo.bar``, and ``foo(42)`` are all simple expressions. But ``3 + 4`` is not, as the expression ends at the end of a string."
266
#: ../../source/language_basics.rst:194
267
# 88d04f2a7ba9409bbbb92e7c6ded683a
268
msgid ":dfn:`At List`"
271
#: ../../source/language_basics.rst:194
272
# 64a48974301a4bd789eba78b38947870
273
msgid "An at list is a list of simple expressions, separated by commas."
276
#: ../../source/language_basics.rst:200
277
# fdea2ccae3354a9eabeec1915791e5a9
278
msgid ":dfn:`Python Expression`"
281
#: ../../source/language_basics.rst:197
282
# 267ccfb2f85443b69aca5c52c7634bd9
283
msgid "A python expression is an arbitrary python expression, that may not include a colon. These are used to express the conditions in the if and while statements."
286
#: ../../source/language_basics.rst:203
287
# 725ec119d32446b0b9ccdd27721fcc7f
288
msgid "Common Statement Syntax"
291
#: ../../source/language_basics.rst:205
292
# a331f2d6423543899be82c0f02a1ed08
293
msgid "Most Ren'Py statements share a common syntax. With the exception of the say statement, they begin with a keyword that introduces the statement. This keyword is followed by a parameter, if the statement takes one."
296
#: ../../source/language_basics.rst:210
297
# dfa8a540a6d24f5497a1cf25e8b8deb8
298
msgid "The parameter is then followed by one or more properties. Properties may be supplied in any order, provided each property is only supplied once. A property starts off with a keyword. For most properties, the property name is followed by one of the syntax elements given above."
301
#: ../../source/language_basics.rst:215
302
# 3290314be8dd484d867c1e41ce82acca
303
msgid "If the statement takes a block, the line ends with a colon (:). Otherwise, the line just ends."
306
#: ../../source/language_basics.rst:222
307
# 1a9911929916471297f5e1be8b21ed7a
308
msgid "Python Expression Syntax"
311
#: ../../source/language_basics.rst:226
312
# 40fdac39e48a4cdeab67e80b0b049287
313
msgid "It may not be necessary to read this section thoroughly right now. Instead, skip ahead, and if you find yourself unable to figure out an example, or want to figure out how things actually work, you can go back and review this."
316
#: ../../source/language_basics.rst:232
317
# b00562824235490a98ae239672fb64bb
318
msgid "Many portions of Ren'Py take python expressions. For example, defining a new Character involves a call to the Character function. While Python expressions are very powerful, only a fraction of that power is necessary to write a basic Ren'Py game."
321
#: ../../source/language_basics.rst:237
322
# 83f100aa5b9644af8868ff4f310dc932
323
msgid "Here's a synopsis of python expressions."
326
#: ../../source/language_basics.rst:241
327
# 531e9307f7dc440797b45d71ed7ab0c1
328
msgid ":dfn:`Integer`"
331
#: ../../source/language_basics.rst:240
332
# 28f9c6a244b84761aafc84832e6dd1ce
333
msgid "An integer is a number without a decimal point. ``3`` and ``42`` are integers."
336
#: ../../source/language_basics.rst:245
337
# 7e491d2acc3c4dc2aa66f0e790c0b1ca
341
#: ../../source/language_basics.rst:244
342
# 520c25d9b0834329941199ce01e54bda
343
msgid "A float (short for floating-point number) is a number with a decimal point. ``.5``, ``7.``, and ``9.0`` are all floats."
346
#: ../../source/language_basics.rst:248
347
# 9201bb80426941ffabce729f14098880
348
msgid "Python strings begin with \" or ', and end with the same character. \\\\ is used to escape the end character, and to introduce special characters like newlines (\\\\n). Unlike Ren'Py strings, python strings can't span lines."
351
#: ../../source/language_basics.rst:256
352
# 49c838581dc245fcaf4e96eeace7ef72
353
msgid ":dfn:`True, False, None`"
356
#: ../../source/language_basics.rst:254
357
# bdf5d614e3cd40258b53f7a77d4d712d
358
msgid "There are three special values. ``True`` is a true value, ``False`` is a false value. ``None`` represents the absence of a value. For example,"
361
#: ../../source/language_basics.rst:272
362
# eb6d0bf791fd4d56b1cedefa4ececeaa
366
#: ../../source/language_basics.rst:259
367
# 7778e02dbb304244b2f81d1fa007ee88
368
msgid "Tuples are used to represent containers where the number of items is important. For example, one might use a 2-tuple (also called a pair) to represent width and height, or a 4-tuple (x, y, width, height) to represent a rectangle."
371
#: ../../source/language_basics.rst:264
372
# 4fa5dc737b48421abfa54f4ad5f211a6
373
msgid "Tuples begin with a left-parenthesis ``(``, consist of zero or more comma-separated python expressions, and end with a right-parenthesis ``)``. As a special case, the one-item tuple must have a parenthesis following the item. For example::"
376
#: ../../source/language_basics.rst:282
377
# 7c619bb9245748eaadd4a90ad520716f
381
#: ../../source/language_basics.rst:275
382
# acdf293eedbf4e579ae35dd4d4a52ae5
383
msgid "Lists are used to represent containers where the number of items may vary. A list begins with a ``[``, contains a comma-separated list of expressions, and ends with ``]``. For example::"
386
#: ../../source/language_basics.rst:295
387
# 9c4739cd49df4c908008fe77a0568620
388
msgid ":dfn:`Variable`"
391
#: ../../source/language_basics.rst:285
392
# 04e76271233b49889f9f69c5aa961d7e
393
msgid "Python expressions can use variables, that store values defined using the define statement or python statements. A variable begins with a letter or underscore, and then has zero or more letters, numbers, or underscores. For example::"
396
#: ../../source/language_basics.rst:294
397
# 7e9c5d83eeda4cd4b18282ae5b8977fc
398
msgid "Variables beginning with _ are reserved for Ren'Py's use, and shouldn't be used by user code."
401
#: ../../source/language_basics.rst:305
402
# 37b7fea732a049cab95a676e9e7853e0
403
msgid ":dfn:`Field Access`"
406
#: ../../source/language_basics.rst:298
407
# 8e9f61c6f1754ec0a2604b8d2275e9d3
408
msgid "Python modules and objects have fields, which can be accessed with by following an expression (usually a variable) with a dot and the field name. For example::"
411
#: ../../source/language_basics.rst:304
412
# 24c6d4f043414cf6a2d30bfc4804f71e
413
msgid "Consists of a variable (config) followed by a field access (screen_width)."
416
#: ../../source/language_basics.rst:324
417
# 02998b2236c746678d5460f260f030c7
421
#: ../../source/language_basics.rst:308
422
# be918267c0434cb395edfe570c4aae8c
423
msgid "Python expressions can call a function which returns a value. They begin with an expression (usually a variable), followed by a left-parenthesis, a comma-separated list of arguments, and a right-parenthesis. The argument list begins with the position arguments, which are python expressions. These are followed by keyword arguments, which consist of the argument name, and equals sign, and an expression. In the example example::"
426
#: ../../source/language_basics.rst:318
427
# e40afd6ef75d4be9b02bf6d40e22f0d9
428
msgid "we call the Character function. It's given one positional argument, the string \"Eileen\". It's given two keyword argument: ``type`` with the value of the ``adv`` variable, and ``color`` with a string value of \"#0f0\"."
431
#: ../../source/language_basics.rst:323
432
# 6cc4cddda4434bd4be2c2e1ba16009d2
433
msgid "Constructors are a type of function which returns a new object, and are called the same way."
436
#: ../../source/language_basics.rst:326
437
# c448f8ee652b4b0fb89b34545b965bab
438
msgid "When reading this documentation, you might see a function signature like:"
441
#: ../../source/language_basics.rst:331
442
# c04c51c2de4b47ea80f41e51ae08d44a
443
msgid "A sample function that doesn't actually exist in Ren'Py, but is used only in documentation."
446
#: ../../source/language_basics.rst:334
447
# e9f74b0eb0864bb4906478aa9e3fc73d
448
msgid "This function:"
451
#: ../../source/language_basics.rst:336
452
# 53d2bbf743c442de93824b1ee764c333
453
msgid "Has the name \"Sample\""
456
#: ../../source/language_basics.rst:337
457
# 42e43680dedc45b08feac073ca8da8f2
458
msgid "Has two positional parameters, a name and a delay. In a real function, the types of these parameters would be made clear from the documentation."
461
#: ../../source/language_basics.rst:340
462
# f7faa69ed1a74a45b5ce2f991cb49c6f
463
msgid "Has one keyword argument, position, which has a default value of (0, 0)."
466
#: ../../source/language_basics.rst:343
467
# 0156309e968c4c7ebaacb69a2289187a
468
msgid "Since the functions ends with \\*\\*properties, it means that it can take :ref:`style properties <style-properties>` as additional keyword arguments. Other special entries are \\*args, which means that it takes an arbitrary number of postional parameters, and \\*\\*kwargs, which means that the keyword arguments are described in the documentation."
471
#: ../../source/language_basics.rst:349
472
# 06984d6397e34442bd56550bf10168a3
473
msgid "Python is a lot more powerful than we have space for in this manual. To learn Python in more detail, we recommend starting with the Python tutorial, which is available from `python.org <http://docs.python.org/release/2.7/tutorial/index.html>`_. While we don't think a deep knowledge of Python is necessary to work with Ren'Py, the basics of python statements and expressions is often helpful."