Debian Codegraph @

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