Debian Codegraph @

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