Debian Codegraph @

translations/manual/kn/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 # R Murthy <[email protected]>, 2025
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: calibre\n"
10 "Report-Msgid-Bugs-To: \n"
11 "POT-Creation-Date: 2025-02-20 13:44+0000\n"
12 "PO-Revision-Date: 2014-06-17 08:34+0000\n"
13 "Last-Translator: R Murthy <[email protected]>, 2025\n"
14 "Language-Team: Kannada (http://app.transifex.com/calibre/calibre/language/kn/)\n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
18 "Language: kn\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 "ಕ್ಯಾಲಿಬರ್ ಸಿದ್ಧಮಾದರಿ ಭಾಷೆ"
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 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 in between in "
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 "``{identifiers:select(isbn)}`` - ಪುಸ್ತಕದ ISBN"
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 "``{series} - {series_index} - {title}``"
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 "``{field:|prefix_text|suffix_text}``"
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:290
215 #: ../../__w/calibre/calibre/manual/template_lang.rst:439
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 "``{author_sort:.2}`` - ಲೇಖಕರ ವರ್ಗೀಕರಣದ ಹೆಸರಿನ ಮೊದಲ ಎರಡು ಅಕ್ಷರಗಳು ಮಾತ್ರ"
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:226
526 msgid "**Using functions and formatting in the same template**"
527 msgstr ""
528
529 #: ../../__w/calibre/calibre/manual/template_lang.rst:228
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:232
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:239
547 msgid "General Program Mode"
548 msgstr ""
549
550 #: ../../__w/calibre/calibre/manual/template_lang.rst:241
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:292
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:293
565 msgid "In a logical context, any non-empty value is ``True``"
566 msgstr ""
567
568 #: ../../__w/calibre/calibre/manual/template_lang.rst:294
569 msgid "In a logical context, the empty value is ``False``"
570 msgstr ""
571
572 #: ../../__w/calibre/calibre/manual/template_lang.rst:295
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:296
579 msgid ""
580 "Comments are lines starting with a '#' character. Comments beginning later "
581 "in a line are not supported."
582 msgstr ""
583
584 #: ../../__w/calibre/calibre/manual/template_lang.rst:298
585 msgid "**Operator precedence**"
586 msgstr ""
587
588 #: ../../__w/calibre/calibre/manual/template_lang.rst:300
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:302
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:303
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:305
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:306
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:307
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:308
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:309
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:310
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:311
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:312
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:314
666 msgid "**Field references**"
667 msgstr ""
668
669 #: ../../__w/calibre/calibre/manual/template_lang.rst:316
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:323
678 msgid "**If expressions**"
679 msgstr ""
680
681 #: ../../__w/calibre/calibre/manual/template_lang.rst:325
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:327
698 msgid "Examples::"
699 msgstr "ಉದಾಹರಣೆಗಳು::"
700
701 #: ../../__w/calibre/calibre/manual/template_lang.rst:340
702 msgid "Nested ``if`` example::"
703 msgstr ""
704
705 #: ../../__w/calibre/calibre/manual/template_lang.rst:353
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:359
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:363
718 msgid "**For expressions**"
719 msgstr ""
720
721 #: ../../__w/calibre/calibre/manual/template_lang.rst:365
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:367
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:377
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:380
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:382
765 msgid "**Function definition**"
766 msgstr ""
767
768 #: ../../__w/calibre/calibre/manual/template_lang.rst:384
769 msgid ""
770 "If you have repeated code in a template then you can put that code into a "
771 "local function. The ``def`` keyword starts the definition. It is followed by"
772 " the function name, the argument list, then the code in the function. The "
773 "function definition ends with the ``fed`` keyword."
774 msgstr ""
775
776 #: ../../__w/calibre/calibre/manual/template_lang.rst:386
777 msgid ""
778 "Arguments are positional. When a function is called the supplied arguments "
779 "are matched left to right against the defined parameters, with the value of "
780 "the argument assigned to the parameter. It is an error to provide more "
781 "arguments than defined parameters. Parameters can have default values, such "
782 "as ``a = 25``. If an argument is not supplied for that parameter then the "
783 "default value is used, otherwise the parameter is set to the empty string."
784 msgstr ""
785
786 #: ../../__w/calibre/calibre/manual/template_lang.rst:388
787 msgid "The ``return`` statement can be used in a local function."
788 msgstr ""
789
790 #: ../../__w/calibre/calibre/manual/template_lang.rst:390
791 msgid "A function must be defined before it can be used."
792 msgstr ""
793
794 #: ../../__w/calibre/calibre/manual/template_lang.rst:392
795 msgid ""
796 "Example: This template computes an approximate duration in years, months, "
797 "and days from a number of days. The function ``to_plural()`` formats the "
798 "computed values. Note that the example also uses the ``&`` operator::"
799 msgstr ""
800
801 #: ../../__w/calibre/calibre/manual/template_lang.rst:407
802 msgid "**Relational operators**"
803 msgstr ""
804
805 #: ../../__w/calibre/calibre/manual/template_lang.rst:409
806 msgid ""
807 "Relational operators return ``'1'`` if the comparison is true, otherwise the"
808 " empty string (``''``)."
809 msgstr ""
810
811 #: ../../__w/calibre/calibre/manual/template_lang.rst:411
812 msgid ""
813 "There are two forms of relational operators: string comparisons and numeric "
814 "comparisons."
815 msgstr ""
816
817 #: ../../__w/calibre/calibre/manual/template_lang.rst:413
818 msgid ""
819 "String comparisons do case-insensitive string comparison using lexical "
820 "order. The supported string comparison operators are ``==``, ``!=``, ``<``, "
821 "``<=``, ``>``, ``>=``, ``in``, ``inlist``, and ``inlist_field``. For the "
822 "``in`` operator, the result of the left hand expression is interpreted as a "
823 "regular expression pattern. The ``in`` operator is True if the value of "
824 "left-hand regular expression matches the value of the right hand expression."
825 msgstr ""
826
827 #: ../../__w/calibre/calibre/manual/template_lang.rst:416
828 msgid ""
829 "The ``inlist`` operator is true if the left hand regular expression matches "
830 "any one of the items in the right hand list where the items in the list are "
831 "separated by commas. The ``inlist_field`` operator is true if the left hand "
832 "regular expression matches any of the items in the field (column) named by "
833 "the right hand expression, using the separator defined for the field. NB: "
834 "the ``inlist_field`` operator requires the right hand expression to evaluate"
835 " to a field name, while the ``inlist`` operator requires the right hand "
836 "expression to evaluate to a string containing a comma-separated list. "
837 "Because of this difference, ``inlist_field`` is substantially faster than "
838 "``inlist`` because no string conversions or list constructions are done. The"
839 " regular expressions are case-insensitive."
840 msgstr ""
841
842 #: ../../__w/calibre/calibre/manual/template_lang.rst:418
843 msgid ""
844 "The numeric comparison operators are ``==#``, ``!=#``, ``<#``, ``<=#``, "
845 "``>#``, ``>=#``. The left and right expressions must evaluate to numeric "
846 "values with two exceptions: both the string value \"None\" (undefined field)"
847 " and the empty string evaluate to the value zero."
848 msgstr ""
849
850 #: ../../__w/calibre/calibre/manual/template_lang.rst:420
851 msgid "Examples:"
852 msgstr "ಉದಾಹರಣೆಗಳು:"
853
854 #: ../../__w/calibre/calibre/manual/template_lang.rst:422
855 msgid ""
856 "``program: field('series') == 'foo'`` returns ``'1'`` if the book's series "
857 "is `foo`, otherwise ``''``."
858 msgstr ""
859
860 #: ../../__w/calibre/calibre/manual/template_lang.rst:423
861 msgid ""
862 "``program: 'f.o' in field('series')`` returns ``'1'`` if the book's series "
863 "matches the regular expression ``f.o`` (e.g., `foo`, `Off Onyx`, etc.), "
864 "otherwise ``''``."
865 msgstr ""
866
867 #: ../../__w/calibre/calibre/manual/template_lang.rst:424
868 msgid ""
869 "``program: 'science' inlist $#genre`` returns ``'1'`` if any of the values "
870 "retrieved from the book's genres match the regular expression ``science``, "
871 "e.g., `Science`, `History of Science`, `Science Fiction` etc., otherwise "
872 "``''``."
873 msgstr ""
874
875 #: ../../__w/calibre/calibre/manual/template_lang.rst:425
876 msgid ""
877 "``program: '^science$' inlist $#genre`` returns ``'1'`` if any of the book's"
878 " genres exactly match the regular expression ``^science$``, e.g., `Science`,"
879 " otherwise ``''``. The genres `History of Science` and `Science Fiction` "
880 "don't match."
881 msgstr ""
882
883 #: ../../__w/calibre/calibre/manual/template_lang.rst:426
884 msgid ""
885 "``program: 'asimov' inlist $authors`` returns ``'1'`` if any author matches "
886 "the regular expression ``asimov``, e.g., `Asimov, Isaac` or `Isaac Asimov`, "
887 "otherwise ``''``."
888 msgstr ""
889
890 #: ../../__w/calibre/calibre/manual/template_lang.rst:427
891 msgid ""
892 "``program: 'asimov' inlist_field 'authors'`` returns ``'1'`` if any author "
893 "matches the regular expression ``asimov``, e.g., `Asimov, Isaac` or `Isaac "
894 "Asimov`, otherwise ``''``."
895 msgstr ""
896
897 #: ../../__w/calibre/calibre/manual/template_lang.rst:428
898 msgid ""
899 "``program: 'asimov$' inlist_field 'authors'`` returns ``'1'`` if any author "
900 "matches the regular expression ``asimov$``, e.g., `Isaac Asimov`, otherwise "
901 "``''``. It doesn't match `Asimov, Isaac` because of the ``$`` anchor in the "
902 "regular expression."
903 msgstr ""
904
905 #: ../../__w/calibre/calibre/manual/template_lang.rst:429
906 msgid ""
907 "``program: if field('series') != 'foo' then 'bar' else 'mumble' fi`` returns"
908 " ``'bar'`` if the book's series is not `foo`. Otherwise it returns "
909 "``'mumble'``."
910 msgstr ""
911
912 #: ../../__w/calibre/calibre/manual/template_lang.rst:430
913 msgid ""
914 "``program: if field('series') == 'foo' || field('series') == '1632' then "
915 "'yes' else 'no' fi`` returns ``'yes'`` if series is either `foo` or `1632`, "
916 "otherwise ``'no'``."
917 msgstr ""
918
919 #: ../../__w/calibre/calibre/manual/template_lang.rst:431
920 msgid ""
921 "``program: if '^(foo|1632)$' in field('series') then 'yes' else 'no' fi`` "
922 "returns ``'yes'`` if series is either `foo` or `1632`, otherwise ``'no'``."
923 msgstr ""
924
925 #: ../../__w/calibre/calibre/manual/template_lang.rst:432
926 msgid ""
927 "``program: if 11 > 2 then 'yes' else 'no' fi`` returns ``'no'`` because the "
928 "``>`` operator does a lexical comparison."
929 msgstr ""
930
931 #: ../../__w/calibre/calibre/manual/template_lang.rst:433
932 msgid ""
933 "``program: if 11 ># 2 then 'yes' else 'no' fi`` returns ``'yes'`` because "
934 "the ``>#`` operator does a numeric comparison."
935 msgstr ""
936
937 #: ../../__w/calibre/calibre/manual/template_lang.rst:435
938 msgid "**Functions in General Program Mode**"
939 msgstr ""
940
941 #: ../../__w/calibre/calibre/manual/template_lang.rst:437
942 msgid ""
943 "See :ref:`template_functions_reference` for the list of functions built into"
944 " the template language."
945 msgstr ""
946
947 #: ../../__w/calibre/calibre/manual/template_lang.rst:441
948 msgid ""
949 "As opposed to :ref:`Single Function Mode <single_mode>`, in General Program "
950 "Mode you must specify the first parameter ``value``."
951 msgstr ""
952
953 #: ../../__w/calibre/calibre/manual/template_lang.rst:442
954 msgid "All parameters are expression_lists (see the grammar above)."
955 msgstr ""
956
957 #: ../../__w/calibre/calibre/manual/template_lang.rst:447
958 msgid "More complex programs in template expressions - Template Program Mode"
959 msgstr ""
960
961 #: ../../__w/calibre/calibre/manual/template_lang.rst:449
962 msgid ""
963 "`Template Program Mode` (`TPM`) is a blend of :ref:`General Program Mode "
964 "<general_mode>` and :ref:`Single Function Mode <single_mode>`. `TPM` differs"
965 " from Single Function Mode in that it permits writing template expressions "
966 "that refer to other metadata fields, use nested functions, modify variables,"
967 " and do arithmetic. It differs from `General Program Mode` in that the "
968 "template is contained between ``{`` and ``}`` characters and doesn't begin "
969 "with the word ``program:``. The program portion of the template is a General"
970 " Program Mode expression list."
971 msgstr ""
972
973 #: ../../__w/calibre/calibre/manual/template_lang.rst:452
974 msgid ""
975 "Example: assume you want a template to show the series for a book if it has "
976 "one, otherwise show the value of a custom field #genre. You cannot do this "
977 "in the :ref:`Single Function Mode <single_mode>` because you cannot make "
978 "reference to another metadata field within a template expression. In `TPM` "
979 "you can, as the following expression demonstrates::"
980 msgstr ""
981
982 #: ../../__w/calibre/calibre/manual/template_lang.rst:457
983 msgid "The example shows several things:"
984 msgstr "ಉದಾಹರಣೆಯು ಹಲವಾರು ಸಂಗತಿಗಳನ್ನು ಪ್ರದರ್ಶಿಸುತ್ತದೆ:"
985
986 #: ../../__w/calibre/calibre/manual/template_lang.rst:459
987 msgid ""
988 "`TPM` is used if the expression begins with ``:'`` and ends with ``'}``. "
989 "Anything else is assumed to be in :ref:`Single Function Mode <single_mode>`."
990 msgstr ""
991
992 #: ../../__w/calibre/calibre/manual/template_lang.rst:461
993 msgid ""
994 "If the template contains a prefix and suffix, the expression ends with "
995 "``'|`` where the ``|`` is the delimiter for the prefix. Example::"
996 msgstr ""
997
998 #: ../../__w/calibre/calibre/manual/template_lang.rst:465
999 msgid ""
1000 "Functions must be given all their arguments. For example, the standard "
1001 "built-in functions must be given the initial parameter ``value``."
1002 msgstr ""
1003
1004 #: ../../__w/calibre/calibre/manual/template_lang.rst:466
1005 msgid ""
1006 "The variable ``$`` is usable as the ``value`` argument and stands for the "
1007 "value of the field named in the template, ``series_index`` in this case."
1008 msgstr ""
1009
1010 #: ../../__w/calibre/calibre/manual/template_lang.rst:467
1011 msgid "white space is ignored and can be used anywhere within the expression."
1012 msgstr ""
1013
1014 #: ../../__w/calibre/calibre/manual/template_lang.rst:468
1015 msgid ""
1016 "constant strings are enclosed in matching quotes, either ``'`` or ``\"``."
1017 msgstr ""
1018
1019 #: ../../__w/calibre/calibre/manual/template_lang.rst:470
1020 msgid ""
1021 "In `TPM`, using ``{`` and ``}`` characters in string literals can lead to "
1022 "errors or unexpected results because they confuse the template processor. It"
1023 " tries to treat them as template expression boundaries, not characters. In "
1024 "some but not all cases you can replace a ``{`` with ``[[`` and a ``}`` with "
1025 "`]]`. Generally, if your program contains ``{`` and ``}`` characters then "
1026 "you should use `General Program Mode`."
1027 msgstr ""
1028
1029 #: ../../__w/calibre/calibre/manual/template_lang.rst:475
1030 msgid "Python Template Mode"
1031 msgstr ""
1032
1033 #: ../../__w/calibre/calibre/manual/template_lang.rst:477
1034 msgid ""
1035 "Python Template Mode (PTM) lets you write templates using native Python and "
1036 "the `calibre API <https://manual.calibre-ebook.com/develop.html#api-"
1037 "documentation-for-various-parts-of-calibre>`_. The database API will be of "
1038 "most use; further discussion is beyond the scope of this manual. PTM "
1039 "templates are faster and can do more complicated operations but you must "
1040 "know how to write code in Python using the calibre API."
1041 msgstr ""
1042
1043 #: ../../__w/calibre/calibre/manual/template_lang.rst:479
1044 msgid "A PTM template begins with:"
1045 msgstr ""
1046
1047 #: ../../__w/calibre/calibre/manual/template_lang.rst:497
1048 msgid ""
1049 "You can add the above text to your template using the context menu, usually "
1050 "accessed with a right click. The comments are not significant and can be "
1051 "removed. You must use python indenting."
1052 msgstr ""
1053
1054 #: ../../__w/calibre/calibre/manual/template_lang.rst:499
1055 msgid ""
1056 "The context object supports ``str(context)`` that returns a string of the "
1057 "context's contents, and ``context.attributes`` that returns a list of the "
1058 "attribute names in the context."
1059 msgstr ""
1060
1061 #: ../../__w/calibre/calibre/manual/template_lang.rst:501
1062 msgid ""
1063 "The ``context.funcs`` attribute allows calling Built-in and User template "
1064 "functions, and Stored GPM/Python templates, so that you can execute them "
1065 "directly in your code. The functions are retrieved using their names. If the"
1066 " name conflicts with a Python keyword, add an underscore to the end of the "
1067 "name. Examples:"
1068 msgstr ""
1069
1070 #: ../../__w/calibre/calibre/manual/template_lang.rst:508
1071 msgid ""
1072 "Here is an example of a PTM template that produces a list of all the authors"
1073 " for a series. The list is stored in a `Column built from other columns, "
1074 "behaves like tags`. It shows in :guilabel:`Book details` and has the "
1075 ":guilabel:`on separate lines` checked (in :guilabel:`Preferences->Look & "
1076 "feel->Book details`). That option requires the list to be comma-separated. "
1077 "To satisfy that requirement the template converts commas in author names to "
1078 "semicolons then builds a comma-separated list of authors. The authors are "
1079 "then sorted, which is why the template uses author_sort."
1080 msgstr ""
1081
1082 #: ../../__w/calibre/calibre/manual/template_lang.rst:529
1083 msgid "The output in :guilabel:`Book details` looks like this:"
1084 msgstr ""
1085
1086 #: ../../__w/calibre/calibre/manual/template_lang.rst:531
1087 msgid "E-book conversion dialog"
1088 msgstr ""
1089
1090 #: ../../__w/calibre/calibre/manual/template_lang.rst:539
1091 msgid "Templates and URLs"
1092 msgstr "ಸಿದ್ಧಮಾದರಿಗಳು ಮತ್ತು URLಗಳು"
1093
1094 #: ../../__w/calibre/calibre/manual/template_lang.rst:541
1095 msgid "You can use templates to construct URLs. Two cases are described here:"
1096 msgstr ""
1097
1098 #: ../../__w/calibre/calibre/manual/template_lang.rst:543
1099 msgid "Custom column :guilabel:`Book details` search URLs"
1100 msgstr ""
1101
1102 #: ../../__w/calibre/calibre/manual/template_lang.rst:544
1103 msgid "The calibre URL scheme"
1104 msgstr ""
1105
1106 #: ../../__w/calibre/calibre/manual/template_lang.rst:546
1107 msgid "**Custom column book details search URLs**"
1108 msgstr ""
1109
1110 #: ../../__w/calibre/calibre/manual/template_lang.rst:548
1111 msgid ""
1112 "When you create a custom column you can provide a URL to be used in "
1113 ":guilabel:`Book details` using a template. For example, if you have a custom"
1114 " column for `Translators` you can define a URL to take you to a site for "
1115 "translators. Book details search URLs can be provided for `Text`, "
1116 "`Enumerated`, `Series`, and `Column built from other column` column types."
1117 msgstr ""
1118
1119 #: ../../__w/calibre/calibre/manual/template_lang.rst:550
1120 msgid ""
1121 "When an item with a `search template` is clicked in :guilabel:`Book details`"
1122 " the template is evaluated. It is provided the normal book metadata. It is "
1123 "also provided three additional fields:"
1124 msgstr ""
1125
1126 #: ../../__w/calibre/calibre/manual/template_lang.rst:552
1127 msgid "``item_value``: the value of the clicked item."
1128 msgstr ""
1129
1130 #: ../../__w/calibre/calibre/manual/template_lang.rst:553
1131 msgid ""
1132 "``item_value_quoted``: the value of clicked item, URL-encoded. Special "
1133 "characters are escaped to make them valid in URLs and spaces are replaced by"
1134 " ``'+'`` (plus) signs."
1135 msgstr ""
1136
1137 #: ../../__w/calibre/calibre/manual/template_lang.rst:554
1138 msgid ""
1139 "``item_value_no_plus``: the value of clicked item, URL-encoded. Special "
1140 "characters are escaped to make them valid in URLs and spaces are replaced by"
1141 " the ``%20``, not plus."
1142 msgstr ""
1143
1144 #: ../../__w/calibre/calibre/manual/template_lang.rst:556
1145 msgid ""
1146 "There are several ways to construct the URL. The following use Wikipedia as "
1147 "an example."
1148 msgstr ""
1149
1150 #: ../../__w/calibre/calibre/manual/template_lang.rst:558
1151 msgid "The simplest is a basic template::"
1152 msgstr ""
1153
1154 #: ../../__w/calibre/calibre/manual/template_lang.rst:562
1155 msgid ""
1156 "In some cases you might want to do more processing. There are four template "
1157 "functions you can use, depending on the complexity of the processing."
1158 msgstr ""
1159
1160 #: ../../__w/calibre/calibre/manual/template_lang.rst:569
1161 msgid ""
1162 "For example, assume you have a custom column `Translators` "
1163 "(``#translators``) where the names are `Last name, First name`. You might "
1164 "need to convert the name to `First name Last name` when creating the URL. "
1165 "You can use the :ref:`ff_make_url` function to do this::"
1166 msgstr ""
1167
1168 #: ../../__w/calibre/calibre/manual/template_lang.rst:573
1169 msgid ""
1170 "If we assume that the translator's name is `Boy-Żeleński, Tadeusz` then the "
1171 "above template produces the link::"
1172 msgstr ""
1173
1174 #: ../../__w/calibre/calibre/manual/template_lang.rst:577
1175 msgid ""
1176 "Note that the person's first name is now first, the space is now a plus, and"
1177 " that the non-English characters in the last name are URL-encoded."
1178 msgstr ""
1179
1180 #: ../../__w/calibre/calibre/manual/template_lang.rst:579
1181 msgid ""
1182 "The functions :ref:`ff_make_url_extended`, :ref:`ff_query_string`, and "
1183 ":ref:`ff_encode_for_url` might be useful depending upon any additional "
1184 "processing complexity."
1185 msgstr ""
1186
1187 #: ../../__w/calibre/calibre/manual/template_lang.rst:581
1188 msgid "**The calibre URL scheme**"
1189 msgstr ""
1190
1191 #: ../../__w/calibre/calibre/manual/template_lang.rst:583
1192 msgid ""
1193 "Calibre supports several different URLs to navigate your calibre libraries. "
1194 "This section shows how to use templates to construct some of the URLs. See "
1195 ":doc:`url_scheme` for details on the URLs available."
1196 msgstr ""
1197
1198 #: ../../__w/calibre/calibre/manual/template_lang.rst:586
1199 msgid "Switch to a specific library. The syntax of this URL is::"
1200 msgstr ""
1201
1202 #: ../../__w/calibre/calibre/manual/template_lang.rst:590
1203 msgid ""
1204 "``Library_Name`` must be replaced with the name of the calibre library you "
1205 "wish to open. The library name is shown in the title bar of the window. It "
1206 "is a simple name, not the file path to the library. You must spell it as "
1207 "shown in the title bar, including letter case. The character ``_`` "
1208 "(underscore) stands for the current library. If the name contains any spaces"
1209 " or special characters then it must be hex encoded using the "
1210 ":ref:`ff_to_hex` function, as in the following example::"
1211 msgstr ""
1212
1213 #: ../../__w/calibre/calibre/manual/template_lang.rst:598
1214 msgid "The template generates the URL::"
1215 msgstr "ಸಿದ್ಧಮಾದರಿಯು URL ಅನ್ನು ರಚಿಸುತ್ತದೆ::"
1216
1217 #: ../../__w/calibre/calibre/manual/template_lang.rst:602
1218 msgid ""
1219 "You can replace the ``current_library_name()`` function with the actual name"
1220 " of the library, as in::"
1221 msgstr ""
1222
1223 #: ../../__w/calibre/calibre/manual/template_lang.rst:606
1224 msgid ""
1225 "Links to show books. These links select a book in the calibre library. The "
1226 "syntax for this URL is::"
1227 msgstr ""
1228
1229 #: ../../__w/calibre/calibre/manual/template_lang.rst:610
1230 msgid ""
1231 "The ``book id`` is the numeric calibre id for the book, available to "
1232 "templates as ``$id``. As above, the library name might need to be hex "
1233 "encoded. Here is an example::"
1234 msgstr ""
1235
1236 #: ../../__w/calibre/calibre/manual/template_lang.rst:615
1237 msgid "It produces the URL::"
1238 msgstr ""
1239
1240 #: ../../__w/calibre/calibre/manual/template_lang.rst:619
1241 msgid ""
1242 "Searching for books. These links search for books in the specified calibre "
1243 "library. The syntax for this URL is::"
1244 msgstr ""
1245
1246 #: ../../__w/calibre/calibre/manual/template_lang.rst:624
1247 msgid ""
1248 "where `query` is any valid calibre search expression. You must hex encode "
1249 "any query containing spaces or special characters, which generally means all"
1250 " of them. For example, the calibre search expression for searching for a "
1251 "hierarchical tag beginning with 'AA' is ``tags:\"=.AA\"``. This template "
1252 "constructs a search URL for that expression::"
1253 msgstr ""
1254
1255 #: ../../__w/calibre/calibre/manual/template_lang.rst:630
1256 msgid "The resulting URL is::"
1257 msgstr ""
1258
1259 #: ../../__w/calibre/calibre/manual/template_lang.rst:634
1260 msgid ""
1261 "Here is an example of the same URL built using the "
1262 ":ref:``ff_make_url_extended`` function instead of :ref:`ff_strcat`::"
1263 msgstr ""
1264
1265 #: ../../__w/calibre/calibre/manual/template_lang.rst:639
1266 msgid ""
1267 "Open a book details window on a book in some library. The syntax for this "
1268 "URL is::"
1269 msgstr ""
1270
1271 #: ../../__w/calibre/calibre/manual/template_lang.rst:643
1272 msgid "An example template is::"
1273 msgstr "ಒಂದು ಸಿದ್ಧಮಾದರಿ ಉದಾಹರಣೆ::"
1274
1275 #: ../../__w/calibre/calibre/manual/template_lang.rst:647
1276 #: ../../__w/calibre/calibre/manual/template_lang.rst:664
1277 msgid "which produces the URL::"
1278 msgstr ""
1279
1280 #: ../../__w/calibre/calibre/manual/template_lang.rst:651
1281 msgid ""
1282 "Open the notes associated with an author/series/etc. The syntax of the URL "
1283 "is::"
1284 msgstr ""
1285
1286 #: ../../__w/calibre/calibre/manual/template_lang.rst:656
1287 msgid ""
1288 "``Field_Name`` is the lookup name of the field. If the field is a custom "
1289 "column then replace the ``#`` character with an underscore (``_``). "
1290 "``Item_Id`` is the internal numeric ID of the value in the field. There "
1291 "isn't a template function that returns the ``Item_Id``, so templates will "
1292 "normally use the second form, ``Hex_Encoded_Item_Name``. Here is a sample "
1293 "template that opens the note for the person ``Boy-Żeleński, Tadeusz`` in the"
1294 " field ``#authtest``::"
1295 msgstr ""
1296
1297 #: ../../__w/calibre/calibre/manual/template_lang.rst:670
1298 msgid "Stored templates"
1299 msgstr "ಉಳಿಸಿದ ಸಿದ್ಧಮಾದರಿಗಳು"
1300
1301 #: ../../__w/calibre/calibre/manual/template_lang.rst:672
1302 msgid ""
1303 "Both :ref:`General Program Mode <general_mode>` and :ref:`Python Template "
1304 "Mode <python_mode>` support saving templates and calling those templates "
1305 "from another template, much like calling stored functions. You save "
1306 "templates using :guilabel:`Preferences->Advanced->Template functions`. More "
1307 "information is provided in that dialog. You call a template the same way you"
1308 " call a function, passing positional arguments if desired. An argument can "
1309 "be any expression. Examples of calling a template, assuming the stored "
1310 "template is named ``foo``:"
1311 msgstr ""
1312
1313 #: ../../__w/calibre/calibre/manual/template_lang.rst:674
1314 msgid "``foo()`` -- call the template passing no arguments."
1315 msgstr ""
1316
1317 #: ../../__w/calibre/calibre/manual/template_lang.rst:675
1318 msgid ""
1319 "``foo(a, b)`` call the template passing the values of the two variables "
1320 "``a`` and ``b``."
1321 msgstr ""
1322
1323 #: ../../__w/calibre/calibre/manual/template_lang.rst:676
1324 msgid ""
1325 "``foo(if field('series') then field('series_index') else 0 fi)`` -- if the "
1326 "book has a ``series`` then pass the ``series_index``, otherwise pass the "
1327 "value ``0``."
1328 msgstr ""
1329
1330 #: ../../__w/calibre/calibre/manual/template_lang.rst:678
1331 msgid ""
1332 "In GPM you retrieve the arguments passed in the call to the stored template "
1333 "using the ``arguments`` function. It both declares and initializes local "
1334 "variables, effectively parameters. The variables are positional; they get "
1335 "the value of the parameter given in the call in the same position. If the "
1336 "corresponding parameter is not provided in the call then ``arguments`` "
1337 "assigns that variable the provided default value. If there is no default "
1338 "value then the variable is set to the empty string. For example, the "
1339 "following ``arguments`` function declares 2 variables, ``key``, "
1340 "``alternate``::"
1341 msgstr ""
1342
1343 #: ../../__w/calibre/calibre/manual/template_lang.rst:682
1344 msgid "Examples, again assuming the stored template is named ``foo``:"
1345 msgstr ""
1346
1347 #: ../../__w/calibre/calibre/manual/template_lang.rst:684
1348 msgid ""
1349 "``foo('#myseries')`` -- argument ``key`` is assigned the value "
1350 "``'myseries'`` and the argument ``alternate`` is assigned the default value "
1351 "``'series'``."
1352 msgstr ""
1353
1354 #: ../../__w/calibre/calibre/manual/template_lang.rst:685
1355 msgid ""
1356 "``foo('series', '#genre')`` the variable ``key`` is assigned the value "
1357 "``'series'`` and the variable ``alternate`` is assigned the value "
1358 "``'#genre'``."
1359 msgstr ""
1360
1361 #: ../../__w/calibre/calibre/manual/template_lang.rst:686
1362 msgid ""
1363 "``foo()`` -- the variable ``key`` is assigned the empty string and the "
1364 "variable ``alternate`` is assigned the value ``'series'``."
1365 msgstr ""
1366
1367 #: ../../__w/calibre/calibre/manual/template_lang.rst:688
1368 msgid ""
1369 "In PTM the arguments are passed in the ``arguments`` parameter, which is a "
1370 "list of strings. There isn't any way to specify default values. You must "
1371 "check the length of the ``arguments`` list to be sure that the number of "
1372 "arguments is what you expect."
1373 msgstr ""
1374
1375 #: ../../__w/calibre/calibre/manual/template_lang.rst:690
1376 msgid ""
1377 "An easy way to test stored templates is using the ``Template tester`` "
1378 "dialog. For ease of access give it a keyboard shortcut in "
1379 ":guilabel:`Preferences->Advanced->Keyboard shortcuts->Template tester`. "
1380 "Giving the ``Stored templates`` dialog a shortcut will help switching more "
1381 "rapidly between the tester and editing the stored template's source code."
1382 msgstr ""
1383
1384 #: ../../__w/calibre/calibre/manual/template_lang.rst:693
1385 msgid "Providing additional information to templates"
1386 msgstr ""
1387
1388 #: ../../__w/calibre/calibre/manual/template_lang.rst:695
1389 msgid ""
1390 "A developer can choose to pass additional information to the template "
1391 "processor, such as application-specific book metadata or information about "
1392 "what the processor is being asked to do. A template can access this "
1393 "information and use it during the evaluation."
1394 msgstr ""
1395
1396 #: ../../__w/calibre/calibre/manual/template_lang.rst:697
1397 msgid "**Developer: how to pass additional information**"
1398 msgstr ""
1399
1400 #: ../../__w/calibre/calibre/manual/template_lang.rst:699
1401 msgid ""
1402 "The additional information is a Python dictionary containing pairs "
1403 "``variable_name: variable_value`` where the values must be strings. The "
1404 "template can access the dictionary, creating template local variables named "
1405 "``variable_name`` containing the value ``variable_value``. The user cannot "
1406 "change the name so it is best to use names that won't collide with other "
1407 "template local variables, for example by prefixing the name with an "
1408 "underscore."
1409 msgstr ""
1410
1411 #: ../../__w/calibre/calibre/manual/template_lang.rst:701
1412 msgid ""
1413 "This dictionary is passed to the template processor (the ``formatter``) "
1414 "using the named parameter ``global_vars=your_dict``. The full method "
1415 "signature is::"
1416 msgstr ""
1417
1418 #: ../../__w/calibre/calibre/manual/template_lang.rst:709
1419 msgid "**Template writer: how to access the additional information**"
1420 msgstr ""
1421
1422 #: ../../__w/calibre/calibre/manual/template_lang.rst:711
1423 msgid ""
1424 "You access the additional information (the ``globals`` dictionary) in a "
1425 "template using the template function::"
1426 msgstr ""
1427
1428 #: ../../__w/calibre/calibre/manual/template_lang.rst:715
1429 msgid ""
1430 "where ``id`` is any legal variable name. This function checks whether the "
1431 "additional information provided by the developer contains the name. If it "
1432 "does then the function assigns the provided value to a template local "
1433 "variable with that name. If the name is not in the additional information "
1434 "and if an ``expression`` is provided, the ``expression`` is evaluated and "
1435 "the result is assigned to the local variable. If neither a value nor an "
1436 "expression is provided, the function assigns the empty string (``''``) to "
1437 "the local variable."
1438 msgstr ""
1439
1440 #: ../../__w/calibre/calibre/manual/template_lang.rst:717
1441 msgid ""
1442 "A template can set a value in the ``globals`` dictionary using the template "
1443 "function::"
1444 msgstr ""
1445
1446 #: ../../__w/calibre/calibre/manual/template_lang.rst:721
1447 msgid ""
1448 "This function sets the ``globals`` dictionary key:value pair ``id:value`` "
1449 "where ``value`` is the value of the template local variable ``id``. If that "
1450 "local variable doesn't exist then ``value`` is set to the result of "
1451 "evaluating ``expression``."
1452 msgstr ""
1453
1454 #: ../../__w/calibre/calibre/manual/template_lang.rst:724
1455 msgid "Notes on the difference between modes"
1456 msgstr ""
1457
1458 #: ../../__w/calibre/calibre/manual/template_lang.rst:726
1459 msgid ""
1460 "The three program modes, :ref:`Single Function Mode <single_mode>` (SFM), "
1461 ":ref:`Template Program Mode <template_mode>` (`TPM`), and :ref:`General "
1462 "Program Mode <general_mode>` (`GPM`), work differently. SFM is intended to "
1463 "be 'simple' so it hides a lot of programming language bits."
1464 msgstr ""
1465
1466 #: ../../__w/calibre/calibre/manual/template_lang.rst:728
1467 msgid "Differences:"
1468 msgstr "ವ್ಯತ್ಯಾಸಗಳು:"
1469
1470 #: ../../__w/calibre/calibre/manual/template_lang.rst:730
1471 msgid ""
1472 "In SFM the value of the column is always passed as an 'invisible' first "
1473 "argument to a function included in the template."
1474 msgstr ""
1475
1476 #: ../../__w/calibre/calibre/manual/template_lang.rst:731
1477 msgid ""
1478 "SFM doesn't support the difference between variables and strings; all values"
1479 " are strings."
1480 msgstr ""
1481
1482 #: ../../__w/calibre/calibre/manual/template_lang.rst:732
1483 msgid ""
1484 "The following SFM template returns either the series name or the string \"no"
1485 " series\"::"
1486 msgstr ""
1487
1488 #: ../../__w/calibre/calibre/manual/template_lang.rst:736
1489 msgid "The equivalent template in `TPM` is ::"
1490 msgstr ""
1491
1492 #: ../../__w/calibre/calibre/manual/template_lang.rst:740
1493 msgid "The equivalent template in `GPM` is::"
1494 msgstr ""
1495
1496 #: ../../__w/calibre/calibre/manual/template_lang.rst:744
1497 msgid ""
1498 "The first argument to ``ifempty`` is the value of the field ``series``. The "
1499 "second argument is the string ``no series``. In SFM the first argument, the "
1500 "value of the field, is automatically passed (the invisible argument)."
1501 msgstr ""
1502
1503 #: ../../__w/calibre/calibre/manual/template_lang.rst:745
1504 msgid ""
1505 "Several template functions, for example ``booksize()`` and "
1506 "``current_library_name()``, take no arguments. Because of the 'invisible "
1507 "argument' you cannot use these functions in SFM."
1508 msgstr ""
1509
1510 #: ../../__w/calibre/calibre/manual/template_lang.rst:746
1511 msgid ""
1512 "Nested functions, where a function calls another function to compute an "
1513 "argument, cannot be used in SFM. For example this template, intended to "
1514 "return the first 5 characters of the series value uppercased, won't work in "
1515 "SFM::"
1516 msgstr ""
1517
1518 #: ../../__w/calibre/calibre/manual/template_lang.rst:750
1519 msgid ""
1520 "`TPM` and `GPM` support nested functions. The above template in `TPM` would "
1521 "be::"
1522 msgstr ""
1523
1524 #: ../../__w/calibre/calibre/manual/template_lang.rst:754
1525 msgid "In `GPM` it would be::"
1526 msgstr ""
1527
1528 #: ../../__w/calibre/calibre/manual/template_lang.rst:758
1529 msgid ""
1530 "As noted in the above :ref:`Template Program Mode <template_mode>` section, "
1531 "using ``{`` and ``}`` characters in `TPM` string literals can lead to errors"
1532 " or unexpected results because they confuse the template processor. It tries"
1533 " to treat them as template boundaries, not characters. In some but not all "
1534 "cases you can replace a ``{`` with ``[[`` and a ``}`` with `]]`. Generally, "
1535 "if your program contains ``{`` and ``}`` characters then you should use "
1536 "`General Program Mode`."
1537 msgstr ""
1538
1539 #: ../../__w/calibre/calibre/manual/template_lang.rst:762
1540 msgid "User-defined Python template functions"
1541 msgstr ""
1542
1543 #: ../../__w/calibre/calibre/manual/template_lang.rst:764
1544 msgid ""
1545 "You can add your own Python functions to the template processor. Such "
1546 "functions can be used in any of the three template programming modes. The "
1547 "functions are added by going to :guilabel:`Preferences -> Advanced -> "
1548 "Template functions`. Instructions are shown in that dialog. Note that you "
1549 "can use `Python Templates` for a similar purpose. As calling user-defined "
1550 "functions is faster than calling a Python template, user-defined functions "
1551 "might be more efficient depending on the complexity of what the function or "
1552 "template does."
1553 msgstr ""
1554
1555 #: ../../__w/calibre/calibre/manual/template_lang.rst:767
1556 msgid "Special notes for using templates in different contexts"
1557 msgstr ""
1558
1559 #: ../../__w/calibre/calibre/manual/template_lang.rst:769
1560 msgid ""
1561 "In the GUI (:guilabel:`Columns made from other columns` and "
1562 ":guilabel:`Template searches`):"
1563 msgstr ""
1564
1565 #: ../../__w/calibre/calibre/manual/template_lang.rst:771
1566 msgid "GPM templates work as before."
1567 msgstr ""
1568
1569 #: ../../__w/calibre/calibre/manual/template_lang.rst:772
1570 msgid "Python templates have full access to the calibre database."
1571 msgstr ""
1572
1573 #: ../../__w/calibre/calibre/manual/template_lang.rst:774
1574 msgid "In icon rules:"
1575 msgstr ""
1576
1577 #: ../../__w/calibre/calibre/manual/template_lang.rst:776
1578 msgid ""
1579 "icon rule templates have no book data so field-based functions such as "
1580 ":ref:`ff_format_date_field`, :ref:`ff_list_count_field`, and "
1581 ":ref:`ff_check_yes_no` won't work."
1582 msgstr ""
1583
1584 #: ../../__w/calibre/calibre/manual/template_lang.rst:778
1585 msgid "In the Content server:"
1586 msgstr ""
1587
1588 #: ../../__w/calibre/calibre/manual/template_lang.rst:780
1589 msgid ""
1590 "Templates have access to the new API but not the old API (LibraryDatabase)."
1591 msgstr ""
1592
1593 #: ../../__w/calibre/calibre/manual/template_lang.rst:781
1594 msgid ""
1595 "Because of the above, the following formatter functions are not guaranteed "
1596 "to work in GPM templates (composite columns, icon rules, etc) and should be "
1597 "avoided if you use the content server:"
1598 msgstr ""
1599
1600 #: ../../__w/calibre/calibre/manual/template_lang.rst:783
1601 msgid ":ref:`ff_connected_device_name`"
1602 msgstr ":ref:`ff_connected_device_name`"
1603
1604 #: ../../__w/calibre/calibre/manual/template_lang.rst:784
1605 msgid ":ref:`ff_connected_device_uuid`"
1606 msgstr ":ref:`ff_connected_device_uuid`"
1607
1608 #: ../../__w/calibre/calibre/manual/template_lang.rst:785
1609 msgid ":ref:`ff_current_virtual_library_name`"
1610 msgstr ":ref:`ff_current_virtual_library_name`"
1611
1612 #: ../../__w/calibre/calibre/manual/template_lang.rst:786
1613 msgid ":ref:`ff_is_marked`"
1614 msgstr ":ref:`ff_is_marked`"
1615
1616 #: ../../__w/calibre/calibre/manual/template_lang.rst:787
1617 msgid ":ref:`ff_virtual_libraries`"
1618 msgstr ":ref:`ff_virtual_libraries`"
1619
1620 #: ../../__w/calibre/calibre/manual/template_lang.rst:790
1621 msgid "Special notes for save/send templates"
1622 msgstr "ಸಿದ್ಧಮಾದರಿ ಉಳಿಸಿ/ಕಳುಹಿಸಿ ಗೆ ವಿಶೇಷ ಟಿಪ್ಪಣಿಗಳು"
1623
1624 #: ../../__w/calibre/calibre/manual/template_lang.rst:792
1625 msgid ""
1626 "Special processing is applied when a template is used in a :guilabel:`Save "
1627 "to disk` or :guilabel:`Send to device` template. The values of the fields "
1628 "are cleaned, replacing characters that are special to file systems with "
1629 "underscores, including slashes. This means that field text cannot be used to"
1630 " create folders. However, slashes are not changed in prefix or suffix "
1631 "strings, so slashes in these strings will cause folders to be created. "
1632 "Because of this, you can create variable-depth folder structure."
1633 msgstr ""
1634
1635 #: ../../__w/calibre/calibre/manual/template_lang.rst:794
1636 msgid ""
1637 "For example, assume we want the folder structure `series/series_index - "
1638 "title`, with the caveat that if series does not exist, then the title should"
1639 " be in the top folder. The template to do this is::"
1640 msgstr ""
1641
1642 #: ../../__w/calibre/calibre/manual/template_lang.rst:798
1643 msgid "The slash and the hyphen appear only if series is not empty."
1644 msgstr ""
1645
1646 #: ../../__w/calibre/calibre/manual/template_lang.rst:800
1647 msgid ""
1648 "The lookup function lets us do even fancier processing. For example, assume "
1649 "that if a book has a series, then we want the folder structure "
1650 "`series/series index - title.fmt`. If the book does not have a series then "
1651 "we want the folder structure `genre/author_sort/title.fmt`. If the book has "
1652 "no genre then we want to use 'Unknown'. We want two completely different "
1653 "paths, depending on the value of series."
1654 msgstr ""
1655
1656 #: ../../__w/calibre/calibre/manual/template_lang.rst:802
1657 msgid "To accomplish this, we:"
1658 msgstr ""
1659
1660 #: ../../__w/calibre/calibre/manual/template_lang.rst:804
1661 msgid ""
1662 "Create a composite field (give it lookup name #aa) containing "
1663 "``{series}/{series_index} - {title}``. If the series is not empty, then this"
1664 " template will produce `series/series_index - title`."
1665 msgstr ""
1666
1667 #: ../../__w/calibre/calibre/manual/template_lang.rst:805
1668 msgid ""
1669 "Create a composite field (give it lookup name #bb) containing "
1670 "``{#genre:ifempty(Unknown)}/{author_sort}/{title}``. This template produces "
1671 "`genre/author_sort/title`, where an empty genre is replaced with `Unknown`."
1672 msgstr ""
1673
1674 #: ../../__w/calibre/calibre/manual/template_lang.rst:806
1675 msgid ""
1676 "Set the save template to ``{series:lookup(.,#aa,#bb)}``. This template "
1677 "chooses composite field ``#aa`` if series is not empty and composite field "
1678 "``#bb`` if series is empty. We therefore have two completely different save "
1679 "paths, depending on whether or not `series` is empty."
1680 msgstr ""
1681
1682 #: ../../__w/calibre/calibre/manual/template_lang.rst:809
1683 msgid "Tips"
1684 msgstr ""
1685
1686 #: ../../__w/calibre/calibre/manual/template_lang.rst:811
1687 msgid ""
1688 "Use the Template Tester to test templates. Add the tester to the context "
1689 "menu for books in the library and/or give it a keyboard shortcut."
1690 msgstr ""
1691
1692 #: ../../__w/calibre/calibre/manual/template_lang.rst:812
1693 msgid ""
1694 "Templates can use other templates by referencing composite columns built "
1695 "with the desired template. Alternatively, you can use Stored Templates."
1696 msgstr ""
1697
1698 #: ../../__w/calibre/calibre/manual/template_lang.rst:813
1699 msgid ""
1700 "In a plugboard, you can set a field to empty (or whatever is equivalent to "
1701 "empty) by using the special template ``{}``. This template will always "
1702 "evaluate to an empty string."
1703 msgstr ""
1704
1705 #: ../../__w/calibre/calibre/manual/template_lang.rst:814
1706 msgid ""
1707 "The technique described above to show numbers even if they have a zero value"
1708 " works with the standard field series_index."
1709 msgstr ""
1710
1711 #: ../../__w/calibre/calibre/manual/template_lang.rst:819
1712 msgid "Template function reference"
1713 msgstr ""