Debian Codegraph @

translations/manual/de/template_lang.po

raw
1 # SOME DESCRIPTIVE TITLE.
2 # Copyright (C) Kovid Goyal
3 # This file is distributed under the same license as the calibre package.
4 #
5 # Translators:
6 # Armin Geller <[email protected]>, 2015
7 # Ettore Atalan <[email protected]>, 2014
8 # 3Stadt <[email protected]>, 2017
9 # Sebastian Keller <[email protected]>, 2015
10 # Simon Schütte, 2015-2016
11 # RiseT, 2016-2017
12 msgid ""
13 msgstr ""
14 "Project-Id-Version: calibre\n"
15 "Report-Msgid-Bugs-To: \n"
16 "POT-Creation-Date: 2024-11-21 15:47+0000\n"
17 "PO-Revision-Date: 2014-06-17 08:34+0000\n"
18 "Last-Translator: 3Stadt <[email protected]>, 2017\n"
19 "Language-Team: German (http://app.transifex.com/calibre/calibre/language/de/)\n"
20 "MIME-Version: 1.0\n"
21 "Content-Type: text/plain; charset=UTF-8\n"
22 "Content-Transfer-Encoding: 8bit\n"
23 "Language: de\n"
24 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
25
26 #: ../../__w/calibre/calibre/manual/template_lang.rst:4
27 msgid "The calibre template language"
28 msgstr "Die Calibre-Vorlagensprache"
29
30 #: ../../__w/calibre/calibre/manual/template_lang.rst:6
31 msgid ""
32 "The calibre template language is a calibre-specific language used throughout"
33 " calibre for tasks such as specifying file paths, formatting values, and "
34 "computing the value for user-specified columns. Examples:"
35 msgstr ""
36
37 #: ../../__w/calibre/calibre/manual/template_lang.rst:8
38 msgid ""
39 "Specify the folder structure and file names when saving files from the "
40 "calibre library to the disk or e-book reader."
41 msgstr ""
42
43 #: ../../__w/calibre/calibre/manual/template_lang.rst:9
44 msgid "Define rules for adding icons and colors to the calibre book list."
45 msgstr ""
46
47 #: ../../__w/calibre/calibre/manual/template_lang.rst:10
48 msgid "Define `virtual columns` that contain data from other columns."
49 msgstr ""
50
51 #: ../../__w/calibre/calibre/manual/template_lang.rst:11
52 msgid "Advanced library searching."
53 msgstr ""
54
55 #: ../../__w/calibre/calibre/manual/template_lang.rst:12
56 msgid "Advanced metadata search and replace."
57 msgstr ""
58
59 #: ../../__w/calibre/calibre/manual/template_lang.rst:14
60 msgid ""
61 "The language is built around the notion of a `template`, which specifies "
62 "which book metadata to use, computations on that metadata, and how it is to "
63 "be formatted."
64 msgstr ""
65
66 #: ../../__w/calibre/calibre/manual/template_lang.rst:17
67 msgid "Basic templates"
68 msgstr ""
69
70 #: ../../__w/calibre/calibre/manual/template_lang.rst:19
71 msgid ""
72 "A basic template consists one or more ``template expressions``. A ``template"
73 " expression`` consists of text and names in curly brackets (``{}``) that is "
74 "replaced by the corresponding metadata from the book being processed. For "
75 "example, the default template in calibre used for saving books to device has"
76 " 4 ``template expressions``::"
77 msgstr ""
78
79 #: ../../__w/calibre/calibre/manual/template_lang.rst:23
80 msgid "For the book \"The Foundation\" by \"Isaac Asimov\" the will become::"
81 msgstr ""
82
83 #: ../../__w/calibre/calibre/manual/template_lang.rst:27
84 msgid ""
85 "The slashes are not ``template expressions`` because they are in between in "
86 "``{}``. Such text is left where it appears. For example, if the template "
87 "is::"
88 msgstr ""
89
90 #: ../../__w/calibre/calibre/manual/template_lang.rst:31
91 msgid "then for \"The Foundation\" the template produces::"
92 msgstr ""
93
94 #: ../../__w/calibre/calibre/manual/template_lang.rst:35
95 msgid ""
96 "A ``template expression`` can access all the metadata available in calibre, "
97 "including custom columns (columns you create yourself), by using a column's "
98 "``lookup name``. To find the lookup name for a `column` (sometimes called "
99 "`fields`), hover your mouse over the column header in calibre's book list. "
100 "Lookup names for custom columns always begin with ``#``. For series type "
101 "columns there is an additional field named ``#lookup name_index`` that is "
102 "the series index for that book in the series. For example, if you have a "
103 "custom series column named ``#myseries``, there will also be a column named "
104 "``#myseries_index``. The standard series column's index is named "
105 "``series_index``."
106 msgstr ""
107
108 #: ../../__w/calibre/calibre/manual/template_lang.rst:37
109 msgid "In addition to the standard column based fields, you also can use:"
110 msgstr ""
111
112 #: ../../__w/calibre/calibre/manual/template_lang.rst:39
113 msgid ""
114 "``{formats}`` - A list of formats available in the calibre library for a "
115 "book"
116 msgstr ""
117
118 #: ../../__w/calibre/calibre/manual/template_lang.rst:40
119 msgid "``{identifiers:select(isbn)}`` - The ISBN of the book"
120 msgstr ""
121
122 #: ../../__w/calibre/calibre/manual/template_lang.rst:42
123 msgid ""
124 "If the metadata for the field for a given book is not defined then the field"
125 " in the template is replaced by the empty string (``''``). For example, "
126 "consider the following template::"
127 msgstr ""
128
129 #: ../../__w/calibre/calibre/manual/template_lang.rst:46
130 msgid ""
131 "If Asimov's book \"Second Foundation\" is in the series \"Foundation\" then "
132 "the template produces::"
133 msgstr ""
134
135 #: ../../__w/calibre/calibre/manual/template_lang.rst:50
136 msgid ""
137 "If a series has not been entered for the book then the template produces::"
138 msgstr ""
139
140 #: ../../__w/calibre/calibre/manual/template_lang.rst:54
141 msgid ""
142 "The template processor automatically removes multiple slashes and leading or"
143 " trailing spaces."
144 msgstr ""
145
146 #: ../../__w/calibre/calibre/manual/template_lang.rst:57
147 msgid "Advanced formatting"
148 msgstr "Erweiterte Formatierung"
149
150 #: ../../__w/calibre/calibre/manual/template_lang.rst:59
151 msgid ""
152 "In addition to metadata substitution, templates can conditionally include "
153 "additional text and control how substituted data is formatted."
154 msgstr ""
155
156 #: ../../__w/calibre/calibre/manual/template_lang.rst:61
157 msgid "**Conditionally including text**"
158 msgstr ""
159
160 #: ../../__w/calibre/calibre/manual/template_lang.rst:63
161 msgid ""
162 "Sometimes you want text to appear in the output only if a field is not "
163 "empty. A common case is ``series`` and ``series_index`` where you want "
164 "either nothing or the two values separated by a hyphen. calibre handles this"
165 " case using a special ``template expression`` syntax."
166 msgstr ""
167
168 #: ../../__w/calibre/calibre/manual/template_lang.rst:65
169 msgid ""
170 "For example and using the above Foundation example, assume you want the "
171 "template to produce `Foundation - 3 - Second Foundation`. This template "
172 "produces that output:"
173 msgstr ""
174
175 #: ../../__w/calibre/calibre/manual/template_lang.rst:67
176 msgid "``{series} - {series_index} - {title}``"
177 msgstr ""
178
179 #: ../../__w/calibre/calibre/manual/template_lang.rst:69
180 msgid ""
181 "However, if a book has no series the template will produce `- - the title`, "
182 "which is probably not what you want. Generally, people want the result be "
183 "the title without the extraneous hyphens. You can accomplish this using the "
184 "following template syntax:"
185 msgstr ""
186
187 #: ../../__w/calibre/calibre/manual/template_lang.rst:71
188 msgid "``{field:|prefix_text|suffix_text}``"
189 msgstr ""
190
191 #: ../../__w/calibre/calibre/manual/template_lang.rst:73
192 msgid ""
193 "This ``template expression`` says that if ``field`` has the value `XXXX` "
194 "then the result will be `prefix_textXXXXXsuffix_text`. If ``field`` is empty"
195 " (has no value) then the result will be the empty string (nothing) because "
196 "the prefix and suffix are ignored. The prefix and suffix can contain blanks."
197 msgstr ""
198
199 #: ../../__w/calibre/calibre/manual/template_lang.rst:75
200 msgid ""
201 "**Do not use subtemplates (`{ ... }`) or functions (see below) in the prefix"
202 " or the suffix.**"
203 msgstr ""
204
205 #: ../../__w/calibre/calibre/manual/template_lang.rst:77
206 msgid ""
207 "Using this syntax, we can solve the above no-series problem with the "
208 "template::"
209 msgstr ""
210
211 #: ../../__w/calibre/calibre/manual/template_lang.rst:81
212 msgid ""
213 "The hyphens will be included only if the book has a series index, which it "
214 "has only if it has a series. Continuing the Foundation example again, the "
215 "template will produce `Foundation - 1 - Second Foundation`."
216 msgstr ""
217
218 #: ../../__w/calibre/calibre/manual/template_lang.rst:83
219 #: ../../__w/calibre/calibre/manual/template_lang.rst:289
220 #: ../../__w/calibre/calibre/manual/template_lang.rst:438
221 msgid "Notes:"
222 msgstr ""
223
224 #: ../../__w/calibre/calibre/manual/template_lang.rst:85
225 msgid ""
226 "You must include the colon after the ``lookup name`` if you are using a "
227 "prefix or a suffix."
228 msgstr ""
229
230 #: ../../__w/calibre/calibre/manual/template_lang.rst:86
231 msgid ""
232 "You must either use either no or both ``|`` characters. Using one, as in "
233 "``{field:| - }``, is not allowed."
234 msgstr ""
235
236 #: ../../__w/calibre/calibre/manual/template_lang.rst:87
237 msgid ""
238 "It is OK to provide no text for either the prefix or the suffix, such as in "
239 "``{series:|| - }``. The template ``{title:||}`` is the same as ``{title}``."
240 msgstr ""
241
242 #: ../../__w/calibre/calibre/manual/template_lang.rst:89
243 msgid "**Formatting**"
244 msgstr ""
245
246 #: ../../__w/calibre/calibre/manual/template_lang.rst:91
247 msgid ""
248 "Suppose you want the ``series_index`` to be formatted as three digits with "
249 "leading zeros. This does the trick:"
250 msgstr ""
251
252 #: ../../__w/calibre/calibre/manual/template_lang.rst:93
253 msgid "``{series_index:0>3s}`` - Three digits with leading zeros"
254 msgstr ""
255
256 #: ../../__w/calibre/calibre/manual/template_lang.rst:95
257 msgid "For trailing zeros, use:"
258 msgstr ""
259
260 #: ../../__w/calibre/calibre/manual/template_lang.rst:97
261 msgid "``{series_index:0<3s}`` - Three digits with trailing zeros"
262 msgstr ""
263
264 #: ../../__w/calibre/calibre/manual/template_lang.rst:99
265 msgid ""
266 "If you use series indices with fractional values, e.g., 1.1, you might want "
267 "the decimal points to line up. For example, you might want the indices 1 and"
268 " 2.5 to appear as 01.00 and 02.50 so that they will sort correctly on a "
269 "device that does lexical sorting. To do this, use:"
270 msgstr ""
271
272 #: ../../__w/calibre/calibre/manual/template_lang.rst:101
273 msgid ""
274 "``{series_index:0>5.2f}`` - Five characters consisting of two digits with "
275 "leading zeros, a decimal point, then 2 digits after the decimal point."
276 msgstr ""
277
278 #: ../../__w/calibre/calibre/manual/template_lang.rst:103
279 msgid "If you want only the first two letters of the data, use:"
280 msgstr ""
281
282 #: ../../__w/calibre/calibre/manual/template_lang.rst:105
283 msgid ""
284 "``{author_sort:.2}`` - Only the first two letters of the author sort name"
285 msgstr ""
286
287 #: ../../__w/calibre/calibre/manual/template_lang.rst:107
288 msgid ""
289 "Much of the calibre template language formatting comes from Python. For more"
290 " details on the syntax of these advanced formatting operations see the "
291 "`Python documentation "
292 "<https://docs.python.org/3/library/string.html#formatstrings>`_."
293 msgstr ""
294
295 #: ../../__w/calibre/calibre/manual/template_lang.rst:111
296 msgid "Using templates to define custom columns"
297 msgstr ""
298
299 #: ../../__w/calibre/calibre/manual/template_lang.rst:113
300 msgid ""
301 "Templates can be used to display information that isn't in calibre metadata,"
302 " or to display metadata differently from calibre's normal format. For "
303 "example, you might want to show the ``ISBN``, a field that calibre does not "
304 "display. You can accomplish this creating a custom column with the type "
305 "`Column built from other columns` (hereafter called `composite columns`) and"
306 " providing a template to generate the displayed text. The column will "
307 "display the result of evaluating the template. For example, to display the "
308 "ISBN, create the column and enter ``{identifiers:select(isbn)}`` in the "
309 "template box. To display a column containing the values of two series custom"
310 " columns, separated by a comma, use ``{#series1:||,}{#series2}``."
311 msgstr ""
312
313 #: ../../__w/calibre/calibre/manual/template_lang.rst:115
314 msgid "Composite columns can use any template option, including formatting."
315 msgstr ""
316
317 #: ../../__w/calibre/calibre/manual/template_lang.rst:117
318 msgid ""
319 "Note: You cannot edit the data displayed in a composite column. Instead you "
320 "edit the source columns. If you edit a composite column, for example by "
321 "double-clicking it, calibre will open the template for editing, not the "
322 "underlying data."
323 msgstr ""
324
325 #: ../../__w/calibre/calibre/manual/template_lang.rst:121
326 msgid "Templates and plugboards"
327 msgstr ""
328
329 #: ../../__w/calibre/calibre/manual/template_lang.rst:123
330 msgid ""
331 "Plugboards are used for changing the metadata written into books during "
332 "send-to-device and save-to-disk operations. A plugboard permits you to "
333 "specify a template to provide the data to write into the book's metadata. "
334 "You can use plugboards to modify the following fields: authors, author_sort,"
335 " language, publisher, tags, title, title_sort. This feature helps people who"
336 " want to use different metadata in books on devices to solve sorting or "
337 "display issues."
338 msgstr ""
339
340 #: ../../__w/calibre/calibre/manual/template_lang.rst:125
341 msgid ""
342 "When you create a plugboard, you specify the format and device for which the"
343 " plugboard is to be used. A special device is provided, ``save_to_disk``, "
344 "that is used when saving formats (as opposed to sending them to a device). "
345 "Once you have chosen the format and device, you choose the metadata fields "
346 "to change, providing templates to supply the new values. These templates are"
347 " `connected` to their destination fields, hence the name `plugboards`. You "
348 "can of course use composite columns in these templates."
349 msgstr ""
350
351 #: ../../__w/calibre/calibre/manual/template_lang.rst:127
352 msgid ""
353 "Plugboards are quite flexible and can be written in Single Function Mode, "
354 "Template Program Mode, General Program Mode, or Python Template mode."
355 msgstr ""
356
357 #: ../../__w/calibre/calibre/manual/template_lang.rst:129
358 msgid ""
359 "When a plugboard might apply (Content server, save to disk, or send to "
360 "device), calibre searches the defined plugboards to choose the correct one "
361 "for the given format and device. For example, to find the appropriate "
362 "plugboard for an EPUB book being sent to an ANDROID device, calibre searches"
363 " the plugboards using the following search order:"
364 msgstr ""
365
366 #: ../../__w/calibre/calibre/manual/template_lang.rst:133
367 msgid ""
368 "a plugboard with an exact match on format and device, e.g., ``EPUB`` and "
369 "``ANDROID``"
370 msgstr ""
371
372 #: ../../__w/calibre/calibre/manual/template_lang.rst:134
373 msgid ""
374 "a plugboard with an exact match on format and the special ``any device`` "
375 "choice, e.g., ``EPUB`` and ``any device``"
376 msgstr ""
377
378 #: ../../__w/calibre/calibre/manual/template_lang.rst:135
379 msgid ""
380 "a plugboard with the special ``any format`` choice and an exact match on "
381 "device, e.g., ``any format`` and ``ANDROID``"
382 msgstr ""
383
384 #: ../../__w/calibre/calibre/manual/template_lang.rst:136
385 msgid "a plugboard with ``any format`` and ``any device``"
386 msgstr ""
387
388 #: ../../__w/calibre/calibre/manual/template_lang.rst:138
389 msgid ""
390 "The tags and authors fields have special treatment, because both of these "
391 "fields can hold more than one item. A book can have many tags and many "
392 "authors. When you specify that one of these two fields is to be changed, the"
393 " template's result is examined to see if more than one item is there. For "
394 "tags, the result is cut apart wherever calibre finds a comma. For example, "
395 "if the template produces the value ``Thriller, Horror``, then the result "
396 "will be two tags, ``Thriller`` and ``Horror``. There is no way to put a "
397 "comma in the middle of a tag."
398 msgstr ""
399
400 #: ../../__w/calibre/calibre/manual/template_lang.rst:141
401 msgid ""
402 "The same thing happens for authors, but using a different character for the "
403 "cut, a `&` (ampersand) instead of a comma. For example, if the template "
404 "produces the value ``Blogs, Joe&Posts, Susan``, then the book will end up "
405 "with two authors, ``Blogs, Joe`` and ``Posts, Susan``. If the template "
406 "produces the value ``Blogs, Joe;Posts, Susan``, then the book will have one "
407 "author with a rather strange name."
408 msgstr ""
409
410 #: ../../__w/calibre/calibre/manual/template_lang.rst:143
411 msgid ""
412 "Plugboards affect the metadata written into the book when it is saved to "
413 "disk or written to the device. Plugboards do not affect the metadata used by"
414 " ``save to disk`` and ``send to device`` to create the file names. Instead, "
415 "file names are constructed using the templates entered on the appropriate "
416 "preferences window."
417 msgstr ""
418
419 #: ../../__w/calibre/calibre/manual/template_lang.rst:148
420 msgid "Using functions in templates - Single Function Mode"
421 msgstr ""
422
423 #: ../../__w/calibre/calibre/manual/template_lang.rst:150
424 msgid ""
425 "Suppose you want to display the value of a field in upper case when that "
426 "field is normally in title case. You can do this using `template functions`."
427 " For example, to display the title in upper case use the ``uppercase`` "
428 "function, as in ``{title:uppercase()}``. To display it in title case, use "
429 "``{title:titlecase()}``."
430 msgstr ""
431
432 #: ../../__w/calibre/calibre/manual/template_lang.rst:152
433 msgid ""
434 "Functions go into the format part of the template, after the ``:`` and "
435 "before the first ``|`` or the closing ``}`` if no prefix/suffix is used. If "
436 "you have both a format and a function reference, the function comes after a "
437 "second ``:``. Functions return the value of the column specified in the "
438 "template, suitably modified."
439 msgstr ""
440
441 #: ../../__w/calibre/calibre/manual/template_lang.rst:154
442 msgid "The syntax for using functions is one of::"
443 msgstr ""
444
445 #: ../../__w/calibre/calibre/manual/template_lang.rst:161
446 msgid ""
447 "Function names must always be followed by opening and closing parentheses. "
448 "Some functions require extra values (arguments), and these go inside the "
449 "parentheses. Arguments are separated by commas. Literal commas (commas as "
450 "text, not argument separators) must be preceded by a backslash (``\\``) . "
451 "The last (or only) argument cannot contain a textual closing parenthesis."
452 msgstr ""
453
454 #: ../../__w/calibre/calibre/manual/template_lang.rst:163
455 msgid ""
456 "Functions are evaluated before format specifications and the prefix/suffix. "
457 "See further down for an example of using both a format and a function."
458 msgstr ""
459
460 #: ../../__w/calibre/calibre/manual/template_lang.rst:165
461 msgid ""
462 "**Important**: If you have programming experience, please note that the "
463 "syntax in `Single Function Mode` is not what you expect. Strings are not "
464 "quoted and spaces are significant. All arguments are considered to be "
465 "constants; there are no expressions."
466 msgstr ""
467
468 #: ../../__w/calibre/calibre/manual/template_lang.rst:167
469 msgid ""
470 "**Do not use subtemplates (`{ ... }`) as function arguments.** Instead, use "
471 ":ref:`Template Program Mode <template_mode>` and :ref:`General Program Mode "
472 "<general_mode>`."
473 msgstr ""
474
475 #: ../../__w/calibre/calibre/manual/template_lang.rst:169
476 msgid "Notes on calling functions in Single Function Mode:"
477 msgstr ""
478
479 #: ../../__w/calibre/calibre/manual/template_lang.rst:171
480 msgid ""
481 "When functions are used in Single Function Mode, the first parameter, "
482 "``value``, is automatically replaced by the content of the field specified "
483 "in the template. For example, when the template ``{title:capitalize()}`` is "
484 "processed, the content of the ``title`` field is passed as the parameter "
485 "``value`` to the capitalize function."
486 msgstr ""
487
488 #: ../../__w/calibre/calibre/manual/template_lang.rst:172
489 msgid ""
490 "In the function documentation, the notation ``[something]*`` means that "
491 "``something`` can be repeated zero or more times. The notation "
492 "``[something]+`` means that the ``something`` is repeated one or more times "
493 "(must exist at least one time)."
494 msgstr ""
495
496 #: ../../__w/calibre/calibre/manual/template_lang.rst:173
497 msgid ""
498 "Some functions use regular expressions. In the template language regular "
499 "expression matching is case-insensitive."
500 msgstr ""
501
502 #: ../../__w/calibre/calibre/manual/template_lang.rst:175
503 msgid ""
504 "Functions are documented in :ref:`template_functions_reference`. The "
505 "documentation tells you what arguments the functions require and what the "
506 "functions do. For example, here is the documentation of the "
507 ":ref:`ff_ifempty` function."
508 msgstr ""
509
510 #: ../../__w/calibre/calibre/manual/template_lang.rst:179
511 msgid ""
512 "You see that the function requires two arguments, ``value`` and "
513 "``text_if_empty``. However, because we are using Single Function Mode, we "
514 "omit the ``value`` argument, passing only ``text_if_empty``. For example, "
515 "this template::"
516 msgstr ""
517
518 #: ../../__w/calibre/calibre/manual/template_lang.rst:183
519 msgid ""
520 "shows the tags for a book, if any. If it has no tags then it show `No tags "
521 "on this book`."
522 msgstr ""
523
524 #: ../../__w/calibre/calibre/manual/template_lang.rst:185
525 msgid ""
526 "The following functions are usable in Single Function Mode because their "
527 "first parameter is ``value``."
528 msgstr ""
529
530 #: ../../__w/calibre/calibre/manual/template_lang.rst:225
531 msgid "**Using functions and formatting in the same template**"
532 msgstr ""
533
534 #: ../../__w/calibre/calibre/manual/template_lang.rst:227
535 msgid ""
536 "Suppose you have an integer custom column ``#myint`` that you want displayed"
537 " with leading zeros, as in ``003``. One way to do this is to use a format of"
538 " ``0>3s``. However, by default if a number (integer or float) equals zero "
539 "then the value is displayed as the empty string so zero values will produce "
540 "the empty string, not ``000``. If you want to see ``000`` values then you "
541 "use both the format string and the ``ifempty`` function to change the empty "
542 "value back to a zero. The template would be::"
543 msgstr ""
544
545 #: ../../__w/calibre/calibre/manual/template_lang.rst:231
546 msgid ""
547 "Note that you can use the prefix and suffix as well. If you want the number "
548 "to appear as ``[003]`` or ``[000]``, then use the template::"
549 msgstr ""
550
551 #: ../../__w/calibre/calibre/manual/template_lang.rst:238
552 msgid "General Program Mode"
553 msgstr ""
554
555 #: ../../__w/calibre/calibre/manual/template_lang.rst:240
556 msgid ""
557 "`General Program Mode` (`GPM`) replaces `template expressions` with a "
558 "program written in the `template language`. The syntax of the language is "
559 "defined by the following grammar::"
560 msgstr ""
561
562 #: ../../__w/calibre/calibre/manual/template_lang.rst:291
563 msgid ""
564 "a ``top_expression`` always has a value. The value of an ``expression_list``"
565 " is the value of the last ``top_expression`` in the list. For example, the "
566 "value of the expression list ``1;2;'foobar';3`` is ``3``."
567 msgstr ""
568
569 #: ../../__w/calibre/calibre/manual/template_lang.rst:292
570 msgid "In a logical context, any non-empty value is ``True``"
571 msgstr ""
572
573 #: ../../__w/calibre/calibre/manual/template_lang.rst:293
574 msgid "In a logical context, the empty value is ``False``"
575 msgstr ""
576
577 #: ../../__w/calibre/calibre/manual/template_lang.rst:294
578 msgid ""
579 "Strings and numbers can be used interchangeably. For example, ``10`` and "
580 "``'10'`` are the same thing."
581 msgstr ""
582
583 #: ../../__w/calibre/calibre/manual/template_lang.rst:295
584 msgid ""
585 "Comments are lines starting with a '#' character. Comments beginning later "
586 "in a line are not supported."
587 msgstr ""
588
589 #: ../../__w/calibre/calibre/manual/template_lang.rst:297
590 msgid "**Operator precedence**"
591 msgstr ""
592
593 #: ../../__w/calibre/calibre/manual/template_lang.rst:299
594 msgid ""
595 "The operator precedence (order of evaluation) from highest (evaluated first)"
596 " to lowest (evaluated last) is:"
597 msgstr ""
598
599 #: ../../__w/calibre/calibre/manual/template_lang.rst:301
600 msgid ""
601 "Function calls, constants, parenthesized expressions, statement expressions,"
602 " assignment expressions, field references."
603 msgstr ""
604
605 #: ../../__w/calibre/calibre/manual/template_lang.rst:302
606 msgid ""
607 "Unary plus (``+``) and minus (``-``). These operators evaluate right to "
608 "left."
609 msgstr ""
610
611 #: ../../__w/calibre/calibre/manual/template_lang.rst:304
612 msgid ""
613 "These and all the other arithmetic operators return integers if the "
614 "expression results in a fractional part equal to zero. For example, if an "
615 "expression returns ``3.0`` it is changed to ``3``."
616 msgstr ""
617
618 #: ../../__w/calibre/calibre/manual/template_lang.rst:305
619 msgid ""
620 "Multiply (``*``) and divide (``/``). These operators are associative and "
621 "evaluate left to right. Use parentheses if you want to change the order of "
622 "evaluation."
623 msgstr ""
624
625 #: ../../__w/calibre/calibre/manual/template_lang.rst:306
626 msgid ""
627 "Add (``+``) and subtract (``-``). These operators are associative and "
628 "evaluate left to right."
629 msgstr ""
630
631 #: ../../__w/calibre/calibre/manual/template_lang.rst:307
632 msgid ""
633 "Numeric and string comparisons. These operators return ``'1'`` if the "
634 "comparison succeeds, otherwise the empty string (``''``). Comparisons are "
635 "not associative: ``a < b < c`` is a syntax error."
636 msgstr ""
637
638 #: ../../__w/calibre/calibre/manual/template_lang.rst:308
639 msgid ""
640 "String concatenation (``&``). The ``&`` operator returns a string formed by "
641 "concatenating the left-hand and right-hand expressions. Example: ``'aaa' & "
642 "'bbb'`` returns ``'aaabbb'``. The operator is associative and evaluates left"
643 " to right."
644 msgstr ""
645
646 #: ../../__w/calibre/calibre/manual/template_lang.rst:309
647 msgid ""
648 "Unary logical not (``!``). This operator returns ``'1'`` if the expression "
649 "is False (evaluates to the empty string), otherwise ``''``."
650 msgstr ""
651
652 #: ../../__w/calibre/calibre/manual/template_lang.rst:310
653 msgid ""
654 "Logical and (``&&``). This operator returns '1' if both the left-hand and "
655 "right-hand expressions are True, or the empty string ``''`` if either is "
656 "False. It is associative, evaluates left to right, and does `short-"
657 "circuiting <https://chortle.ccsu.edu/java5/Notes/chap40/ch40_2.html>`_."
658 msgstr ""
659
660 #: ../../__w/calibre/calibre/manual/template_lang.rst:311
661 msgid ""
662 "Logical or (``||``). This operator returns ``'1'`` if either the left-hand "
663 "or right-hand expression is True, or ``''`` if both are False. It is "
664 "associative, evaluates left to right, and does `short-circuiting "
665 "<https://chortle.ccsu.edu/java5/Notes/chap40/ch40_2.html>`_. It is an "
666 "`inclusive or`, returning ``'1'`` if both the left- and right-hand "
667 "expressions are True."
668 msgstr ""
669
670 #: ../../__w/calibre/calibre/manual/template_lang.rst:313
671 msgid "**Field references**"
672 msgstr ""
673
674 #: ../../__w/calibre/calibre/manual/template_lang.rst:315
675 msgid ""
676 "A ``field_reference`` evaluates to the value of the metadata field named by "
677 "lookup name that follows the ``$`` or ``$$``. Using ``$`` is equivalent to "
678 "using the :ref:`ff_field` function. Using ``$$`` is equivalent to using the "
679 ":ref:`ff_raw_field` function. Examples::"
680 msgstr ""
681
682 #: ../../__w/calibre/calibre/manual/template_lang.rst:322
683 msgid "**If expressions**"
684 msgstr ""
685
686 #: ../../__w/calibre/calibre/manual/template_lang.rst:324
687 msgid ""
688 "``If`` expressions first evaluate the ``condition``. If the ``condition`` is"
689 " True (a non-empty value) then the ``expression_list`` in the ``then`` "
690 "clause is evaluated. If it is False then if present the ``expression_list`` "
691 "in the ``elif`` or ``else`` clause is evaluated. The ``elif`` and ``else`` "
692 "parts are optional. The words ``if``, ``then``, ``elif``, ``else``, and "
693 "``fi`` are reserved; you cannot use them as identifier names. You can put "
694 "newlines and white space wherever they make sense. The ``condition`` is a "
695 "``top_expression`` not an ``expression_list``; semicolons are not allowed. "
696 "The ``expression_lists`` are semicolon-separated sequences of "
697 "``top_expressions``. An ``if`` expression returns the result of the last "
698 "``top_expression`` in the evaluated ``expression_list``, or the empty string"
699 " if no expression list was evaluated."
700 msgstr ""
701
702 #: ../../__w/calibre/calibre/manual/template_lang.rst:326
703 msgid "Examples::"
704 msgstr ""
705
706 #: ../../__w/calibre/calibre/manual/template_lang.rst:339
707 msgid "Nested ``if`` example::"
708 msgstr ""
709
710 #: ../../__w/calibre/calibre/manual/template_lang.rst:352
711 msgid ""
712 "As said above, an ``if`` produces a value. This means that all the following"
713 " are equivalent::"
714 msgstr ""
715
716 #: ../../__w/calibre/calibre/manual/template_lang.rst:358
717 msgid ""
718 "For example, this program returns the value of the ``series`` column if the "
719 "book has a series, otherwise the value of the ``title`` column::"
720 msgstr ""
721
722 #: ../../__w/calibre/calibre/manual/template_lang.rst:362
723 msgid "**For expressions**"
724 msgstr ""
725
726 #: ../../__w/calibre/calibre/manual/template_lang.rst:364
727 msgid ""
728 "The ``for`` expression iterates over a list of values, processing them one "
729 "at a time. The ``list_expression`` must evaluate either to a metadata field "
730 "``lookup name`` e.g., ``tags`` or ``#genre``, or to a list of values. The "
731 ":ref:`ff_range` generates a list of numbers. If the result is a valid "
732 "``lookup name`` then the field's value is fetched and the separator "
733 "specified for that field type is used. If the result isn't a valid lookup "
734 "name then it is assumed to be a list of values. The list is assumed to be "
735 "separated by commas unless the optional keyword ``separator`` is supplied, "
736 "in which case the list values must be separated by the result of evaluating "
737 "the ``separator_expr``. A separator cannot be used if the list is generated "
738 "by ``range()``. Each value in the list is assigned to the specified variable"
739 " then the ``expression_list`` is evaluated. You can use ``break`` to jump "
740 "out of the loop, and ``continue`` to jump to the beginning of the loop for "
741 "the next iteration."
742 msgstr ""
743
744 #: ../../__w/calibre/calibre/manual/template_lang.rst:366
745 msgid ""
746 "Example: This template removes the first hierarchical name for each value in"
747 " Genre (``#genre``), constructing a list with the new names::"
748 msgstr ""
749
750 #: ../../__w/calibre/calibre/manual/template_lang.rst:376
751 msgid ""
752 "If the original Genre is `History.Military, Science Fiction.Alternate "
753 "History, ReadMe` then the template returns `Military, Alternate History, "
754 "ReadMe`. You could use this template in calibre's :guilabel:`Edit metadata "
755 "in bulk -> Search & replace` with :guilabel:`Search for` set to ``template``"
756 " to strip off the first level of the hierarchy and assign the resulting "
757 "value to Genre."
758 msgstr ""
759
760 #: ../../__w/calibre/calibre/manual/template_lang.rst:379
761 msgid ""
762 "Note: the last line in the template, ``new_tags``, isn't strictly necessary "
763 "in this case because ``for`` returns the value of the last top_expression in"
764 " the expression list. The value of an assignment is the value of its "
765 "expression, so the value of the ``for`` statement is what was assigned to "
766 "``new_tags``."
767 msgstr ""
768
769 #: ../../__w/calibre/calibre/manual/template_lang.rst:381
770 msgid "**Function definition**"
771 msgstr ""
772
773 #: ../../__w/calibre/calibre/manual/template_lang.rst:383
774 msgid ""
775 "If you have repeated code in a template then you can put that code into a "
776 "local function. The ``def`` keyword starts the definition. It is followed by"
777 " the function name, the argument list, then the code in the function. The "
778 "function definition ends with the ``fed`` keyword."
779 msgstr ""
780
781 #: ../../__w/calibre/calibre/manual/template_lang.rst:385
782 msgid ""
783 "Arguments are positional. When a function is called the supplied arguments "
784 "are matched left to right against the defined parameters, with the value of "
785 "the argument assigned to the parameter. It is an error to provide more "
786 "arguments than defined parameters. Parameters can have default values, such "
787 "as ``a = 25``. If an argument is not supplied for that parameter then the "
788 "default value is used, otherwise the parameter is set to the empty string."
789 msgstr ""
790
791 #: ../../__w/calibre/calibre/manual/template_lang.rst:387
792 msgid "The ``return`` statement can be used in a local function."
793 msgstr ""
794
795 #: ../../__w/calibre/calibre/manual/template_lang.rst:389
796 msgid "A function must be defined before it can be used."
797 msgstr ""
798
799 #: ../../__w/calibre/calibre/manual/template_lang.rst:391
800 msgid ""
801 "Example: This template computes an approximate duration in years, months, "
802 "and days from a number of days. The function ``to_plural()`` formats the "
803 "computed values. Note that the example also uses the ``&`` operator::"
804 msgstr ""
805
806 #: ../../__w/calibre/calibre/manual/template_lang.rst:406
807 msgid "**Relational operators**"
808 msgstr ""
809
810 #: ../../__w/calibre/calibre/manual/template_lang.rst:408
811 msgid ""
812 "Relational operators return ``'1'`` if the comparison is true, otherwise the"
813 " empty string (``''``)."
814 msgstr ""
815
816 #: ../../__w/calibre/calibre/manual/template_lang.rst:410
817 msgid ""
818 "There are two forms of relational operators: string comparisons and numeric "
819 "comparisons."
820 msgstr ""
821
822 #: ../../__w/calibre/calibre/manual/template_lang.rst:412
823 msgid ""
824 "String comparisons do case-insensitive string comparison using lexical "
825 "order. The supported string comparison operators are ``==``, ``!=``, ``<``, "
826 "``<=``, ``>``, ``>=``, ``in``, ``inlist``, and ``inlist_field``. For the "
827 "``in`` operator, the result of the left hand expression is interpreted as a "
828 "regular expression pattern. The ``in`` operator is True if the value of "
829 "left-hand regular expression matches the value of the right hand expression."
830 msgstr ""
831
832 #: ../../__w/calibre/calibre/manual/template_lang.rst:415
833 msgid ""
834 "The ``inlist`` operator is true if the left hand regular expression matches "
835 "any one of the items in the right hand list where the items in the list are "
836 "separated by commas. The ``inlist_field`` operator is true if the left hand "
837 "regular expression matches any of the items in the field (column) named by "
838 "the right hand expression, using the separator defined for the field. NB: "
839 "the ``inlist_field`` operator requires the right hand expression to evaluate"
840 " to a field name, while the ``inlist`` operator requires the right hand "
841 "expression to evaluate to a string containing a comma-separated list. "
842 "Because of this difference, ``inlist_field`` is substantially faster than "
843 "``inlist`` because no string conversions or list constructions are done. The"
844 " regular expressions are case-insensitive."
845 msgstr ""
846
847 #: ../../__w/calibre/calibre/manual/template_lang.rst:417
848 msgid ""
849 "The numeric comparison operators are ``==#``, ``!=#``, ``<#``, ``<=#``, "
850 "``>#``, ``>=#``. The left and right expressions must evaluate to numeric "
851 "values with two exceptions: both the string value \"None\" (undefined field)"
852 " and the empty string evaluate to the value zero."
853 msgstr ""
854
855 #: ../../__w/calibre/calibre/manual/template_lang.rst:419
856 msgid "Examples:"
857 msgstr "Beispiele"
858
859 #: ../../__w/calibre/calibre/manual/template_lang.rst:421
860 msgid ""
861 "``program: field('series') == 'foo'`` returns ``'1'`` if the book's series "
862 "is `foo`, otherwise ``''``."
863 msgstr ""
864
865 #: ../../__w/calibre/calibre/manual/template_lang.rst:422
866 msgid ""
867 "``program: 'f.o' in field('series')`` returns ``'1'`` if the book's series "
868 "matches the regular expression ``f.o`` (e.g., `foo`, `Off Onyx`, etc.), "
869 "otherwise ``''``."
870 msgstr ""
871
872 #: ../../__w/calibre/calibre/manual/template_lang.rst:423
873 msgid ""
874 "``program: 'science' inlist $#genre`` returns ``'1'`` if any of the values "
875 "retrieved from the book's genres match the regular expression ``science``, "
876 "e.g., `Science`, `History of Science`, `Science Fiction` etc., otherwise "
877 "``''``."
878 msgstr ""
879
880 #: ../../__w/calibre/calibre/manual/template_lang.rst:424
881 msgid ""
882 "``program: '^science$' inlist $#genre`` returns ``'1'`` if any of the book's"
883 " genres exactly match the regular expression ``^science$``, e.g., `Science`,"
884 " otherwise ``''``. The genres `History of Science` and `Science Fiction` "
885 "don't match."
886 msgstr ""
887
888 #: ../../__w/calibre/calibre/manual/template_lang.rst:425
889 msgid ""
890 "``program: 'asimov' inlist $authors`` returns ``'1'`` if any author matches "
891 "the regular expression ``asimov``, e.g., `Asimov, Isaac` or `Isaac Asimov`, "
892 "otherwise ``''``."
893 msgstr ""
894
895 #: ../../__w/calibre/calibre/manual/template_lang.rst:426
896 msgid ""
897 "``program: 'asimov' inlist_field 'authors'`` returns ``'1'`` if any author "
898 "matches the regular expression ``asimov``, e.g., `Asimov, Isaac` or `Isaac "
899 "Asimov`, otherwise ``''``."
900 msgstr ""
901
902 #: ../../__w/calibre/calibre/manual/template_lang.rst:427
903 msgid ""
904 "``program: 'asimov$' inlist_field 'authors'`` returns ``'1'`` if any author "
905 "matches the regular expression ``asimov$``, e.g., `Isaac Asimov`, otherwise "
906 "``''``. It doesn't match `Asimov, Isaac` because of the ``$`` anchor in the "
907 "regular expression."
908 msgstr ""
909
910 #: ../../__w/calibre/calibre/manual/template_lang.rst:428
911 msgid ""
912 "``program: if field('series') != 'foo' then 'bar' else 'mumble' fi`` returns"
913 " ``'bar'`` if the book's series is not `foo`. Otherwise it returns "
914 "``'mumble'``."
915 msgstr ""
916
917 #: ../../__w/calibre/calibre/manual/template_lang.rst:429
918 msgid ""
919 "``program: if field('series') == 'foo' || field('series') == '1632' then "
920 "'yes' else 'no' fi`` returns ``'yes'`` if series is either `foo` or `1632`, "
921 "otherwise ``'no'``."
922 msgstr ""
923
924 #: ../../__w/calibre/calibre/manual/template_lang.rst:430
925 msgid ""
926 "``program: if '^(foo|1632)$' in field('series') then 'yes' else 'no' fi`` "
927 "returns ``'yes'`` if series is either `foo` or `1632`, otherwise ``'no'``."
928 msgstr ""
929
930 #: ../../__w/calibre/calibre/manual/template_lang.rst:431
931 msgid ""
932 "``program: if 11 > 2 then 'yes' else 'no' fi`` returns ``'no'`` because the "
933 "``>`` operator does a lexical comparison."
934 msgstr ""
935
936 #: ../../__w/calibre/calibre/manual/template_lang.rst:432
937 msgid ""
938 "``program: if 11 ># 2 then 'yes' else 'no' fi`` returns ``'yes'`` because "
939 "the ``>#`` operator does a numeric comparison."
940 msgstr ""
941
942 #: ../../__w/calibre/calibre/manual/template_lang.rst:434
943 msgid "**Functions in General Program Mode**"
944 msgstr ""
945
946 #: ../../__w/calibre/calibre/manual/template_lang.rst:436
947 msgid ""
948 "See :ref:`template_functions_reference` for the list of functions built into"
949 " the template language."
950 msgstr ""
951
952 #: ../../__w/calibre/calibre/manual/template_lang.rst:440
953 msgid ""
954 "As opposed to :ref:`Single Function Mode <single_mode>`, in General Program "
955 "Mode you must specify the first parameter ``value``."
956 msgstr ""
957
958 #: ../../__w/calibre/calibre/manual/template_lang.rst:441
959 msgid "All parameters are expression_lists (see the grammar above)."
960 msgstr ""
961
962 #: ../../__w/calibre/calibre/manual/template_lang.rst:446
963 msgid "More complex programs in template expressions - Template Program Mode"
964 msgstr ""
965
966 #: ../../__w/calibre/calibre/manual/template_lang.rst:448
967 msgid ""
968 "`Template Program Mode` (`TPM`) is a blend of :ref:`General Program Mode "
969 "<general_mode>` and :ref:`Single Function Mode <single_mode>`. `TPM` differs"
970 " from Single Function Mode in that it permits writing template expressions "
971 "that refer to other metadata fields, use nested functions, modify variables,"
972 " and do arithmetic. It differs from `General Program Mode` in that the "
973 "template is contained between ``{`` and ``}`` characters and doesn't begin "
974 "with the word ``program:``. The program portion of the template is a General"
975 " Program Mode expression list."
976 msgstr ""
977
978 #: ../../__w/calibre/calibre/manual/template_lang.rst:451
979 msgid ""
980 "Example: assume you want a template to show the series for a book if it has "
981 "one, otherwise show the value of a custom field #genre. You cannot do this "
982 "in the :ref:`Single Function Mode <single_mode>` because you cannot make "
983 "reference to another metadata field within a template expression. In `TPM` "
984 "you can, as the following expression demonstrates::"
985 msgstr ""
986
987 #: ../../__w/calibre/calibre/manual/template_lang.rst:456
988 msgid "The example shows several things:"
989 msgstr "Das Beispiel zeigt mehrere Dinge:"
990
991 #: ../../__w/calibre/calibre/manual/template_lang.rst:458
992 msgid ""
993 "`TPM` is used if the expression begins with ``:'`` and ends with ``'}``. "
994 "Anything else is assumed to be in :ref:`Single Function Mode <single_mode>`."
995 msgstr ""
996
997 #: ../../__w/calibre/calibre/manual/template_lang.rst:460
998 msgid ""
999 "If the template contains a prefix and suffix, the expression ends with "
1000 "``'|`` where the ``|`` is the delimiter for the prefix. Example::"
1001 msgstr ""
1002
1003 #: ../../__w/calibre/calibre/manual/template_lang.rst:464
1004 msgid ""
1005 "Functions must be given all their arguments. For example, the standard "
1006 "built-in functions must be given the initial parameter ``value``."
1007 msgstr ""
1008
1009 #: ../../__w/calibre/calibre/manual/template_lang.rst:465
1010 msgid ""
1011 "The variable ``$`` is usable as the ``value`` argument and stands for the "
1012 "value of the field named in the template, ``series_index`` in this case."
1013 msgstr ""
1014
1015 #: ../../__w/calibre/calibre/manual/template_lang.rst:466
1016 msgid "white space is ignored and can be used anywhere within the expression."
1017 msgstr "Leerzeichen werden ignoriert und können überall innerhalb des Ausdrucks verwendet werden."
1018
1019 #: ../../__w/calibre/calibre/manual/template_lang.rst:467
1020 msgid ""
1021 "constant strings are enclosed in matching quotes, either ``'`` or ``\"``."
1022 msgstr "Zeichenkettenkonstanten werden in sich entsprechenden Anführungszeichen eingeschlossen, entweder ``'`` oder ``\"``."
1023
1024 #: ../../__w/calibre/calibre/manual/template_lang.rst:469
1025 msgid ""
1026 "In `TPM`, using ``{`` and ``}`` characters in string literals can lead to "
1027 "errors or unexpected results because they confuse the template processor. It"
1028 " tries to treat them as template expression boundaries, not characters. In "
1029 "some but not all cases you can replace a ``{`` with ``[[`` and a ``}`` with "
1030 "`]]`. Generally, if your program contains ``{`` and ``}`` characters then "
1031 "you should use `General Program Mode`."
1032 msgstr ""
1033
1034 #: ../../__w/calibre/calibre/manual/template_lang.rst:474
1035 msgid "Python Template Mode"
1036 msgstr ""
1037
1038 #: ../../__w/calibre/calibre/manual/template_lang.rst:476
1039 msgid ""
1040 "Python Template Mode (PTM) lets you write templates using native Python and "
1041 "the `calibre API <https://manual.calibre-ebook.com/develop.html#api-"
1042 "documentation-for-various-parts-of-calibre>`_. The database API will be of "
1043 "most use; further discussion is beyond the scope of this manual. PTM "
1044 "templates are faster and can do more complicated operations but you must "
1045 "know how to write code in Python using the calibre API."
1046 msgstr ""
1047
1048 #: ../../__w/calibre/calibre/manual/template_lang.rst:478
1049 msgid "A PTM template begins with:"
1050 msgstr ""
1051
1052 #: ../../__w/calibre/calibre/manual/template_lang.rst:496
1053 msgid ""
1054 "You can add the above text to your template using the context menu, usually "
1055 "accessed with a right click. The comments are not significant and can be "
1056 "removed. You must use python indenting."
1057 msgstr ""
1058
1059 #: ../../__w/calibre/calibre/manual/template_lang.rst:498
1060 msgid ""
1061 "The context object supports ``str(context)`` that returns a string of the "
1062 "context's contents, and ``context.attributes`` that returns a list of the "
1063 "attribute names in the context."
1064 msgstr ""
1065
1066 #: ../../__w/calibre/calibre/manual/template_lang.rst:500
1067 msgid ""
1068 "The ``context.funcs`` attribute allows calling Built-in and User template "
1069 "functions, and Stored GPM/Python templates, so that you can execute them "
1070 "directly in your code. The functions are retrieved using their names. If the"
1071 " name conflicts with a Python keyword, add an underscore to the end of the "
1072 "name. Examples:"
1073 msgstr ""
1074
1075 #: ../../__w/calibre/calibre/manual/template_lang.rst:507
1076 msgid ""
1077 "Here is an example of a PTM template that produces a list of all the authors"
1078 " for a series. The list is stored in a `Column built from other columns, "
1079 "behaves like tags`. It shows in :guilabel:`Book details` and has the "
1080 ":guilabel:`on separate lines` checked (in :guilabel:`Preferences->Look & "
1081 "feel->Book details`). That option requires the list to be comma-separated. "
1082 "To satisfy that requirement the template converts commas in author names to "
1083 "semicolons then builds a comma-separated list of authors. The authors are "
1084 "then sorted, which is why the template uses author_sort."
1085 msgstr ""
1086
1087 #: ../../__w/calibre/calibre/manual/template_lang.rst:528
1088 msgid "The output in :guilabel:`Book details` looks like this:"
1089 msgstr ""
1090
1091 #: ../../__w/calibre/calibre/manual/template_lang.rst:530
1092 msgid "E-book conversion dialog"
1093 msgstr ""
1094
1095 #: ../../__w/calibre/calibre/manual/template_lang.rst:536
1096 msgid "Stored templates"
1097 msgstr "Gespeicherte Vorlagen"
1098
1099 #: ../../__w/calibre/calibre/manual/template_lang.rst:538
1100 msgid ""
1101 "Both :ref:`General Program Mode <general_mode>` and :ref:`Python Template "
1102 "Mode <python_mode>` support saving templates and calling those templates "
1103 "from another template, much like calling stored functions. You save "
1104 "templates using :guilabel:`Preferences->Advanced->Template functions`. More "
1105 "information is provided in that dialog. You call a template the same way you"
1106 " call a function, passing positional arguments if desired. An argument can "
1107 "be any expression. Examples of calling a template, assuming the stored "
1108 "template is named ``foo``:"
1109 msgstr ""
1110
1111 #: ../../__w/calibre/calibre/manual/template_lang.rst:540
1112 msgid "``foo()`` -- call the template passing no arguments."
1113 msgstr ""
1114
1115 #: ../../__w/calibre/calibre/manual/template_lang.rst:541
1116 msgid ""
1117 "``foo(a, b)`` call the template passing the values of the two variables "
1118 "``a`` and ``b``."
1119 msgstr ""
1120
1121 #: ../../__w/calibre/calibre/manual/template_lang.rst:542
1122 msgid ""
1123 "``foo(if field('series') then field('series_index') else 0 fi)`` -- if the "
1124 "book has a ``series`` then pass the ``series_index``, otherwise pass the "
1125 "value ``0``."
1126 msgstr ""
1127
1128 #: ../../__w/calibre/calibre/manual/template_lang.rst:544
1129 msgid ""
1130 "In GPM you retrieve the arguments passed in the call to the stored template "
1131 "using the ``arguments`` function. It both declares and initializes local "
1132 "variables, effectively parameters. The variables are positional; they get "
1133 "the value of the parameter given in the call in the same position. If the "
1134 "corresponding parameter is not provided in the call then ``arguments`` "
1135 "assigns that variable the provided default value. If there is no default "
1136 "value then the variable is set to the empty string. For example, the "
1137 "following ``arguments`` function declares 2 variables, ``key``, "
1138 "``alternate``::"
1139 msgstr ""
1140
1141 #: ../../__w/calibre/calibre/manual/template_lang.rst:548
1142 msgid "Examples, again assuming the stored template is named ``foo``:"
1143 msgstr ""
1144
1145 #: ../../__w/calibre/calibre/manual/template_lang.rst:550
1146 msgid ""
1147 "``foo('#myseries')`` -- argument ``key`` is assigned the value "
1148 "``'myseries'`` and the argument ``alternate`` is assigned the default value "
1149 "``'series'``."
1150 msgstr ""
1151
1152 #: ../../__w/calibre/calibre/manual/template_lang.rst:551
1153 msgid ""
1154 "``foo('series', '#genre')`` the variable ``key`` is assigned the value "
1155 "``'series'`` and the variable ``alternate`` is assigned the value "
1156 "``'#genre'``."
1157 msgstr ""
1158
1159 #: ../../__w/calibre/calibre/manual/template_lang.rst:552
1160 msgid ""
1161 "``foo()`` -- the variable ``key`` is assigned the empty string and the "
1162 "variable ``alternate`` is assigned the value ``'series'``."
1163 msgstr ""
1164
1165 #: ../../__w/calibre/calibre/manual/template_lang.rst:554
1166 msgid ""
1167 "In PTM the arguments are passed in the ``arguments`` parameter, which is a "
1168 "list of strings. There isn't any way to specify default values. You must "
1169 "check the length of the ``arguments`` list to be sure that the number of "
1170 "arguments is what you expect."
1171 msgstr ""
1172
1173 #: ../../__w/calibre/calibre/manual/template_lang.rst:556
1174 msgid ""
1175 "An easy way to test stored templates is using the ``Template tester`` "
1176 "dialog. For ease of access give it a keyboard shortcut in "
1177 ":guilabel:`Preferences->Advanced->Keyboard shortcuts->Template tester`. "
1178 "Giving the ``Stored templates`` dialog a shortcut will help switching more "
1179 "rapidly between the tester and editing the stored template's source code."
1180 msgstr ""
1181
1182 #: ../../__w/calibre/calibre/manual/template_lang.rst:559
1183 msgid "Providing additional information to templates"
1184 msgstr ""
1185
1186 #: ../../__w/calibre/calibre/manual/template_lang.rst:561
1187 msgid ""
1188 "A developer can choose to pass additional information to the template "
1189 "processor, such as application-specific book metadata or information about "
1190 "what the processor is being asked to do. A template can access this "
1191 "information and use it during the evaluation."
1192 msgstr ""
1193
1194 #: ../../__w/calibre/calibre/manual/template_lang.rst:563
1195 msgid "**Developer: how to pass additional information**"
1196 msgstr ""
1197
1198 #: ../../__w/calibre/calibre/manual/template_lang.rst:565
1199 msgid ""
1200 "The additional information is a Python dictionary containing pairs "
1201 "``variable_name: variable_value`` where the values must be strings. The "
1202 "template can access the dictionary, creating template local variables named "
1203 "``variable_name`` containing the value ``variable_value``. The user cannot "
1204 "change the name so it is best to use names that won't collide with other "
1205 "template local variables, for example by prefixing the name with an "
1206 "underscore."
1207 msgstr ""
1208
1209 #: ../../__w/calibre/calibre/manual/template_lang.rst:567
1210 msgid ""
1211 "This dictionary is passed to the template processor (the ``formatter``) "
1212 "using the named parameter ``global_vars=your_dict``. The full method "
1213 "signature is::"
1214 msgstr ""
1215
1216 #: ../../__w/calibre/calibre/manual/template_lang.rst:575
1217 msgid "**Template writer: how to access the additional information**"
1218 msgstr ""
1219
1220 #: ../../__w/calibre/calibre/manual/template_lang.rst:577
1221 msgid ""
1222 "You access the additional information (the ``globals`` dictionary) in a "
1223 "template using the template function::"
1224 msgstr ""
1225
1226 #: ../../__w/calibre/calibre/manual/template_lang.rst:581
1227 msgid ""
1228 "where ``id`` is any legal variable name. This function checks whether the "
1229 "additional information provided by the developer contains the name. If it "
1230 "does then the function assigns the provided value to a template local "
1231 "variable with that name. If the name is not in the additional information "
1232 "and if an ``expression`` is provided, the ``expression`` is evaluated and "
1233 "the result is assigned to the local variable. If neither a value nor an "
1234 "expression is provided, the function assigns the empty string (``''``) to "
1235 "the local variable."
1236 msgstr ""
1237
1238 #: ../../__w/calibre/calibre/manual/template_lang.rst:583
1239 msgid ""
1240 "A template can set a value in the ``globals`` dictionary using the template "
1241 "function::"
1242 msgstr ""
1243
1244 #: ../../__w/calibre/calibre/manual/template_lang.rst:587
1245 msgid ""
1246 "This function sets the ``globals`` dictionary key:value pair ``id:value`` "
1247 "where ``value`` is the value of the template local variable ``id``. If that "
1248 "local variable doesn't exist then ``value`` is set to the result of "
1249 "evaluating ``expression``."
1250 msgstr ""
1251
1252 #: ../../__w/calibre/calibre/manual/template_lang.rst:590
1253 msgid "Notes on the difference between modes"
1254 msgstr ""
1255
1256 #: ../../__w/calibre/calibre/manual/template_lang.rst:592
1257 msgid ""
1258 "The three program modes, :ref:`Single Function Mode <single_mode>` (SFM), "
1259 ":ref:`Template Program Mode <template_mode>` (`TPM`), and :ref:`General "
1260 "Program Mode <general_mode>` (`GPM`), work differently. SFM is intended to "
1261 "be 'simple' so it hides a lot of programming language bits."
1262 msgstr ""
1263
1264 #: ../../__w/calibre/calibre/manual/template_lang.rst:594
1265 msgid "Differences:"
1266 msgstr ""
1267
1268 #: ../../__w/calibre/calibre/manual/template_lang.rst:596
1269 msgid ""
1270 "In SFM the value of the column is always passed as an 'invisible' first "
1271 "argument to a function included in the template."
1272 msgstr ""
1273
1274 #: ../../__w/calibre/calibre/manual/template_lang.rst:597
1275 msgid ""
1276 "SFM doesn't support the difference between variables and strings; all values"
1277 " are strings."
1278 msgstr ""
1279
1280 #: ../../__w/calibre/calibre/manual/template_lang.rst:598
1281 msgid ""
1282 "The following SFM template returns either the series name or the string \"no"
1283 " series\"::"
1284 msgstr ""
1285
1286 #: ../../__w/calibre/calibre/manual/template_lang.rst:602
1287 msgid "The equivalent template in `TPM` is ::"
1288 msgstr ""
1289
1290 #: ../../__w/calibre/calibre/manual/template_lang.rst:606
1291 msgid "The equivalent template in `GPM` is::"
1292 msgstr ""
1293
1294 #: ../../__w/calibre/calibre/manual/template_lang.rst:610
1295 msgid ""
1296 "The first argument to ``ifempty`` is the value of the field ``series``. The "
1297 "second argument is the string ``no series``. In SFM the first argument, the "
1298 "value of the field, is automatically passed (the invisible argument)."
1299 msgstr ""
1300
1301 #: ../../__w/calibre/calibre/manual/template_lang.rst:611
1302 msgid ""
1303 "Several template functions, for example ``booksize()`` and "
1304 "``current_library_name()``, take no arguments. Because of the 'invisible "
1305 "argument' you cannot use these functions in SFM."
1306 msgstr ""
1307
1308 #: ../../__w/calibre/calibre/manual/template_lang.rst:612
1309 msgid ""
1310 "Nested functions, where a function calls another function to compute an "
1311 "argument, cannot be used in SFM. For example this template, intended to "
1312 "return the first 5 characters of the series value uppercased, won't work in "
1313 "SFM::"
1314 msgstr ""
1315
1316 #: ../../__w/calibre/calibre/manual/template_lang.rst:616
1317 msgid ""
1318 "`TPM` and `GPM` support nested functions. The above template in `TPM` would "
1319 "be::"
1320 msgstr ""
1321
1322 #: ../../__w/calibre/calibre/manual/template_lang.rst:620
1323 msgid "In `GPM` it would be::"
1324 msgstr ""
1325
1326 #: ../../__w/calibre/calibre/manual/template_lang.rst:624
1327 msgid ""
1328 "As noted in the above :ref:`Template Program Mode <template_mode>` section, "
1329 "using ``{`` and ``}`` characters in `TPM` string literals can lead to errors"
1330 " or unexpected results because they confuse the template processor. It tries"
1331 " to treat them as template boundaries, not characters. In some but not all "
1332 "cases you can replace a ``{`` with ``[[`` and a ``}`` with `]]`. Generally, "
1333 "if your program contains ``{`` and ``}`` characters then you should use "
1334 "`General Program Mode`."
1335 msgstr ""
1336
1337 #: ../../__w/calibre/calibre/manual/template_lang.rst:628
1338 msgid "User-defined Python template functions"
1339 msgstr ""
1340
1341 #: ../../__w/calibre/calibre/manual/template_lang.rst:630
1342 msgid ""
1343 "You can add your own Python functions to the template processor. Such "
1344 "functions can be used in any of the three template programming modes. The "
1345 "functions are added by going to :guilabel:`Preferences -> Advanced -> "
1346 "Template functions`. Instructions are shown in that dialog. Note that you "
1347 "can use `Python Templates` for a similar purpose. As calling user-defined "
1348 "functions is faster than calling a Python template, user-defined functions "
1349 "might be more efficient depending on the complexity of what the function or "
1350 "template does."
1351 msgstr ""
1352
1353 #: ../../__w/calibre/calibre/manual/template_lang.rst:633
1354 msgid "Special notes for save/send templates"
1355 msgstr "Besondere Hinweise für Speicher-/Sendevorlagen"
1356
1357 #: ../../__w/calibre/calibre/manual/template_lang.rst:635
1358 msgid ""
1359 "Special processing is applied when a template is used in a `save to disk` or"
1360 " `send to device` template. The values of the fields are cleaned, replacing "
1361 "characters that are special to file systems with underscores, including "
1362 "slashes. This means that field text cannot be used to create folders. "
1363 "However, slashes are not changed in prefix or suffix strings, so slashes in "
1364 "these strings will cause folders to be created. Because of this, you can "
1365 "create variable-depth folder structure."
1366 msgstr ""
1367
1368 #: ../../__w/calibre/calibre/manual/template_lang.rst:637
1369 msgid ""
1370 "For example, assume we want the folder structure `series/series_index - "
1371 "title`, with the caveat that if series does not exist, then the title should"
1372 " be in the top folder. The template to do this is::"
1373 msgstr ""
1374
1375 #: ../../__w/calibre/calibre/manual/template_lang.rst:641
1376 msgid "The slash and the hyphen appear only if series is not empty."
1377 msgstr ""
1378
1379 #: ../../__w/calibre/calibre/manual/template_lang.rst:643
1380 msgid ""
1381 "The lookup function lets us do even fancier processing. For example, assume "
1382 "that if a book has a series, then we want the folder structure "
1383 "`series/series index - title.fmt`. If the book does not have a series then "
1384 "we want the folder structure `genre/author_sort/title.fmt`. If the book has "
1385 "no genre then we want to use 'Unknown'. We want two completely different "
1386 "paths, depending on the value of series."
1387 msgstr ""
1388
1389 #: ../../__w/calibre/calibre/manual/template_lang.rst:645
1390 msgid "To accomplish this, we:"
1391 msgstr "Um das zu erreichen:"
1392
1393 #: ../../__w/calibre/calibre/manual/template_lang.rst:647
1394 msgid ""
1395 "Create a composite field (give it lookup name #aa) containing "
1396 "``{series}/{series_index} - {title}``. If the series is not empty, then this"
1397 " template will produce `series/series_index - title`."
1398 msgstr ""
1399
1400 #: ../../__w/calibre/calibre/manual/template_lang.rst:648
1401 msgid ""
1402 "Create a composite field (give it lookup name #bb) containing "
1403 "``{#genre:ifempty(Unknown)}/{author_sort}/{title}``. This template produces "
1404 "`genre/author_sort/title`, where an empty genre is replaced with `Unknown`."
1405 msgstr ""
1406
1407 #: ../../__w/calibre/calibre/manual/template_lang.rst:649
1408 msgid ""
1409 "Set the save template to ``{series:lookup(.,#aa,#bb)}``. This template "
1410 "chooses composite field ``#aa`` if series is not empty and composite field "
1411 "``#bb`` if series is empty. We therefore have two completely different save "
1412 "paths, depending on whether or not `series` is empty."
1413 msgstr ""
1414
1415 #: ../../__w/calibre/calibre/manual/template_lang.rst:652
1416 msgid "Tips"
1417 msgstr ""
1418
1419 #: ../../__w/calibre/calibre/manual/template_lang.rst:654
1420 msgid ""
1421 "Use the Template Tester to test templates. Add the tester to the context "
1422 "menu for books in the library and/or give it a keyboard shortcut."
1423 msgstr ""
1424
1425 #: ../../__w/calibre/calibre/manual/template_lang.rst:655
1426 msgid ""
1427 "Templates can use other templates by referencing composite columns built "
1428 "with the desired template. Alternatively, you can use Stored Templates."
1429 msgstr ""
1430
1431 #: ../../__w/calibre/calibre/manual/template_lang.rst:656
1432 msgid ""
1433 "In a plugboard, you can set a field to empty (or whatever is equivalent to "
1434 "empty) by using the special template ``{}``. This template will always "
1435 "evaluate to an empty string."
1436 msgstr ""
1437
1438 #: ../../__w/calibre/calibre/manual/template_lang.rst:657
1439 msgid ""
1440 "The technique described above to show numbers even if they have a zero value"
1441 " works with the standard field series_index."
1442 msgstr ""
1443
1444 #: ../../__w/calibre/calibre/manual/template_lang.rst:662
1445 msgid "Template function reference"
1446 msgstr "Referenz zur Vorlagefunktion"