Debian Codegraph @

translations/manual/uk/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 # Yuri Chornoivan <[email protected]>, 2014,2017-2018,2020-2026
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: calibre\n"
10 "Report-Msgid-Bugs-To: \n"
11 "POT-Creation-Date: 2026-02-17 16:44+0000\n"
12 "PO-Revision-Date: 2014-06-17 08:34+0000\n"
13 "Last-Translator: Yuri Chornoivan <[email protected]>, 2014,2017-2018,2020-2026\n"
14 "Language-Team: Ukrainian (http://app.transifex.com/calibre/calibre/language/uk/)\n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
18 "Language: uk\n"
19 "Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != 11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || (n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n"
20
21 #: ../../../__w/calibre/calibre/manual/template_lang.rst:4
22 msgid "The calibre template language"
23 msgstr "Мова шаблонів calibre"
24
25 #: ../../../__w/calibre/calibre/manual/template_lang.rst:6
26 msgid ""
27 "The calibre template language is a calibre-specific language used throughout"
28 " calibre for tasks such as specifying file paths, formatting values, and "
29 "computing the value for user-specified columns. Examples:"
30 msgstr "Мова шаблонів calibre є специфічною для calibre мовою програмування, яка використовується у різних компонентах calibre. Її використовують для визначення шляхів до файлів, значення форматування та обчислення значень визначених користувачем стовпчиків. Приклади:"
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 "Визначення структури каталогів та назви файла при зберіганні файлів з бібліотеки calibre на диск або на пристрій для читання книг."
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 "Визначення правил додавання піктограм і кольорів до списку книг calibre."
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 of one or more ``template expressions``. A "
68 "``template expression`` consists of text and names in curly brackets "
69 "(``{}``) that is replaced by the corresponding metadata from the book being "
70 "processed. For example, the default template in calibre used for saving "
71 "books to device has 4 ``template expressions``::"
72 msgstr "Базовий шаблон містить один або декілька ``виразів шаблонів``. Вираз шаблона складається з тексту і назв у фігурних дужках (``{}``), які згодом буде замінено на відповідні метадані із оброблюваної книги. Наприклад, типовим шаблоном, який використано для збереження книг на пристроях у calibre, містить 4 ``шаблонних вирази``::"
73
74 #: ../../../__w/calibre/calibre/manual/template_lang.rst:23
75 msgid "For the book \"The Foundation\" by \"Isaac Asimov\" the template will become::"
76 msgstr "Для книги «The Foundation» автора «Isaac Asimov» ми отримаємо::"
77
78 #: ../../../__w/calibre/calibre/manual/template_lang.rst:27
79 msgid ""
80 "The slashes are not ``template expressions`` because they are not in between"
81 " ``{}``. Such text is left where it appears. For example, if the template "
82 "is::"
83 msgstr "Символи похилих рисок не є ``шаблонними виразами``, оскільки їх немає всередині ``{}``. Такі фрагменти тексту після обробки лишаються на місці. Наприклад, якщо шаблоном є такий::"
84
85 #: ../../../__w/calibre/calibre/manual/template_lang.rst:31
86 msgid "then for \"The Foundation\" the template produces::"
87 msgstr "для «The Foundation» шаблон дасть::"
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 "Шаблон може отримувати доступ до усіх метаданих, які доступні у calibre, зокрема нетипових стовпчиків (стовпчиків, які створено користувачем), за їхньою ``назвою для пошуку``. Щоб визначити назву для пошуку для стовпчика (який іноді називають «полем»), наведіть вказівник миші на заголовок стовпчика у списку книг calibre. У назвах для пошуку нетипових стовпчиків першим символом завжди є ``#``. Для стовпчиків типу циклів передбачено додаткове поле із назвою ``'#назва_для_пошуку'_index``, яке містить індекс у циклі. Отже, якщо у вас є нетипове поле циклу із назвою ``#myseries``, буде також і поле із назвою ``#myseries_index``. Індекс стандартного стовпчика циклу має назву ``series_index``."
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 "``{formats}`` — список форматів, доступних у бібліотеці calibre для книги"
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 "Якщо книга Азімова «Second Foundation» є частиною циклу «Foundation», шаблон дасть::"
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 "Іноді може виникнути потреба у виведенні тексту, лише якщо певне поле є непорожнім Типовим прикладом є ``series`` і ``series_index``. У цьому прикладі нам потрібен буде або порожній рядок або два значення, які відокремлено дефісом. У calibre для обробки подібних випадків передбачено спеціальний синтаксис запису шаблона."
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 "Наприклад, використовуючи наведений вище приклад із «Foundation», припустімо, вам потрібно, щоб застосування шаблона давало таке: `Foundation - 3 - Second Foundation`. Цей шаблон дає такий результат:"
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:|текст_префікса|текст_суфікса}``"
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 "Цей ``шаблонний вираз`` визначає, що якщо ``field`` має значення `XXXX`, результатом буде `prefix_textXXXXXsuffix_text`. Якщо ``field`` є порожнім (не має значення), результатом буде порожній рядок (нічого), оскільки префікс і суфікс буде проігноровано. Префікс і суфікс можуть містити пробіли."
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 "Дефіси буде включено, лише якщо для книги визначено індекс у циклі, а таке трапляється, лише якщо метадані містять запис циклу. Продовжуючи приклад із «Foundation», шаблон дасть `Foundation - 1 - Second Foundation`."
212
213 #: ../../../__w/calibre/calibre/manual/template_lang.rst:83
214 #: ../../../__w/calibre/calibre/manual/template_lang.rst:293
215 #: ../../../__w/calibre/calibre/manual/template_lang.rst:469
216 msgid "Notes:"
217 msgstr "Нотатки:"
218
219 #: ../../../__w/calibre/calibre/manual/template_lang.rst:85
220 msgid ""
221 "You must include the colon after the ``lookup name`` if you are using a "
222 "prefix or a suffix."
223 msgstr "Вам слід включити двокрапку після назви для пошуку, якщо ви хочете скористатися префіксом або суфіксом."
224
225 #: ../../../__w/calibre/calibre/manual/template_lang.rst:86
226 msgid ""
227 "You must use either no or both ``|`` characters. Using one, as in ``{field:|"
228 " - }``, is not allowed."
229 msgstr "Вам слід або не використовувати символи ``|``, або використовувати обидва символи; користуватися одним з них, як у ``{field:| - }``, не можна."
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 "Можна не вказувати текст для префікса або суфікса, якось так: ``{series:|| - }``. Шаблон ``{title:||}`` є еквівалентним до шаблона ``{title}``."
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 "Припустімо, вам потрібно переконатися, що ``series_index`` завжди записуватиметься у форматі з трьох цифр із початковими нулями. Ось як цього досягти:"
246
247 #: ../../../__w/calibre/calibre/manual/template_lang.rst:93
248 msgid "``{series_index:0>3s}`` - Three digits with leading zeros"
249 msgstr "``{series_index:0>3s}`` — три цифри із початковими нулями"
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 "``{series_index:0<3s}`` — три цифрви із завершальними нулями"
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 "Якщо ви використовуєте індекси у циклі із проміжними значеннями (наприклад, 11), вам може знадобитися вирівнювання десяткової крапки. Наприклад, бажаним буде запис індексів 1 і 2.5 як 01.00 і 02.50 для належного упорядковування на пристроях із лексичним упорядкуванням. Щоб досягти потрібного результату, скористайтеся таким шаблоном::"
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 "``{series_index:0>5.2f}`` — п'ять символів складаються із двох цифр і початковими нулями, десяткової крапки і 2 цифр після десяткової крапки."
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 "Більша частина форматування мови шаблонів calibre є похідною від Python. Щоб дізнатися більше про синтаксичні конструкції таких дій з форматування, ознайомтеся із `документацією з Python <https://docs.python.org/3/library/string.html#formatstrings>`_."
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 "Шаблони використовують для показу даних, яких немає у метаданих calibre або показу даних у форматуванні, яке відрізняється від стандартного форматування calibre. Наприклад, у вас може виникнути потреба бачити ISBN, поле, вміст якого calibre не показує. Для показу таких даних ви можете скористатися нетиповими стовпчиками. Створіть стовпчик із типом «Стовпчик, створений на основі інших стовпчиків» (надалі ми такі стовпчики називатимемо складеними) і введіть до нього шаблон. Результат: calibre показуватиме у стовпчику результат обчислення шаблона. Для показу ISBN створіть стовпчик і введіть ``{identifiers:select(isbn)}`` у поле шаблона. Щоб створити стовпчик, який міститиме значення двох нетипових стовпчиків циклів, скористайтеся шаблоном ``{#series1:||,}{#series2}``."
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 "Зауваження: редагувати дані, які показано у складеному стовпчику не можна. Редагувати слід дані у стовпчиках-джерелах. Якщо ви спробуєте виконати редагування складеного стовпчика, наприклад, подвійним клацанням на даних у ньому, calibre відкриє для редагування шаблон, а не дані, які він виводить."
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 "Набори метаданих використовуються для внесення змін до метаданих, що записуються до книг під час дій із надсилання на пристрій і збереження на диск. Набір метаданих надає вам змогу вказати шаблон для надання даних, які слід записати до метаданих книги. Ви можете скористатися наборами метаданих для внесення змін до таких полів: authors, author_sort, language, publisher, tags, title, title_sort. Набори метаданих допомагають у використанні спеціалізованих метаданих для книг на пристрої з метою усування проблем із упорядковуванням книг або їхнім показом."
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 "Під час створення набору метаданих ви визначаєте формат і пристрій, для яких використовуватиметься набір. Передбачено особливий пристрій, ``save_to_disk``, який використовується для збереження книг у певних форматах (на відміну від надсилання книг на пристрій). Після вибору формату і пристрою вам слід вибрати поля метаданих для внесення змін і надати шаблони для визначення нових значень цих полів. Ці шаблони буде `з’єднано` з відповідними полями призначення. Ви, звичайно ж, можете використовувати у шаблонах наборів метаданих складені стовпчики."
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 "Набори метаданих є доволі гнучкими — їх можна писати у режимі однієї функції, режимі програмування шаблонів, загальному режимі програмування та режимі шаблонів Python."
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 "Якщо до метаданих може бути застосовано набір (на сервері даних, для збереження на диск або надсилання на пристрій), calibre шукає визначені набори метаданих і вибирає належний для заданого формату і пристрою. Наприклад, для того, щоб знайти належний набір метаданих для книги EPUB, яку надсилають на пристрій під керуванням ANDROID, calibre шукає набори метаданих у такому порядку:"
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 "набір метаданих із точною відповідністю за форматом і пристроєм, наприклад ``EPUB`` і ``ANDROID``"
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 "набір метаданих із точним відповідником за форматом і спеціальним варіантом ``any device``, наприклад ``EPUB`` і ``any device``"
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 "набір метаданих із спеціальним варіантом ``any format`` і точною відповідністю за пристроєм, наприклад ``any format`` і ``ANDROID``"
378
379 #: ../../../__w/calibre/calibre/manual/template_lang.rst:136
380 msgid "a plugboard with ``any format`` and ``any device``"
381 msgstr "набір метаданих ``any format`` і ``any device``"
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 "Поля міток (`tags`) і авторів (`authors`) обробляються у особливий спосіб, оскільки у обох цих полях може міститися декілька записів. У книги може бути багато міток і багато авторів. Якщо ви визначаєте одне з цих двох полів як таке, вміст якого слід змінити, результати використання шаблона буде перевірено на наявність декількох записів. Для міток результат буде розділено на записи за знайденими calibre комами. Наприклад, якщо шаблон створює значення ``Трилер, Жахи``, результатом буде дві мітки, ``Трилер`` і ``Жахи``. Способів додавання коми у окрему мітку не передбачено."
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 "Те саме стосується авторів, але для поділу на записи використовується інший символ, `&` (амперсанд), а не кома. Наприклад, якщо шаблоном створюється значення ``Blogs, Joe&Posts, Susan``, для книги буде визначено двоє авторів, ``Blogs, Joe`` і ``Posts, Susan``. Якщо ж шаблон створює значення ``Blogs, Joe;Posts, Susan``, книга матиме один запис автора із доволі чудернацьким іменем."
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 "Припустімо, вам потрібно показати значення поля літерами верхнього регістру, хоча зазвичай вміст цього поля записується регістром символів як у заголовку. Досягти цього можна за допомогою `функцій шаблонів`. Наприклад, для переведення літер у верхній регістр можна скористатися функцією ``uppercase``, ось так: ``{title:uppercase()}``. Для показу назви у форматі, типовому для заголовків, скористайтеся шаблоном ``{title:titlecase()}``."
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 "**Не використовуйте підлеглих шаблонів (`{ ... }`) у аргументах функцій.** Замість них, використовуйте :ref:`режим шаблонного програмування <template_mode>` та :ref:`загальний режим програмування <general_mode>`."
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 "При використанні функцій у режимі єдиної функції перший параметр, ``значення``, буде автоматично замінено на вміст поля, яке вказано у шаблоні. Наприклад, при обробці шаблона ``{title:capitalize()}`` вміст поля ``title`` буде передано як параметр ``значення`` функції capitalize."
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 "Документацію до функцій наведено у розділі :ref:`template_functions_reference`. У документації описано потрібні для роботи функцій аргументи та завдання, які виконують функції. Наприклад, ось документація до функції :ref:`ff_ifempty`."
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 "Як бачите, функція потребує двох аргументів, ``value`` і ``text_if_empty``. Втім, оскільки ми використовуємо режим єдиної функції, ми пропускаємо аргумент ``value``, передаючи лише ``text_if_empty``. Наприклад, цей шаблон:"
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 shows `No tags "
516 "on this book`."
517 msgstr "показує мітки книги, якщо такі є. Якщо міток немає, показує `No tags on this book`."
518
519 #: ../../../__w/calibre/calibre/manual/template_lang.rst:185
520 msgid ""
521 "The following functions are usable in Single Function Mode because their "
522 "first parameter is ``value``."
523 msgstr "Наведені нижче функції можна використовувати у режимі єдиної функції, оскільки їхнім першим параметром є ``значення``."
524
525 #: ../../../__w/calibre/calibre/manual/template_lang.rst:227
526 msgid "**Using functions and formatting in the same template**"
527 msgstr "**Використання функцій і форматування у одному шаблоні**"
528
529 #: ../../../__w/calibre/calibre/manual/template_lang.rst:229
530 msgid ""
531 "Suppose you have an integer custom column ``#myint`` that you want displayed"
532 " with leading zeros, as in ``003``. One way to do this is to use a format of"
533 " ``0>3s``. However, by default if a number (integer or float) equals zero "
534 "then the value is displayed as the empty string so zero values will produce "
535 "the empty string, not ``000``. If you want to see ``000`` values then you "
536 "use both the format string and the ``ifempty`` function to change the empty "
537 "value back to a zero. The template would be::"
538 msgstr "Припустімо, у нас є нетиповий стовпчик із назвою ``#myint``, у якому містяться цілі числа. Вам потрібно представити їх у форматі із початковими нулями, ось так: ``003``. Для цього можна було б скористатися форматуванням ``0>3s``. Втім, типово, якщо число (ціле або дійсне) дорівнює нулеві, значення буде показано як порожній рядок. Отже, нульові значення початкові значення призводитимуть до порожніх рядків, а не до записів ``000``. Якщо вам потрібні саме значення ``000``, вам слід скористатися одразу і рядком форматування, і функцією ``ifempty`` для заміни порожнього значення на нульове. Шаблон може бути таким::"
539
540 #: ../../../__w/calibre/calibre/manual/template_lang.rst:233
541 msgid ""
542 "Note that you can use the prefix and suffix as well. If you want the number "
543 "to appear as ``[003]`` or ``[000]``, then use the template::"
544 msgstr "Зауважте, що ви можете також використовувати префікс і суфікс. Якщо ви хочете, щоб число було показано як ``[003]`` або ``[000]``, скористайтеся таким шаблоном::"
545
546 #: ../../../__w/calibre/calibre/manual/template_lang.rst:240
547 msgid "General Program Mode"
548 msgstr "Загальний режим програмування"
549
550 #: ../../../__w/calibre/calibre/manual/template_lang.rst:242
551 msgid ""
552 "`General Program Mode` (`GPM`) replaces `template expressions` with a "
553 "program written in the `template language`. The syntax of the language is "
554 "defined by the following grammar::"
555 msgstr "`Загальний режим програмування замінює `вирази шаблонів` програмою, яку написано `мовою шаблонів`. Синтаксис мови визначено такою граматикою::"
556
557 #: ../../../__w/calibre/calibre/manual/template_lang.rst:295
558 msgid ""
559 "a ``top_expression`` always has a value. The value of an ``expression_list``"
560 " is the value of the last ``top_expression`` in the list. For example, the "
561 "value of the expression list ``1;2;'foobar';3`` is ``3``."
562 msgstr "``top_expression`` завжди має значення. Значення ``expression_list`` є значенням останнього ``top_expression`` у списку. Наприклад, значення списку виразів ``1;2;'foobar';3`` дорівнює ``3``."
563
564 #: ../../../__w/calibre/calibre/manual/template_lang.rst:296
565 msgid "In a logical context, any non-empty value is ``True``"
566 msgstr "У логічному контексті будь-яке непорожнє значення дорівнює ``True``"
567
568 #: ../../../__w/calibre/calibre/manual/template_lang.rst:297
569 msgid "In a logical context, the empty value is ``False``"
570 msgstr "У логічному контексті порожнє значення дорівнює ``False``"
571
572 #: ../../../__w/calibre/calibre/manual/template_lang.rst:298
573 msgid ""
574 "Strings and numbers can be used interchangeably. For example, ``10`` and "
575 "``'10'`` are the same thing."
576 msgstr "Рядки і числа можна використовувати на рівних правах. Наприклад, ``10`` і ``'10'`` є тим самим значенням."
577
578 #: ../../../__w/calibre/calibre/manual/template_lang.rst:299
579 msgid ""
580 "Comments are lines starting with a '#' character, possibly preceded by "
581 "blanks or tabs."
582 msgstr "Коментарями вважаються усі рядки, на початку яких є символ «#», перед яким може бути додано пробіли або табуляції."
583
584 #: ../../../__w/calibre/calibre/manual/template_lang.rst:301
585 msgid "**Operator precedence**"
586 msgstr "**Пріоритетність операторів**"
587
588 #: ../../../__w/calibre/calibre/manual/template_lang.rst:303
589 msgid ""
590 "The operator precedence (order of evaluation) from highest (evaluated first)"
591 " to lowest (evaluated last) is:"
592 msgstr "Пріоритетність операторів (порядок обчислення), від найвищої (обчислюються першими) до найнижчої (обчислюються останніми):"
593
594 #: ../../../__w/calibre/calibre/manual/template_lang.rst:305
595 msgid ""
596 "Function calls, constants, parenthesized expressions, statement expressions,"
597 " assignment expressions, field references."
598 msgstr "Виклики функцій, сталі, вирази у дужках, вирази інструкцій, вирази надання значення, посилання на поля."
599
600 #: ../../../__w/calibre/calibre/manual/template_lang.rst:306
601 msgid ""
602 "Unary plus (``+``) and minus (``-``). These operators evaluate right to "
603 "left."
604 msgstr "Унарні плюс (``+``) і мінус (``-``). Обчислення для цих операторів виконується справа ліворуч."
605
606 #: ../../../__w/calibre/calibre/manual/template_lang.rst:308
607 msgid ""
608 "These and all the other arithmetic operators return integers if the "
609 "expression results in a fractional part equal to zero. For example, if an "
610 "expression returns ``3.0`` it is changed to ``3``."
611 msgstr "Ці і усі інші арифметичні операції повертають цілі числа, якщо обчислення виразу призводить до числа із дробовою частиною, яка рівна нулеві. Приклад: якщо результатом обчислення виразу є ``3.0``, його буде замінено на ``3``."
612
613 #: ../../../__w/calibre/calibre/manual/template_lang.rst:309
614 msgid ""
615 "Multiply (``*``) and divide (``/``). These operators are associative and "
616 "evaluate left to right. Use parentheses if you want to change the order of "
617 "evaluation."
618 msgstr "Множення (``*``) і ділення (``/``). Ці дії є асоціативними і обчислюються зліва праворуч. Скористайтеся дужками, якщо ви хочете змінити порядок обчислення."
619
620 #: ../../../__w/calibre/calibre/manual/template_lang.rst:310
621 msgid ""
622 "Add (``+``) and subtract (``-``). These operators are associative and "
623 "evaluate left to right."
624 msgstr "Додавання (``+``) і віднімання (``-``). Ці дії є асоціативними, обчислення виконується зліва праворуч."
625
626 #: ../../../__w/calibre/calibre/manual/template_lang.rst:311
627 msgid ""
628 "Numeric and string comparisons. These operators return ``'1'`` if the "
629 "comparison succeeds, otherwise the empty string (``''``). Comparisons are "
630 "not associative: ``a < b < c`` is a syntax error."
631 msgstr "Порівняння чисел і рядків. Ці оператори повертають ``'1'``, якщо порівняння справджується, інакше повертають порожній рядок (``''``). Порівняння не є асоціативними: ``a < b < c`` — синтаксична помилка."
632
633 #: ../../../__w/calibre/calibre/manual/template_lang.rst:312
634 msgid ""
635 "String concatenation (``&``). The ``&`` operator returns a string formed by "
636 "concatenating the left-hand and right-hand expressions. Example: ``'aaa' & "
637 "'bbb'`` returns ``'aaabbb'``. The operator is associative and evaluates left"
638 " to right."
639 msgstr "Поєднання рядків (``&``). Оператор ``&`` повертає рядок, який сформовано об'єднанням виразів ліворуч і праворуч від нього. Приклад: ``'aaa' & 'bbb'`` повертає ``'aaabbb'``. Оператор є асоціативним і обчислюється зліва праворуч."
640
641 #: ../../../__w/calibre/calibre/manual/template_lang.rst:313
642 msgid ""
643 "Unary logical not (``!``). This operator returns ``'1'`` if the expression "
644 "is False (evaluates to the empty string), otherwise ``''``."
645 msgstr "Унарне логічне заперечення (``!``). Цей оператор повертає ``'1'``, якщо вираз не є істинним (є порожнім рядком), інакше повертає ``''``."
646
647 #: ../../../__w/calibre/calibre/manual/template_lang.rst:314
648 msgid ""
649 "Logical and (``&&``). This operator returns '1' if both the left-hand and "
650 "right-hand expressions are True, or the empty string ``''`` if either is "
651 "False. It is associative, evaluates left to right, and does `short-"
652 "circuiting <https://chortle.ccsu.edu/java5/Notes/chap40/ch40_2.html>`_."
653 msgstr "Логічне «І» (``&&``). Цей оператор повертає '1', якщо вирази ліворуч і праворуч від нього є істинними, або порожній рядок ``''``, якщо хоча б одне з тверджень ліворуч і праворуч є хибним. Оператор є асоціативним, обчислюється зліва праворуч, і має властивість `скороченого обчислення <https://chortle.ccsu.edu/java5/Notes/chap40/ch40_2.html>`_."
654
655 #: ../../../__w/calibre/calibre/manual/template_lang.rst:315
656 msgid ""
657 "Logical or (``||``). This operator returns ``'1'`` if either the left-hand "
658 "or right-hand expression is True, or ``''`` if both are False. It is "
659 "associative, evaluates left to right, and does `short-circuiting "
660 "<https://chortle.ccsu.edu/java5/Notes/chap40/ch40_2.html>`_. It is an "
661 "`inclusive or`, returning ``'1'`` if both the left- and right-hand "
662 "expressions are True."
663 msgstr "Логічне «АБО» (``||``) Цей оператор повертає ``'1'``, якщо твердження ліворуч або праворуч від нього є істинним, або ``''``, якщо обидва твердження є хибними. Є асоціативним, обчислюється зліва праворуч і має властивість `скороченого обчислення <https://chortle.ccsu.edu/java5/Notes/chap40/ch40_2.html>`_. Оператор є інклюзивним «АБО», тобто повертає ``'1'``, якщо вирази праворуч і ліворуч від нього є істинними."
664
665 #: ../../../__w/calibre/calibre/manual/template_lang.rst:317
666 msgid "**Field references**"
667 msgstr "**Посилання на поля**"
668
669 #: ../../../__w/calibre/calibre/manual/template_lang.rst:319
670 msgid ""
671 "A ``field_reference`` evaluates to the value of the metadata field named by "
672 "lookup name that follows the ``$`` or ``$$``. Using ``$`` is equivalent to "
673 "using the :ref:`ff_field` function. Using ``$$`` is equivalent to using the "
674 ":ref:`ff_raw_field` function. Examples::"
675 msgstr "Інструкцію ``field_reference`` буде замінено значенням поля метаданих, яке має назву пошуку, яку вказано після ``$`` або ``$$``. Використання ``$`` є еквівалентне до використання функції ref:`ff_field`. Використання ``$$`` є еквівалентним до використання функції :ref:`ff_raw_field`. Приклади::"
676
677 #: ../../../__w/calibre/calibre/manual/template_lang.rst:326
678 msgid "**If expressions**"
679 msgstr "**Вирази if**"
680
681 #: ../../../__w/calibre/calibre/manual/template_lang.rst:328
682 msgid ""
683 "``If`` expressions first evaluate the ``condition``. If the ``condition`` is"
684 " True (a non-empty value) then the ``expression_list`` in the ``then`` "
685 "clause is evaluated. If it is False then if present the ``expression_list`` "
686 "in the ``elif`` or ``else`` clause is evaluated. The ``elif`` and ``else`` "
687 "parts are optional. The words ``if``, ``then``, ``elif``, ``else``, and "
688 "``fi`` are reserved; you cannot use them as identifier names. You can put "
689 "newlines and white space wherever they make sense. The ``condition`` is a "
690 "``top_expression`` not an ``expression_list``; semicolons are not allowed. "
691 "The ``expression_lists`` are semicolon-separated sequences of "
692 "``top_expressions``. An ``if`` expression returns the result of the last "
693 "``top_expression`` in the evaluated ``expression_list``, or the empty string"
694 " if no expression list was evaluated."
695 msgstr "У виразах ``if`` спочатку обчислюється ``умова``. Якщо ``умова`` справджується (обчислення дають непорожнє значення), обчислюється ``expression_list`` у інструкції ``then````. Якщо умова не справджується, обчислюється, якщо є, ``expression_list`` у інструкції ``elif`` або ``else``, якщо існують такі інструкції. Частини ``elif`` і ``else`` є необов'язковими. Слова ``if``, ``then``, ``elif``, ``else`` і ``fi`` є зарезервованими, ви не можете використовувати їх як назви ідентифікаторів. Ви можете вставляти розриви рядків та пробіли там, де захочете. Запис ``condition`` є ``top_expression``, а не ``expression_list``; не можна використовувати крапку з комою. Набори ``expression_lists`` є розділеними крапками з комами послідовності ``top_expression``. Вираз ``if`` повертає результат останнього ``top_expression`` у обчисленому ``expression_list`` або порожній рядок, якщо жодного списку виразів не було обчислено."
696
697 #: ../../../__w/calibre/calibre/manual/template_lang.rst:330
698 msgid "Examples::"
699 msgstr "Приклади::"
700
701 #: ../../../__w/calibre/calibre/manual/template_lang.rst:343
702 msgid "Nested ``if`` example::"
703 msgstr "Приклад вкладеного``if``::"
704
705 #: ../../../__w/calibre/calibre/manual/template_lang.rst:356
706 msgid ""
707 "As said above, an ``if`` produces a value. This means that all the following"
708 " are equivalent::"
709 msgstr "Як ми вже згадували вище, ``if`` дає значення. Це означає, що усі вказані нижче інструкції є еквівалентними::"
710
711 #: ../../../__w/calibre/calibre/manual/template_lang.rst:362
712 msgid ""
713 "For example, this program returns the value of the ``series`` column if the "
714 "book has a series, otherwise the value of the ``title`` column::"
715 msgstr "Приклад програми, яка повертає значення у стовпчику ``series``, якщо книга належить до циклу, інакше повертає значення стовпчика ``title``::"
716
717 #: ../../../__w/calibre/calibre/manual/template_lang.rst:366
718 msgid "**For expressions**"
719 msgstr "**Вирази for**"
720
721 #: ../../../__w/calibre/calibre/manual/template_lang.rst:368
722 msgid ""
723 "The ``for`` expression iterates over a list of values, processing them one "
724 "at a time. The ``list_expression`` must evaluate either to a metadata field "
725 "``lookup name`` e.g., ``tags`` or ``#genre``, or to a list of values. The "
726 ":ref:`ff_range` generates a list of numbers. If the result is a valid "
727 "``lookup name`` then the field's value is fetched and the separator "
728 "specified for that field type is used. If the result isn't a valid lookup "
729 "name then it is assumed to be a list of values. The list is assumed to be "
730 "separated by commas unless the optional keyword ``separator`` is supplied, "
731 "in which case the list values must be separated by the result of evaluating "
732 "the ``separator_expr``. A separator cannot be used if the list is generated "
733 "by ``range()``. Each value in the list is assigned to the specified variable"
734 " then the ``expression_list`` is evaluated. You can use ``break`` to jump "
735 "out of the loop, and ``continue`` to jump to the beginning of the loop for "
736 "the next iteration."
737 msgstr "Вираз ``for`` виконує ітерацію за списком значень, обробляючи їх по одному за раз. Вираз ``list_expression`` має оброблятися до ``назви для пошуку`` поля метаданих, наприклад ``tags`` або ``#genre``, або списку значень. Функція :ref:`ff_range` створює список чисел. Якщо результат є коректною ``назвою для пошуку``, отримується значення поля. Використовується роздільник, вказаний для відповідного типу поля. Якщо результат не є коректною назвою для пошуку, припускається, що це список значень. Припускається, що значення у списку розділено комами, якщо не вказано необов'язкове ключове слово ``separator``. Якщо ключове слово вказано, значення у списку має бути відокремлено результатом обчислення ``separator_expr``. Роздільник не можна використовувати, якщо список створено за допомогою ``range()``. Кожне зі значень у списку надається вказаній змінній, а потім обчислюється ``expression_list``. Ви можете скористатися ``break`` для виходу з циклу і ``continue`` для переходу на початок циклу для наступної ітерації."
738
739 #: ../../../__w/calibre/calibre/manual/template_lang.rst:370
740 msgid ""
741 "Example: This template removes the first hierarchical name for each value in"
742 " Genre (``#genre``), constructing a list with the new names::"
743 msgstr "Приклад: цей шаблон вилучає першу ієрархічну назву для кожного значення у полі «Жанр» (``#genre``), будуючи список із новими назвами::"
744
745 #: ../../../__w/calibre/calibre/manual/template_lang.rst:380
746 msgid ""
747 "If the original Genre is `History.Military, Science Fiction.Alternate "
748 "History, ReadMe` then the template returns `Military, Alternate History, "
749 "ReadMe`. You could use this template in calibre's :guilabel:`Edit metadata "
750 "in bulk -> Search & replace` with :guilabel:`Search for` set to ``template``"
751 " to strip off the first level of the hierarchy and assign the resulting "
752 "value to Genre."
753 msgstr "Якщо початковим значенням поля «Жанр» було `History.Military, Science Fiction.Alternate History, ReadMe`, шаблон поверне `Military, Alternate History, ReadMe`. Ви можете скористатися цим шаблоном в інструменті calibre :guilabel:`Пакетне редагування метаданих -> Пошук із заміною` ^ у полі :guilabel:`Шукати` слід вказати ``шаблон`` для вилучення першого рівня ієрархії і визначення значення-результату для поля «Жанр»."
754
755 #: ../../../__w/calibre/calibre/manual/template_lang.rst:383
756 msgid ""
757 "Note: the last line in the template, ``new_tags``, isn't strictly necessary "
758 "in this case because ``for`` returns the value of the last top_expression in"
759 " the expression list. The value of an assignment is the value of its "
760 "expression, so the value of the ``for`` statement is what was assigned to "
761 "``new_tags``."
762 msgstr "Зауваження: останній рядок у шаблоні, ``new_tags``, у цьому випадку не є строго обов'язковим, оскільки ``for`` повертає значення останнього top_expression у списку виразів. Значенням виразу надання значення є значення виразу, тому значенням інструкції ``for`` є те, що записано до ``new_tags``."
763
764 #: ../../../__w/calibre/calibre/manual/template_lang.rst:385
765 msgid "**with expressions**"
766 msgstr "**with вирази**"
767
768 #: ../../../__w/calibre/calibre/manual/template_lang.rst:387
769 msgid "The ``with`` expression:"
770 msgstr "Вираз ``with``:"
771
772 #: ../../../__w/calibre/calibre/manual/template_lang.rst:389
773 msgid ""
774 "changes the current book to the book with calibre book id (an integer) "
775 "produced by evaluating the ``top_expression``."
776 msgstr "замінює поточну книгу на книгу із ідентифікатором книги calibre (цілим числом), яке є результатом обчислення ``верхнього_виразу``."
777
778 #: ../../../__w/calibre/calibre/manual/template_lang.rst:390
779 msgid "runs the ``expression_list``."
780 msgstr "запускає ``список_виразів``."
781
782 #: ../../../__w/calibre/calibre/manual/template_lang.rst:391
783 msgid "then resets the current book back to what it was."
784 msgstr "потім повертається до поточної книги, якою вона була раніше."
785
786 #: ../../../__w/calibre/calibre/manual/template_lang.rst:393
787 msgid ""
788 "The ``with`` expression returns the result of the last ``top_expression`` in"
789 " the evaluated ``expression_list``, or the empty string if no expression "
790 "list was evaluated."
791 msgstr "З виразом ``with`` повертає результат обчислення останнього виразу ``верхній_вираз`` в обчисленому списку ``список_виразів``, або порожній рядок, якщо не було оброблено жодного списку виразів."
792
793 #: ../../../__w/calibre/calibre/manual/template_lang.rst:396
794 msgid ""
795 "For example, this template returns a list of the titles of each book "
796 "selected in the GUI::"
797 msgstr "Наприклад, цей шаблон повертає список заголовків кожної з книг, які позначено у графічному інтерфейсі:"
798
799 #: ../../../__w/calibre/calibre/manual/template_lang.rst:408
800 msgid "**Return stmt**"
801 msgstr "**Повертає stmt**"
802
803 #: ../../../__w/calibre/calibre/manual/template_lang.rst:410
804 msgid ""
805 "Return the value of the ``expression``. If executed in a function then it "
806 "returns the value of the expression to the caller. If executed in the "
807 "outermost context (the template) then it sets the value of the template to "
808 "the value of the expression and exits the template."
809 msgstr "Повертає значення виразу ``вираз``. Якщо виконано у функції, повертає значення виразу функції виклику. Якщо виконано у зовнішньому контексті (шаблоні), встановлює для значення шаблону значення виразу і виводить з шаблону."
810
811 #: ../../../__w/calibre/calibre/manual/template_lang.rst:412
812 msgid "**Function definition**"
813 msgstr "**Визначення функції**"
814
815 #: ../../../__w/calibre/calibre/manual/template_lang.rst:414
816 msgid ""
817 "If you have repeated code in a template then you can put that code into a "
818 "local function. The ``def`` keyword starts the definition. It is followed by"
819 " the function name, the argument list, then the code in the function. The "
820 "function definition ends with the ``fed`` keyword."
821 msgstr "Якщо у вашому шаблоні є код, який слід виконувати декілька разів, ви можете розмістити цей код у локальній функції. Визначення функції слід розпочинати з ключового слова ``def``. Після нього слід вказати назву функції, список аргументів, а потім код функції. Визначення функції завершується ключовим словом ``fed``."
822
823 #: ../../../__w/calibre/calibre/manual/template_lang.rst:416
824 msgid ""
825 "Arguments are positional. When a function is called the supplied arguments "
826 "are matched left to right against the defined parameters, with the value of "
827 "the argument assigned to the parameter. It is an error to provide more "
828 "arguments than defined parameters. Parameters can have default values, such "
829 "as ``a = 25``. If an argument is not supplied for that parameter then the "
830 "default value is used, otherwise the parameter is set to the empty string."
831 msgstr "Аргументи є позиційними. Під час виклику функції надані аргументи заміщують собою зліва праворуч визначені параметри, значення аргументу стає значенням параметра. Надання більшої за кількість визначених параметрів кількості аргументів вважається помилкою. Параметри можуть мати типові значення, наприклад, ``a = 25``. Якщо для параметра не надано аргументу, буде використано типове значення. Якщо такого типового значення немає, буде використано порожній рядок."
832
833 #: ../../../__w/calibre/calibre/manual/template_lang.rst:418
834 msgid "The ``return`` statement can be used in a local function."
835 msgstr "У локальній функції можна скористатися інструкцією ``return``."
836
837 #: ../../../__w/calibre/calibre/manual/template_lang.rst:420
838 msgid "A function must be defined before it can be used."
839 msgstr "Перш ніж функцією можна буде скористатися, її слід визначити."
840
841 #: ../../../__w/calibre/calibre/manual/template_lang.rst:422
842 msgid ""
843 "Example: This template computes an approximate duration in years, months, "
844 "and days from a number of days. The function ``to_plural()`` formats the "
845 "computed values. Note that the example also uses the ``&`` operator::"
846 msgstr "Приклад: цей шаблон обчислює приблизну тривалість періоду часу у роках, місяцях та днях на основі кількості днів. Для форматування обчислених значень використано функцію ``to_plural()``. Зауважте, що у прикладі також використано оператор ``&``::"
847
848 #: ../../../__w/calibre/calibre/manual/template_lang.rst:437
849 msgid "**Relational operators**"
850 msgstr "**Оператори відношень**"
851
852 #: ../../../__w/calibre/calibre/manual/template_lang.rst:439
853 msgid ""
854 "Relational operators return ``'1'`` if the comparison is true, otherwise the"
855 " empty string (``''``)."
856 msgstr "Оператори відношень повертають ``'1'``, якщо порівняння справджується, інакше повертають порожній рядок (``''``)."
857
858 #: ../../../__w/calibre/calibre/manual/template_lang.rst:441
859 msgid ""
860 "There are two forms of relational operators: string comparisons and numeric "
861 "comparisons."
862 msgstr "Реалізовано дві форми операторів відношень: порівняння рядків і порівняння чисел."
863
864 #: ../../../__w/calibre/calibre/manual/template_lang.rst:443
865 msgid ""
866 "String comparisons do case-insensitive string comparison using lexical "
867 "order. The supported string comparison operators are ``==``, ``!=``, ``<``, "
868 "``<=``, ``>``, ``>=``, ``in``, ``inlist``, and ``inlist_field``. For the "
869 "``in``, ``inlist``, and ``inlist_field`` operators, the result of the left "
870 "hand expression is interpreted as a regular expression pattern. They are "
871 "true if the value of left-hand regular expression matches the value of the "
872 "right hand expression. The regular expressions are case-insensitive."
873 msgstr "Порівняння рядків є порівнянням рядків без врахування регістру символів із використанням лексичного порядку. Підтримуваними операторами порівняння рядків є ``==``, ``!=``, ``<``, ``<=``, ``>``, ``>=``, ``in``, ``inlist`` та ``inlist_field``. Для операторів ``in``, ``inlist`` та ``inlist_field`` результат обчислення лівого операнда вважається формальним виразом взірця. Результатом іхнього обчислення є True, якщо взірець у лівого операнда відповідає значенню правого операнда. Відповідність встановлюється без врахування регістру символів. У формальних виразах враховується регістр символів."
874
875 #: ../../../__w/calibre/calibre/manual/template_lang.rst:446
876 msgid ""
877 "The ``inlist`` operator is true if the left hand regular expression matches "
878 "any one of the items in the right hand list where the items in the list are "
879 "separated by commas. The ``inlist_field`` operator is true if the left hand "
880 "regular expression matches any of the items in the field (column) named by "
881 "the right hand expression, using the separator defined for the field. NB: "
882 "the ``inlist_field`` operator requires the right hand expression to evaluate"
883 " to a field name, while the ``inlist`` operator requires the right hand "
884 "expression to evaluate to a string containing a comma-separated list. "
885 "Because of this difference, ``inlist_field`` is substantially faster than "
886 "``inlist`` because no string conversions or list constructions are done."
887 msgstr "Оператор ``inlist`` повертає true, якщо формальний вираз ліворуч від нього відповідає одному із записів у списку праворуч від нього, де записи у списку відокремлено комами. Оператор ``field_inlist`` повертає true, якщо формальний вираз ліворуч від нього відповідає будь-якому зі записів у полі (стовпчику), назву якого вказано праворуч від оператора, з використанням роздільника, який визначено для поля. Зауваження: для використання оператора ``inlist_field`` вираз праворуч від нього має визначати назву поля, а для використання оператора ``inlist`` результ татом обчислення виразу праворуч від нього має бути рядок, що містить відокремлений комами список. Через цю різницю ``inlist_field`` є суттєво швидшим за ``inlist``, оскільки не виконується ніяких перетворень рядків або побудови списків."
888
889 #: ../../../__w/calibre/calibre/manual/template_lang.rst:448
890 msgid ""
891 "The numeric comparison operators are ``==#``, ``!=#``, ``<#``, ``<=#``, "
892 "``>#``, ``>=#``. The left and right expressions must evaluate to numeric "
893 "values with two exceptions: both the string value \"None\" (undefined field)"
894 " and the empty string evaluate to the value zero."
895 msgstr "Операторами числового порівняння є ``==#``, ``!=#``, ``<#``, ``<=#``, ``>#``, ``>=#``. Результатом обчислення лівого і правого операндів мають бути числові значення з двома виключеннями: рядкове значення \"None\" (невизначене поле) і порожнє значення вважаються рівними нулеві."
896
897 #: ../../../__w/calibre/calibre/manual/template_lang.rst:450
898 msgid "Examples:"
899 msgstr "Приклади:"
900
901 #: ../../../__w/calibre/calibre/manual/template_lang.rst:452
902 msgid ""
903 "``program: field('series') == 'foo'`` returns ``'1'`` if the book's series "
904 "is `foo`, otherwise ``''``."
905 msgstr "``program: field('series') == 'foo'`` повертає ``'1'``, якщо циклом книги є `foo`, інакше повертає ``''``."
906
907 #: ../../../__w/calibre/calibre/manual/template_lang.rst:453
908 msgid ""
909 "``program: 'f.o' in field('series')`` returns ``'1'`` if the book's series "
910 "matches the regular expression ``f.o`` (e.g., `foo`, `Off Onyx`, etc.), "
911 "otherwise ``''``."
912 msgstr "``program: 'f.o' in field('series')`` повертає ``'1'``, якщо цикл книги відповідає формальному виразу ``f.o`` (наприклад, `foo`, `Off Onyx` тощо), інакше повертає ``''``."
913
914 #: ../../../__w/calibre/calibre/manual/template_lang.rst:454
915 msgid ""
916 "``program: 'science' inlist $#genre`` returns ``'1'`` if any of the values "
917 "retrieved from the book's genres match the regular expression ``science``, "
918 "e.g., `Science`, `History of Science`, `Science Fiction` etc., otherwise "
919 "``''``."
920 msgstr "``program: 'science' inlist $#genre`` повертає ``'1'``, якщо будь-яке зі значень, отриманих із запису жанрів книги, відповідає формальному виразу ``science``, наприклад, `Science`, `History of Science`, `Science Fiction` тощо. У інших випадках буде повернуто ``''``."
921
922 #: ../../../__w/calibre/calibre/manual/template_lang.rst:455
923 msgid ""
924 "``program: '^science$' inlist $#genre`` returns ``'1'`` if any of the book's"
925 " genres exactly match the regular expression ``^science$``, e.g., `Science`,"
926 " otherwise ``''``. The genres `History of Science` and `Science Fiction` "
927 "don't match."
928 msgstr "``program: '^science$' inlist $#genre`` повертає ``'1'``, якщо будь-який із записів жанрів книги точно відповідає формальному виразу ``^science$``, наприклад, `Science`. Якщо відповідність не буде встановлено, програма поверне ``''``. Жанри `History of Science` і `Science Fiction` вважаються невідповідними."
929
930 #: ../../../__w/calibre/calibre/manual/template_lang.rst:456
931 msgid ""
932 "``program: 'asimov' inlist $authors`` returns ``'1'`` if any author matches "
933 "the regular expression ``asimov``, e.g., `Asimov, Isaac` or `Isaac Asimov`, "
934 "otherwise ``''``."
935 msgstr "``program: 'asimov' inlist $authors`` повертає ``'1'``, якщо будь-який із записів авторів відповідає формальному виразу ``asimov``, наприклад, `Asimov, Isaac` або `Isaac Asimov`, якщо таких записів немає, повертає ``''``."
936
937 #: ../../../__w/calibre/calibre/manual/template_lang.rst:457
938 msgid ""
939 "``program: 'asimov' inlist_field 'authors'`` returns ``'1'`` if any author "
940 "matches the regular expression ``asimov``, e.g., `Asimov, Isaac` or `Isaac "
941 "Asimov`, otherwise ``''``."
942 msgstr "``program: 'asimov' inlist_field 'authors'`` повертає ``'1'``, якщо будь-який із записів авторів відповідає формальному виразу ``asimov``, наприклад, `Asimov, Isaac` або `Isaac Asimov`, якщо таких записів немає, повертає ``''``."
943
944 #: ../../../__w/calibre/calibre/manual/template_lang.rst:458
945 msgid ""
946 "``program: 'asimov$' inlist_field 'authors'`` returns ``'1'`` if any author "
947 "matches the regular expression ``asimov$``, e.g., `Isaac Asimov`, otherwise "
948 "``''``. It doesn't match `Asimov, Isaac` because of the ``$`` anchor in the "
949 "regular expression."
950 msgstr "``program: 'asimov$' inlist_field 'authors'`` повертає ``'1'``, якщо будь-який із записів авторів відповідає формальному виразу ``asimov$``, наприклад, `Isaac Asimov`, якщо це не так, повертає ``''``. Не відповідає запису `Asimov, Isaac` через прив'язку ``$`` у формальному виразі."
951
952 #: ../../../__w/calibre/calibre/manual/template_lang.rst:459
953 msgid ""
954 "``program: if field('series') != 'foo' then 'bar' else 'mumble' fi`` returns"
955 " ``'bar'`` if the book's series is not `foo`. Otherwise it returns "
956 "``'mumble'``."
957 msgstr "``program: if field('series') != 'foo' then 'bar' else 'mumble' fi`` повертає ``'bar'``, якщо циклом книги не є `foo`, інакше повертає ``mumble``."
958
959 #: ../../../__w/calibre/calibre/manual/template_lang.rst:460
960 msgid ""
961 "``program: if field('series') == 'foo' || field('series') == '1632' then "
962 "'yes' else 'no' fi`` returns ``'yes'`` if series is either `foo` or `1632`, "
963 "otherwise ``'no'``."
964 msgstr "``program: if field('series') == 'foo' || field('series') == '1632' then 'yes' else 'no' fi`` returns ``'yes'`` if series is either `foo` or `1632`, otherwise ``'no'``."
965
966 #: ../../../__w/calibre/calibre/manual/template_lang.rst:461
967 msgid ""
968 "``program: if '^(foo|1632)$' in field('series') then 'yes' else 'no' fi`` "
969 "returns ``'yes'`` if series is either `foo` or `1632`, otherwise ``'no'``."
970 msgstr "``program: if '^(foo|'1632)$' in field('series') then 'yes' else 'no' fi`` повертає ``'yes'``, якщо циклом є `foo` або `1632`, інакше повертає ``'no'``."
971
972 #: ../../../__w/calibre/calibre/manual/template_lang.rst:462
973 msgid ""
974 "``program: if 11 > 2 then 'yes' else 'no' fi`` returns ``'no'`` because the "
975 "``>`` operator does a lexical comparison."
976 msgstr "``program: if 11 > 2 then 'yes' else 'no' fi`` повертає ``'no'``, оскільки оператор ``>`` виконує лексичне порівняння."
977
978 #: ../../../__w/calibre/calibre/manual/template_lang.rst:463
979 msgid ""
980 "``program: if 11 ># 2 then 'yes' else 'no' fi`` returns ``'yes'`` because "
981 "the ``>#`` operator does a numeric comparison."
982 msgstr "``program: if 11 > 2 then 'yes' else 'no' fi`` повертає ``'yes'``, оскільки оператор ``>#`` виконує числове порівняння."
983
984 #: ../../../__w/calibre/calibre/manual/template_lang.rst:465
985 msgid "**Functions in General Program Mode**"
986 msgstr "**Функції у режимі загального програмування**"
987
988 #: ../../../__w/calibre/calibre/manual/template_lang.rst:467
989 msgid ""
990 "See :ref:`template_functions_reference` for the list of functions built into"
991 " the template language."
992 msgstr "Див. розділ :ref:`template_functions_reference`, у якому наведено список функцій, які вбудовано до мови шаблонів."
993
994 #: ../../../__w/calibre/calibre/manual/template_lang.rst:471
995 msgid ""
996 "As opposed to :ref:`Single Function Mode <single_mode>`, in General Program "
997 "Mode you must specify the first parameter ``value``."
998 msgstr "На відміну від :ref:`режиму єдиної функції <single_mode>`, у режимі загального програмування вам доведеться вказувати перший параметр, ``value``."
999
1000 #: ../../../__w/calibre/calibre/manual/template_lang.rst:472
1001 msgid "All parameters are expression_lists (see the grammar above)."
1002 msgstr "Усі параметри є expression_lists (див. граматику вище)."
1003
1004 #: ../../../__w/calibre/calibre/manual/template_lang.rst:477
1005 msgid "More complex programs in template expressions - Template Program Mode"
1006 msgstr "Складніші програми у виразах шаблонів — режим програмування шаблонів."
1007
1008 #: ../../../__w/calibre/calibre/manual/template_lang.rst:479
1009 msgid ""
1010 "`Template Program Mode` (`TPM`) is a blend of :ref:`General Program Mode "
1011 "<general_mode>` and :ref:`Single Function Mode <single_mode>`. `TPM` differs"
1012 " from Single Function Mode in that it permits writing template expressions "
1013 "that refer to other metadata fields, use nested functions, modify variables,"
1014 " and do arithmetic. It differs from `General Program Mode` in that the "
1015 "template is contained between ``{`` and ``}`` characters and doesn't begin "
1016 "with the word ``program:``. The program portion of the template is a General"
1017 " Program Mode expression list."
1018 msgstr "`Режим програмування шаблонів` є сумішшю :ref:`загального режиму програмування <general_mode>` і :ref:`режиму єдиної функції <single_mode>`. Режим програмування шаблонів відрізняється від режиму єдиної функції тим, що у ньому можна писати вирази шаблонів, які посилаються на інші поля метаданих, використовувати вкладені функції, змінювати значення змінних і виконувати арифметичні дії. Він відрізняється від загального режиму програмування тим, що шаблон міститься між символами ``{`` і ``}`` і не починається зі слова ``program:``. Програмна частина шаблона є списком виразів загального режиму програмування."
1019
1020 #: ../../../__w/calibre/calibre/manual/template_lang.rst:482
1021 msgid ""
1022 "Example: assume you want a template to show the series for a book if it has "
1023 "one, otherwise show the value of a custom field #genre. You cannot do this "
1024 "in the :ref:`Single Function Mode <single_mode>` because you cannot make "
1025 "reference to another metadata field within a template expression. In `TPM` "
1026 "you can, as the following expression demonstrates::"
1027 msgstr "Почнімо з прикладу. Припустімо, що ви хочете, щоб ваш шаблон показував цикл для книги, яка належить до циклу, і значення нетипового поля #genre, якщо книга не належить до циклів. Зробити це за допомогою :ref:`режиму єдиної функції <single_mode>` неможливо, оскільки ви не можете послатися на інше поле метаданих у виразі шаблона. Але у програмному режимі ви можете це зробити. Спрацює такий вираз::"
1028
1029 #: ../../../__w/calibre/calibre/manual/template_lang.rst:487
1030 msgid "The example shows several things:"
1031 msgstr "Приклад демонструє декілька речей:"
1032
1033 #: ../../../__w/calibre/calibre/manual/template_lang.rst:489
1034 msgid ""
1035 "`TPM` is used if the expression begins with ``:'`` and ends with ``'}``. "
1036 "Anything else is assumed to be in :ref:`Single Function Mode <single_mode>`."
1037 msgstr "`Режим програмування шаблонів` буде використано, якщо вираз починається з ``:'`` і завершується ``'}``. Усі інші варіанти вважатимуться використанням :ref:`режиму єдиної функції <single_mode>`."
1038
1039 #: ../../../__w/calibre/calibre/manual/template_lang.rst:491
1040 msgid ""
1041 "If the template contains a prefix and suffix, the expression ends with "
1042 "``'|`` where the ``|`` is the delimiter for the prefix. Example::"
1043 msgstr "Якщо у шаблоні міститься префікс і суфікс, вираз завершується на ``'|``, де ``|`` — роздільник для префікса. Приклад::"
1044
1045 #: ../../../__w/calibre/calibre/manual/template_lang.rst:495
1046 msgid ""
1047 "Functions must be given all their arguments. For example, the standard "
1048 "built-in functions must be given the initial parameter ``value``."
1049 msgstr "Функціям мають передаватися усі їхні аргументи. Наприклад, стандартним вбудованим функціями слід передавати початковий параметр ``значення``."
1050
1051 #: ../../../__w/calibre/calibre/manual/template_lang.rst:496
1052 msgid ""
1053 "The variable ``$`` is usable as the ``value`` argument and stands for the "
1054 "value of the field named in the template, ``series`` in this case."
1055 msgstr "Змінну ``$`` використовують як аргумент ``значення``, вона замінює значення поля, яке іменовано у шаблоні, у цьому випадку ``series``."
1056
1057 #: ../../../__w/calibre/calibre/manual/template_lang.rst:497
1058 msgid "white space is ignored and can be used anywhere within the expression."
1059 msgstr "пробіли буде проігноровано; їх можна використовувати будь-де у виразі."
1060
1061 #: ../../../__w/calibre/calibre/manual/template_lang.rst:498
1062 msgid ""
1063 "constant strings are enclosed in matching quotes, either ``'`` or ``\"``."
1064 msgstr "сталі рядки слід брати у відповідні лапки ``'`` або ``\"``."
1065
1066 #: ../../../__w/calibre/calibre/manual/template_lang.rst:500
1067 msgid ""
1068 "In `TPM`, using ``{`` and ``}`` characters in string literals can lead to "
1069 "errors or unexpected results because they confuse the template processor. It"
1070 " tries to treat them as template expression boundaries, not characters. In "
1071 "some but not all cases you can replace a ``{`` with ``[[`` and a ``}`` with "
1072 "`]]`. Advice: if your program contains ``{`` and ``}`` characters then you "
1073 "should use `General Program Mode`."
1074 msgstr "У режимі програмування шаблонів використання символів ``{`` і ``}`` у рядкових літералах режиму програмування шаблонів може призвести до помилок або неочікуваних результатів, оскільки ці символи заважають нормальній роботі обробника шаблонів. Він намагається обробити їх як межі виразу шаблона, а не символи. У деяких, але не в усіх випадках, ви можете замінити ``{`` на ``[[`` і ``}`` на `]]`. Порада: якщо у вашій програмі є символи ``{`` і ``}``, вам слід користуватися `загальним режимом програмування`."
1075
1076 #: ../../../__w/calibre/calibre/manual/template_lang.rst:505
1077 msgid "Python Template Mode"
1078 msgstr "Режим шаблонів Python"
1079
1080 #: ../../../__w/calibre/calibre/manual/template_lang.rst:507
1081 msgid ""
1082 "Python Template Mode (PTM) lets you write templates using native Python and "
1083 "the `calibre API <https://manual.calibre-ebook.com/develop.html#api-"
1084 "documentation-for-various-parts-of-calibre>`_. The database API will be of "
1085 "most use; further discussion is beyond the scope of this manual. PTM "
1086 "templates are faster and can do more complicated operations but you must "
1087 "know how to write code in Python using the calibre API."
1088 msgstr "Режим шаблонів Python (PTM) надає вам змогу писати шаблони за допомогою мови Python та `програмного інтерфейсу calibre <https://manual.calibre-ebook.com/develop.html#api-documentation-for-various-parts-of-calibre>`_. Найкориснішим програмним інтерфейсом буде програмний інтерфейс роботи з базою даних. Подальше обговорення не належить до предмета цього підручника. Шаблони PTM є швидшими і можуть виконувати складніші дії, але вам потрібні будуть значення щодо написання коду мовою Python за допомогою програмного інтерфейсу calibre."
1089
1090 #: ../../../__w/calibre/calibre/manual/template_lang.rst:509
1091 msgid "A PTM template begins with:"
1092 msgstr "Шаблон PTM розпочинається так:"
1093
1094 #: ../../../__w/calibre/calibre/manual/template_lang.rst:527
1095 msgid ""
1096 "You can add the above text to your template using the context menu, usually "
1097 "accessed with a right click. The comments are not significant and can be "
1098 "removed. You must use python indenting."
1099 msgstr "Ви можете додати наведений вище текст до вашого шаблона за допомогою контекстного меню, доступ до якого можна отримати за допомогою клацання правою кнопкою миші. Коментарі є необов'язковими — їх можна вилучити. Вам слід використовувати відступи, які використовують у Python."
1100
1101 #: ../../../__w/calibre/calibre/manual/template_lang.rst:529
1102 msgid ""
1103 "The context object supports ``str(context)`` that returns a string of the "
1104 "context's contents, and ``context.attributes`` that returns a list of the "
1105 "attribute names in the context."
1106 msgstr "Для об'єкта контексту передбачено підтримку ``str(контекст)``, яка повертає рядок вмісту контексту, та ``context.attributes``, який повертає список назв атрибутів у контексті."
1107
1108 #: ../../../__w/calibre/calibre/manual/template_lang.rst:531
1109 msgid ""
1110 "The ``context.funcs`` attribute allows calling Built-in and User template "
1111 "functions, and Stored GPM/Python templates, so that you can execute them "
1112 "directly in your code. The functions are retrieved using their names. If the"
1113 " name conflicts with a Python keyword, add an underscore to the end of the "
1114 "name. Examples:"
1115 msgstr "За допомогою атрибуту ``context.funcs`` можна викликати вбудовані функції та функції шаблонів користувача, а також збережені шаблони GPM/Python так, щоб їх можна було виконати безпосередньо у вашому коді. Функції буде отримано за назвами. Якщо виникне конфлікт назв із ключовим словом Python, додайте символ підкреслювання наприкінці назви. Приклади:"
1116
1117 #: ../../../__w/calibre/calibre/manual/template_lang.rst:538
1118 msgid ""
1119 "Here is an example of a PTM template that produces a list of all the authors"
1120 " for a series. The list is stored in a `Column built from other columns, "
1121 "behaves like tags`. It shows in :guilabel:`Book details` and has the "
1122 ":guilabel:`on separate lines` checked (in :guilabel:`Preferences->Look & "
1123 "feel->Book details`). That option requires the list to be comma-separated. "
1124 "To satisfy that requirement the template converts commas in author names to "
1125 "semicolons then builds a comma-separated list of authors. The authors are "
1126 "then sorted, which is why the template uses author_sort."
1127 msgstr "Нижче наведено приклад шаблона PTM, який створює список усіх авторів для циклу книг. Список буде збережено до «стовпчика побудованого на основі інших стовпчиків, який поводитиме себе як мітки». Його буде показано у :guilabel:`Подробицях щодо книги`, для нього буде використано позначений стан пункту :guilabel:`в окремих рядках` (на сторінці :guilabel:`Налаштування->Вигляд та поведінка->Подробиці щодо книги`). Використання цього пункту потребуватиме відокремлення записів у списку комами. Щоб виконати цю вимогу, шаблон перетворить коми у іменах авторів на крапки з комами, а потім побудує список відокремлених комами записів авторів. Записи авторів буде упорядковано, тому у шаблоні використано author_sort."
1128
1129 #: ../../../__w/calibre/calibre/manual/template_lang.rst:559
1130 msgid "The output in :guilabel:`Book details` looks like this:"
1131 msgstr "Виведені дані на панелі :guilabel:`Подробиці щодо книги` виглядатимуть так:"
1132
1133 #: ../../../__w/calibre/calibre/manual/template_lang.rst:561
1134 msgid "E-book conversion dialog"
1135 msgstr "Вікно перетворення електронних книг"
1136
1137 #: ../../../__w/calibre/calibre/manual/template_lang.rst:569
1138 msgid "Templates and URLs"
1139 msgstr "Шаблони і адреси"
1140
1141 #: ../../../__w/calibre/calibre/manual/template_lang.rst:571
1142 msgid "You can use templates to construct URLs. Two cases are described here:"
1143 msgstr "Ви можете скористатися шаблонами для побудови адрес. Тут описано два випадки:"
1144
1145 #: ../../../__w/calibre/calibre/manual/template_lang.rst:573
1146 msgid "Custom column :guilabel:`Book details` search URLs"
1147 msgstr "Адреси пошуку нетипових стовпчиків :guilabel:`Подробиць щодо книги`"
1148
1149 #: ../../../__w/calibre/calibre/manual/template_lang.rst:574
1150 msgid "The calibre URL scheme"
1151 msgstr "Схема адреси calibre"
1152
1153 #: ../../../__w/calibre/calibre/manual/template_lang.rst:576
1154 msgid "**Custom column book details search URLs**"
1155 msgstr "Адреси пошуку нетипових стовпчиків «Подробиць щодо книги»"
1156
1157 #: ../../../__w/calibre/calibre/manual/template_lang.rst:578
1158 msgid ""
1159 "When you create a custom column you can provide a URL to be used in "
1160 ":guilabel:`Book details` using a template. For example, if you have a custom"
1161 " column for `Translators` you can define a URL to take you to a site for "
1162 "translators. Book details search URLs can be provided for `Text`, "
1163 "`Enumerated`, `Series`, and `Column built from other column` column types."
1164 msgstr "Коли ви створюєте нетиповий стовпчик ви можете вказати адресу для використання на панелі :guilabel:`Подробиці щодо книги` за допомогою шаблону. Наприклад, якщо у вас є нетиповий стовпчик для параметра «Перекладачі», ви можете визначити адресу, яка спрямовуватиме вас на сайт для перекладачів. Адреси для пошуку подробиць щодо книги можна надати для типів стовпців `Текст`, `Пронумерований`, `Цикл` та `Стовпчик, побудований з інших стовпчиків`."
1165
1166 #: ../../../__w/calibre/calibre/manual/template_lang.rst:580
1167 msgid ""
1168 "When an item with a `search template` is clicked in :guilabel:`Book details`"
1169 " the template is evaluated. It is provided the normal book metadata. It is "
1170 "also provided three additional fields:"
1171 msgstr "Якщо клацнути на елементі з `шаблоном пошуку` на панелі :guilabel:`Подробиці щодо книги`, шаблон буде оброблено. Йому буде надано звичайні метадані книги. Також передбачено три додаткові поля:"
1172
1173 #: ../../../__w/calibre/calibre/manual/template_lang.rst:582
1174 msgid "``item_value``: the value of the clicked item."
1175 msgstr "``item_value``: значення натиснутого запису."
1176
1177 #: ../../../__w/calibre/calibre/manual/template_lang.rst:583
1178 msgid ""
1179 "``item_value_quoted``: the value of clicked item, URL-encoded. Special "
1180 "characters are escaped to make them valid in URLs and spaces are replaced by"
1181 " ``'+'`` (plus) signs."
1182 msgstr "``item_value_quoted``: значення натиснутого запису, закодоване як адресу. Спеціальні символи буде екрановано, щоб створити коректну адресу, а пробіли буде замінено символами ``'+'`` (плюс)."
1183
1184 #: ../../../__w/calibre/calibre/manual/template_lang.rst:584
1185 msgid ""
1186 "``item_value_no_plus``: the value of clicked item, URL-encoded. Special "
1187 "characters are escaped to make them valid in URLs and spaces are replaced by"
1188 " the ``%20``, not plus."
1189 msgstr "``item_value_no_plus``: значення натиснутого запису, закодоване як адресу. Спеціальні символи буде екрановано, щоб створити коректну адресу, а пробіли буде замінено ``%20``, а не плюсами."
1190
1191 #: ../../../__w/calibre/calibre/manual/template_lang.rst:586
1192 msgid ""
1193 "There are several ways to construct the URL. The following use Wikipedia as "
1194 "an example."
1195 msgstr "Існує декілька способів побудувати адресу. У наступному прикладі використано адреси Вікіпедії."
1196
1197 #: ../../../__w/calibre/calibre/manual/template_lang.rst:588
1198 msgid "The simplest is a basic template::"
1199 msgstr "Найпростіший базовий шаблон::"
1200
1201 #: ../../../__w/calibre/calibre/manual/template_lang.rst:592
1202 msgid ""
1203 "In some cases you might want to do more processing. There are four template "
1204 "functions you can use, depending on the complexity of the processing."
1205 msgstr "У деяких випадках вам може знадобитися додаткова обробка. Залежно від складності обробки можна використовувати чотири шаблонні функції."
1206
1207 #: ../../../__w/calibre/calibre/manual/template_lang.rst:599
1208 msgid ""
1209 "For example, assume you have a custom column `Translators` "
1210 "(``#translators``) where the names are `Last name, First name`. You might "
1211 "need to convert the name to `First name Last name` when creating the URL. "
1212 "You can use the :ref:`ff_make_url` function to do this::"
1213 msgstr "Наприклад, припустімо, що у вас є нетиповий стовпчик `Перекладачі` (``#translators``), де імена записано так: «Прізвище, Ім’я». Під час створення адреси вам може знадобитися перетворити ім’я на `Ім’я Прізвище’. Для цього можна використати функцію :ref:`ff_make_url`::"
1214
1215 #: ../../../__w/calibre/calibre/manual/template_lang.rst:603
1216 msgid ""
1217 "If we assume that the translator's name is `Boy-Żeleński, Tadeusz` then the "
1218 "above template produces the link::"
1219 msgstr "Якщо припускати, що ім'я перекладача `Boy-Żeleński, Tadeusz`, записаний вище шаблон створить таке посилання::"
1220
1221 #: ../../../__w/calibre/calibre/manual/template_lang.rst:607
1222 msgid ""
1223 "Note that the person's first name is now first, the space is now a plus, and"
1224 " that the non-English characters in the last name are URL-encoded."
1225 msgstr "Зауважте, що ім’я особи тепер є першим, пробіл – плюсом, а неанглійські символи в прізвищі закодовані в адресу."
1226
1227 #: ../../../__w/calibre/calibre/manual/template_lang.rst:609
1228 msgid ""
1229 "The functions :ref:`ff_make_url_extended`, :ref:`ff_query_string`, and "
1230 ":ref:`ff_encode_for_url` might be useful depending upon any additional "
1231 "processing complexity."
1232 msgstr "Залежно від складності додаткової обробки, можуть бути корисними функції :ref:`ff_make_url_extended`, :ref:`ff_query_string` і :ref:`ff_encode_for_url`."
1233
1234 #: ../../../__w/calibre/calibre/manual/template_lang.rst:611
1235 msgid "**The calibre URL scheme**"
1236 msgstr "**Схема адрес calibre**"
1237
1238 #: ../../../__w/calibre/calibre/manual/template_lang.rst:613
1239 msgid ""
1240 "Calibre supports several different URLs to navigate your calibre libraries. "
1241 "This section shows how to use templates to construct some of the URLs. See "
1242 ":doc:`url_scheme` for details on the URLs available."
1243 msgstr "У Calibre передбачено підтримку декількох різних адрес для навігації бібліотеками calibre. У цьому розділі показано, як використовувати шаблони для створення деяких адрес. Перегляньте :doc:`url_scheme` для отримання докладніших відомостей про доступні адреси."
1244
1245 #: ../../../__w/calibre/calibre/manual/template_lang.rst:616
1246 msgid "Switch to a specific library. The syntax of this URL is::"
1247 msgstr "Перемкнутися на певну бібліотеку. Синтаксис цієї адреси є таким::"
1248
1249 #: ../../../__w/calibre/calibre/manual/template_lang.rst:620
1250 msgid ""
1251 "``Library_Name`` must be replaced with the name of the calibre library you "
1252 "wish to open. The library name is shown in the title bar of the window. It "
1253 "is a simple name, not the file path to the library. You must spell it as "
1254 "shown in the title bar, including letter case. The character ``_`` "
1255 "(underscore) stands for the current library. If the name contains any spaces"
1256 " or special characters then it must be hex encoded using the "
1257 ":ref:`ff_to_hex` function, as in the following example::"
1258 msgstr "`Library_Name`` слід замінити назвою бібліотеки calibre, яку ви хочете відкрити. Назву бібліотеки буде показано у рядку заголовка вікна. Це проста назва, а не шлях до бібліотеки. Вам слід написати його так, як показано у рядку заголовка, включаючи регістр літер. Символ ``_`` (підкреслення) позначає поточну бібліотеку. Якщо назва містить пробіли або спеціальні символи, вона має бути закодована у шістнадцятковому форматі за допомогою функції :ref:`ff_to_hex`, як у наступному прикладі:"
1259
1260 #: ../../../__w/calibre/calibre/manual/template_lang.rst:628
1261 msgid "The template generates the URL::"
1262 msgstr "Шаблон створює таку адресу::"
1263
1264 #: ../../../__w/calibre/calibre/manual/template_lang.rst:632
1265 msgid ""
1266 "You can replace the ``current_library_name()`` function with the actual name"
1267 " of the library, as in::"
1268 msgstr "Ви можете замінити функцію ``current_library_name()`` на справжню назву бібліотеки, як-от::"
1269
1270 #: ../../../__w/calibre/calibre/manual/template_lang.rst:636
1271 msgid ""
1272 "Links to show books. These links select a book in the calibre library. The "
1273 "syntax for this URL is::"
1274 msgstr "Посилання для показу книг. Ці посилання позначають книгу у бібліотеці calibre. Синтаксис такої адреси::"
1275
1276 #: ../../../__w/calibre/calibre/manual/template_lang.rst:640
1277 msgid ""
1278 "The ``book id`` is the numeric calibre id for the book, available to "
1279 "templates as ``$id``. As above, the library name might need to be hex "
1280 "encoded. Here is an example::"
1281 msgstr "``book id`` — це числовий ідентифікатор calibre для книги, доступний для шаблонів як ``$id``. Як і вище, назва бібліотеки може потребувати шістнадцяткового кодування. Ось приклад::"
1282
1283 #: ../../../__w/calibre/calibre/manual/template_lang.rst:645
1284 msgid "It produces the URL::"
1285 msgstr "Створює таку адресу::"
1286
1287 #: ../../../__w/calibre/calibre/manual/template_lang.rst:649
1288 msgid ""
1289 "Searching for books. These links search for books in the specified calibre "
1290 "library. The syntax for this URL is::"
1291 msgstr "Пошук книг. Ці посилання шукають книги у вказаній бібліотеці calibre. Синтаксис такої адреси::"
1292
1293 #: ../../../__w/calibre/calibre/manual/template_lang.rst:654
1294 msgid ""
1295 "where `query` is any valid calibre search expression. You must hex encode "
1296 "any query containing spaces or special characters, which generally means all"
1297 " of them. For example, the calibre search expression for searching for a "
1298 "hierarchical tag beginning with 'AA' is ``tags:\"=.AA\"``. This template "
1299 "constructs a search URL for that expression::"
1300 msgstr "де `query` — будь-який коректний вираз пошуку calibre. Будь-який запит, що містить пробіли або спеціальні символи, що, як правило, означає їх усі, слід кодувати шістнадцятковими послідовностями. Наприклад, пошуковий вираз calibre для пошуку ієрархічної мітки, що починається з 'AA': ``tags:\"=.AA\"``. Цей шаблон створює адресу пошуку для цього виразу::"
1301
1302 #: ../../../__w/calibre/calibre/manual/template_lang.rst:660
1303 msgid "The resulting URL is::"
1304 msgstr "Адреса-результат::"
1305
1306 #: ../../../__w/calibre/calibre/manual/template_lang.rst:664
1307 msgid ""
1308 "Here is an example of the same URL built using the "
1309 ":ref:``ff_make_url_extended`` function instead of :ref:`ff_strcat`::"
1310 msgstr "Ось приклад тієї самої адреси, яку побудовано за допомогою функції :ref:``ff_make_url_extended``, замість :ref:`ff_strcat`()::"
1311
1312 #: ../../../__w/calibre/calibre/manual/template_lang.rst:669
1313 msgid ""
1314 "Open a book details window on a book in some library. The syntax for this "
1315 "URL is::"
1316 msgstr "Відкрити панель подробиць щодо книги у певній бібліотеці. Синтаксис цієї адреси::"
1317
1318 #: ../../../__w/calibre/calibre/manual/template_lang.rst:673
1319 msgid "An example template is::"
1320 msgstr "Приклад шаблону::"
1321
1322 #: ../../../__w/calibre/calibre/manual/template_lang.rst:677
1323 #: ../../../__w/calibre/calibre/manual/template_lang.rst:694
1324 msgid "which produces the URL::"
1325 msgstr "який створює адресу::"
1326
1327 #: ../../../__w/calibre/calibre/manual/template_lang.rst:681
1328 msgid ""
1329 "Open the notes associated with an author/series/etc. The syntax of the URL "
1330 "is::"
1331 msgstr "Відкрити нотатки, які пов'язано із автором, циклом тощо. Синтаксис адреси::"
1332
1333 #: ../../../__w/calibre/calibre/manual/template_lang.rst:686
1334 msgid ""
1335 "``Field_Name`` is the lookup name of the field. If the field is a custom "
1336 "column then replace the ``#`` character with an underscore (``_``). "
1337 "``Item_Id`` is the internal numeric ID of the value in the field. There "
1338 "isn't a template function that returns the ``Item_Id``, so templates will "
1339 "normally use the second form, ``Hex_Encoded_Item_Name``. Here is a sample "
1340 "template that opens the note for the person ``Boy-Żeleński, Tadeusz`` in the"
1341 " field ``#authtest``::"
1342 msgstr "``Field_Name`` — це пошукова назва поля. Якщо поле є нетиповим стовпчиком, замініть символ ``#`` на підкреслення (``_``). ``Item_Id`` – це внутрішній числовий ідентифікатор значення у полі. Немає шаблонної функції, яка повертає ``Item_Id``, тому шаблони зазвичай використовують другу форму, ``Hex_Encoded_Item_Name``. Ось зразок шаблону, який відкриває нотатку для особи ``Boy-Żeleński, Tadeusz`` у полі ``#authtest``::"
1343
1344 #: ../../../__w/calibre/calibre/manual/template_lang.rst:700
1345 msgid "Stored templates"
1346 msgstr "Збережені шаблони"
1347
1348 #: ../../../__w/calibre/calibre/manual/template_lang.rst:702
1349 msgid ""
1350 "Both :ref:`General Program Mode <general_mode>` and :ref:`Python Template "
1351 "Mode <python_mode>` support saving templates and calling those templates "
1352 "from another template, much like calling stored functions. You save "
1353 "templates using :guilabel:`Preferences->Advanced->Template functions`. More "
1354 "information is provided in that dialog. You call a template the same way you"
1355 " call a function, passing positional arguments if desired. An argument can "
1356 "be any expression. Examples of calling a template, assuming the stored "
1357 "template is named ``foo``:"
1358 msgstr "У :ref:`загальному режимі програмування <general_mode>` і :ref:`режимі шаблонів Python<python_mode> передбачено можливість збереження шаблонів загального режиму програмування та виклику цих шаблонів з інших шаблонів, подібно до виклику збережених функцій. Зберегти шаблони можна за допомогою пункту :guilabel:`Налаштування->Додатково->Шаблонні функції`. у відповідному діалоговому вікні буде наведено довідкову інформації. Викликати шаблон можна у той самий спосіб, що і функцію, передавши йому, якщо потрібно, позиційні аргументи. Аргументом може бути будь-який вираз. Приклади виклику шаблону, де ми припускаємо, що збережений шаблон має назву ``foo``:"
1359
1360 #: ../../../__w/calibre/calibre/manual/template_lang.rst:704
1361 msgid "``foo()`` -- call the template passing no arguments."
1362 msgstr "``foo()`` — виклик шаблону без передавання аргументів."
1363
1364 #: ../../../__w/calibre/calibre/manual/template_lang.rst:705
1365 msgid ""
1366 "``foo(a, b)`` call the template passing the values of the two variables "
1367 "``a`` and ``b``."
1368 msgstr "``foo(a, b)`` — виклик шаблону з передаванням значень двох змінних — ``a`` і ``b``."
1369
1370 #: ../../../__w/calibre/calibre/manual/template_lang.rst:706
1371 msgid ""
1372 "``foo(if field('series') then field('series_index') else 0 fi)`` -- if the "
1373 "book has a ``series`` then pass the ``series_index``, otherwise pass the "
1374 "value ``0``."
1375 msgstr "``foo(if field('series') then field('series_index') else 0 fi)`` — якщо книга належить до циклу, передати номер книги у циклі, інакше — передати значення ``0``."
1376
1377 #: ../../../__w/calibre/calibre/manual/template_lang.rst:708
1378 msgid ""
1379 "In GPM you retrieve the arguments passed in the call to the stored template "
1380 "using the ``arguments`` function. It both declares and initializes local "
1381 "variables, effectively parameters. The variables are positional; they get "
1382 "the value of the parameter given in the call in the same position. If the "
1383 "corresponding parameter is not provided in the call then ``arguments`` "
1384 "assigns that variable the provided default value. If there is no default "
1385 "value then the variable is set to the empty string. For example, the "
1386 "following ``arguments`` function declares 2 variables, ``key``, "
1387 "``alternate``::"
1388 msgstr "Отримання аргументів відбувається за допомогою виклику збереженого шаблона за допомогою функції ``arguments``. Ця функція одразу оголошує і ініціалізує локальні змінні, які виконують роль параметрів. Ці змінні є позиційними — їм надається значення, яке стоїть у виклику на відповідній позиції. Якщо відповідне значення змінної не було надано у виклику, ``arguments`` надає параметру типового значення. Якщо типове значення не вказано, змінній буде надано значення порожнього рядка. Наприклад, наведена нижче функція ``arguments`` оголошує 2 змінні — ``key``, ``alternate``::"
1389
1390 #: ../../../__w/calibre/calibre/manual/template_lang.rst:712
1391 msgid "Examples, again assuming the stored template is named ``foo``:"
1392 msgstr "У наведених нижче прикладах знову припускаємо, що збережений шаблон має назву ``foo``:"
1393
1394 #: ../../../__w/calibre/calibre/manual/template_lang.rst:714
1395 msgid ""
1396 "``foo('#myseries')`` -- argument ``key`` is assigned the value "
1397 "``'myseries'`` and the argument ``alternate`` is assigned the default value "
1398 "``'series'``."
1399 msgstr "``foo('#myseries')`` — аргумент ``key`` матиме значення ``'myseries'``, а аргумент ``alternate`` матиме типове значення ``'series'``."
1400
1401 #: ../../../__w/calibre/calibre/manual/template_lang.rst:715
1402 msgid ""
1403 "``foo('series', '#genre')`` the variable ``key`` is assigned the value "
1404 "``'series'`` and the variable ``alternate`` is assigned the value "
1405 "``'#genre'``."
1406 msgstr "``foo('series', '#genre')`` — змінній ``key`` буде надано значення ``'series'``, а змінній ``alternate`` — значення ``'#genre'``."
1407
1408 #: ../../../__w/calibre/calibre/manual/template_lang.rst:716
1409 msgid ""
1410 "``foo()`` -- the variable ``key`` is assigned the empty string and the "
1411 "variable ``alternate`` is assigned the value ``'series'``."
1412 msgstr "``foo()`` -— змінній ``key`` буде надано значення порожнього рядка, а змінній ``alternate`` — значення ``'series'``."
1413
1414 #: ../../../__w/calibre/calibre/manual/template_lang.rst:718
1415 msgid ""
1416 "In PTM the arguments are passed in the ``arguments`` parameter, which is a "
1417 "list of strings. There isn't any way to specify default values. You must "
1418 "check the length of the ``arguments`` list to be sure that the number of "
1419 "arguments is what you expect."
1420 msgstr "У PTM аргументи буде передано у формі параметра ``arguments``, який є списком рядків. Не існує способу вказати типові значення. Вам слід перевірити довжину списку ``arguments``, щоб переконатися, що кількість аргументів є тією, на яку ви сподіваєтеся."
1421
1422 #: ../../../__w/calibre/calibre/manual/template_lang.rst:720
1423 msgid ""
1424 "An easy way to test stored templates is using the ``Template tester`` "
1425 "dialog. For ease of access give it a keyboard shortcut in "
1426 ":guilabel:`Preferences->Advanced->Keyboard shortcuts->Template tester`. "
1427 "Giving the ``Stored templates`` dialog a shortcut will help switching more "
1428 "rapidly between the tester and editing the stored template's source code."
1429 msgstr "Простим способом тестування збережених шаблонів є використання вікна ``Засіб тестування шаблонів``. Для полегшення доступу надайте цьому вікну клавіатурного скорочення за допомогою пункту :guilabel:`Налаштування->Додатково->Клавіатурні скорочення->Засіб тестування шаблонів`. Надання клавіатурного скорочення вікну ``Збережені шаблони`` допоможе вам швидше перемикатися між тестуванням та редагування початкового коду збереженого шаблону."
1430
1431 #: ../../../__w/calibre/calibre/manual/template_lang.rst:723
1432 msgid "Providing additional information to templates"
1433 msgstr "Надання додаткової інформації шаблонам"
1434
1435 #: ../../../__w/calibre/calibre/manual/template_lang.rst:725
1436 msgid ""
1437 "A developer can choose to pass additional information to the template "
1438 "processor, such as application-specific book metadata or information about "
1439 "what the processor is being asked to do. A template can access this "
1440 "information and use it during the evaluation."
1441 msgstr "Розробник може передати додаткові відомості обробнику шаблонів, зокрема, специфічні для книги метадані або відомості про те, що слід виконати обробнику. Шаблон може отримувати доступ до цих відомостей і використовувати їх під час обробки."
1442
1443 #: ../../../__w/calibre/calibre/manual/template_lang.rst:727
1444 msgid "**Developer: how to pass additional information**"
1445 msgstr "**Розробник: як передати додаткові відомості**"
1446
1447 #: ../../../__w/calibre/calibre/manual/template_lang.rst:729
1448 msgid ""
1449 "The additional information is a Python dictionary containing pairs "
1450 "``variable_name: variable_value`` where the values must be strings. The "
1451 "template can access the dictionary, creating template local variables named "
1452 "``variable_name`` containing the value ``variable_value``. The user cannot "
1453 "change the name so it is best to use names that won't collide with other "
1454 "template local variables, for example by prefixing the name with an "
1455 "underscore."
1456 msgstr "Додатковими відомостями є словник Python, який містить пари ``назва_змінної: значення_змінної``, де значеннями мають бути рядки. Шаблон може отримувати доступ до словника, створюючи локальні змінні із назвами ``назва_змінної``, які міститимуть значення ``значення_змінної``. Користувач не може змінювати назву, тому краще користуватися назвами, які не збігатимуться із локальними змінними інших шаблонів. Можна, наприклад, додати до усіх назв початковий символ підкреслювання."
1457
1458 #: ../../../__w/calibre/calibre/manual/template_lang.rst:731
1459 msgid ""
1460 "This dictionary is passed to the template processor (the ``formatter``) "
1461 "using the named parameter ``global_vars=your_dict``. The full method "
1462 "signature is::"
1463 msgstr "Цей словник буде передано обробнику шаблонів (``форматувальнику``) за допомогою іменованого параметра ``global_vars=ваш_словник``. Ось повний запис методу::"
1464
1465 #: ../../../__w/calibre/calibre/manual/template_lang.rst:739
1466 msgid "**Template writer: how to access the additional information**"
1467 msgstr "**Розробник шаблонів: як отримати доступ до додаткових відомостей**"
1468
1469 #: ../../../__w/calibre/calibre/manual/template_lang.rst:741
1470 msgid ""
1471 "You access the additional information (the ``globals`` dictionary) in a "
1472 "template using the template function::"
1473 msgstr "Отримати доступ до додаткових відомостей (словника ``globals``) у шаблоні можна за допомогою шаблонної функції::"
1474
1475 #: ../../../__w/calibre/calibre/manual/template_lang.rst:745
1476 msgid ""
1477 "where ``id`` is any legal variable name. This function checks whether the "
1478 "additional information provided by the developer contains the name. If it "
1479 "does then the function assigns the provided value to a template local "
1480 "variable with that name. If the name is not in the additional information "
1481 "and if an ``expression`` is provided, the ``expression`` is evaluated and "
1482 "the result is assigned to the local variable. If neither a value nor an "
1483 "expression is provided, the function assigns the empty string (``''``) to "
1484 "the local variable."
1485 msgstr "де записом ``ідентифікатор`` є будь-яка коректна назва змінної. Ця функція перевіряє, чи у додаткових відомостях, наданих розробником, міститься відповідна назва. Якщо це так, функція призначає надане значення змінної локальній змінній із вказаною назвою. Якщо назву змінної не буде виявлено у додаткових відомостях і якщо вказано ``вираз``, буде виконано обчислення ``виразу`` із призначенням результату локальній змінній. Якщо не буде знайдено ні значення, ні виразу, локальній змінній буде призначено порожній рядок (``''``)."
1486
1487 #: ../../../__w/calibre/calibre/manual/template_lang.rst:747
1488 msgid ""
1489 "A template can set a value in the ``globals`` dictionary using the template "
1490 "function::"
1491 msgstr "Шаблон може встановлювати значення у словнику ``globals`` за допомогою шаблонної функції::"
1492
1493 #: ../../../__w/calibre/calibre/manual/template_lang.rst:751
1494 msgid ""
1495 "This function sets the ``globals`` dictionary key:value pair ``id:value`` "
1496 "where ``value`` is the value of the template local variable ``id``. If that "
1497 "local variable doesn't exist then ``value`` is set to the result of "
1498 "evaluating ``expression``."
1499 msgstr "Ця функція встановлює значення пари словника ``globals`` ключ:значення ``ідентифікатор:значення``, де ``значенням`` є значення локальної змінної шаблона ``ідентифікатор``. Якщо такої локальної змінної не існує, ``значення`` буде встановлено для результату обчислення ``виразу``."
1500
1501 #: ../../../__w/calibre/calibre/manual/template_lang.rst:754
1502 msgid "Notes on the difference between modes"
1503 msgstr "Зауваження щодо відмінностей між режимами"
1504
1505 #: ../../../__w/calibre/calibre/manual/template_lang.rst:756
1506 msgid ""
1507 "The three program modes, :ref:`Single Function Mode <single_mode>` (SFM), "
1508 ":ref:`Template Program Mode <template_mode>` (`TPM`), and :ref:`General "
1509 "Program Mode <general_mode>` (`GPM`), work differently. SFM is intended to "
1510 "be 'simple' so it hides a lot of programming language bits."
1511 msgstr "У роботі трьох режимів програмування, :ref:`режиму єдиної функції <single_mode>`, :ref:`режиму програмування шаблонів <template_mode>` та :ref:`загального режиму програмування <general_mode>` є відмінності. Режим єдиної функції є «простим», тому у ньому багато можливостей програмування «приховано»."
1512
1513 #: ../../../__w/calibre/calibre/manual/template_lang.rst:758
1514 msgid "Differences:"
1515 msgstr "Відмінності:"
1516
1517 #: ../../../__w/calibre/calibre/manual/template_lang.rst:760
1518 msgid ""
1519 "In SFM the value of the column is always passed as an 'invisible' first "
1520 "argument to a function included in the template."
1521 msgstr "У режимі єдиної функції значення стовпчика завжди передається як «невидимий» перший аргумент функції, включено до шаблона."
1522
1523 #: ../../../__w/calibre/calibre/manual/template_lang.rst:761
1524 msgid ""
1525 "SFM doesn't support the difference between variables and strings; all values"
1526 " are strings."
1527 msgstr "У режимі єдиної функції не передбачено підтримки розрізнення між змінними і рядками; усі значення є рядками."
1528
1529 #: ../../../__w/calibre/calibre/manual/template_lang.rst:762
1530 msgid ""
1531 "The following SFM template returns either the series name or the string \"no"
1532 " series\"::"
1533 msgstr "У наведеному нижче шаблоні режиму єдиної функції шаблон повертає або назву циклу, або рядок «no series»::"
1534
1535 #: ../../../__w/calibre/calibre/manual/template_lang.rst:766
1536 msgid "The equivalent template in `TPM` is ::"
1537 msgstr "Еквівалентний шаблон у режимі програмування шаблонів::"
1538
1539 #: ../../../__w/calibre/calibre/manual/template_lang.rst:770
1540 msgid "The equivalent template in `GPM` is::"
1541 msgstr "Еквівалентний шаблон у `режимі загального програмування`::"
1542
1543 #: ../../../__w/calibre/calibre/manual/template_lang.rst:774
1544 msgid ""
1545 "The first argument to ``ifempty`` is the value of the field ``series``. The "
1546 "second argument is the string ``no series``. In SFM the first argument, the "
1547 "value of the field, is automatically passed (the invisible argument)."
1548 msgstr "Першим аргументом ``ifempty`` є значення поля ``series``, а другим аргументом — рядок ``no series``. У режимі єдиної функції перший аргумент, значення поля, передається автоматично (невидимий аргумент)."
1549
1550 #: ../../../__w/calibre/calibre/manual/template_lang.rst:775
1551 msgid ""
1552 "Several template functions, for example ``booksize()`` and "
1553 "``current_library_name()``, take no arguments. Because of the 'invisible "
1554 "argument' you cannot use these functions in SFM."
1555 msgstr "Декілька шаблонних функцій, зокрема ``booksize()`` і ``current_library_name()``, не приймають аргументів. Через наявність невидимого аргументу ви не зможете скористатися цими функціями у режимі єдиної функції."
1556
1557 #: ../../../__w/calibre/calibre/manual/template_lang.rst:776
1558 msgid ""
1559 "Nested functions, where a function calls another function to compute an "
1560 "argument, cannot be used in SFM. For example this template, intended to "
1561 "return the first 5 characters of the series value uppercased, won't work in "
1562 "SFM::"
1563 msgstr "У режимі єдиної функції не можна скористатися вкладеними функціями, коли одна з функцій викликає іншу функцію для обчислення свого аргументу. Наприклад, цей шаблон, який призначено для отримання перших 5 літер значення назви циклу у верхньому регістрі, не працюватиме у режимі єдиної функції::"
1564
1565 #: ../../../__w/calibre/calibre/manual/template_lang.rst:780
1566 msgid ""
1567 "`TPM` and `GPM` support nested functions. The above template in `TPM` would "
1568 "be::"
1569 msgstr "У шаблонному режимі програмування та загальному режимі програмування передбачено підтримку вкладених функцій. Наведений вище шаблон у шаблонному режимі програмування можна записати так::"
1570
1571 #: ../../../__w/calibre/calibre/manual/template_lang.rst:784
1572 msgid "In `GPM` it would be::"
1573 msgstr "У `загальному режимі програмування` це було б::"
1574
1575 #: ../../../__w/calibre/calibre/manual/template_lang.rst:788
1576 msgid ""
1577 "As noted in the above :ref:`Template Program Mode <template_mode>` section, "
1578 "using ``{`` and ``}`` characters in `TPM` string literals can lead to errors"
1579 " or unexpected results because they confuse the template processor. It tries"
1580 " to treat them as template boundaries, not characters. In some but not all "
1581 "cases you can replace a ``{`` with ``[[`` and a ``}`` with `]]`. Generally, "
1582 "if your program contains ``{`` and ``}`` characters then you should use "
1583 "`General Program Mode`."
1584 msgstr "Як було зауважено вище у розділі :ref:`Режим програмування шаблонів <template_mode>`, використання символів ``{`` і ``}`` у рядкових літералах режиму програмування шаблонів може призвести до помилок або неочікуваних результатів, оскільки ці символи заважають нормальній роботі обробника шаблонів. Він намагається обробити їх як межі шаблона, а не символи. У деяких, але не в усіх випадках, ви можете замінити ``{`` на ``[[`` і ``}`` на `]]`. Загалом кажучи, якщо у вашій програмі є символи ``{`` і ``}``, вам слід користуватися `загальним режимом програмування`."
1585
1586 #: ../../../__w/calibre/calibre/manual/template_lang.rst:792
1587 msgid "User-defined Python template functions"
1588 msgstr "Визначені користувачем шаблонні функції Python"
1589
1590 #: ../../../__w/calibre/calibre/manual/template_lang.rst:794
1591 msgid ""
1592 "You can add your own Python functions to the template processor. Such "
1593 "functions can be used in any of the three template programming modes. The "
1594 "functions are added by going to :guilabel:`Preferences -> Advanced -> "
1595 "Template functions`. Instructions are shown in that dialog. Note that you "
1596 "can use `Python Templates` for a similar purpose. As calling user-defined "
1597 "functions is faster than calling a Python template, user-defined functions "
1598 "might be more efficient depending on the complexity of what the function or "
1599 "template does."
1600 msgstr "Ви можете додавати власні функції мовою Python до обробника шаблонів. Такими функціями можна скористатися в усіх трьох режимах програмування шаблонів. Додати функції можна за допомогою сторінки :guilabel:`Налаштування -> Додатково -> Шаблонні функції`. У діалоговому вікні, яке буде відкрито програмою, можна знайти відповідні настанови. Зауважте, що для досягнення тієї самої мети ви можете скористатися `Шаблонами Python`. Оскільки виклик визначених користувачем функцій є швидшим за виклик шаблона Python, визначені користувачем функції можуть бути ефективнішими, залежно від складності функції чи шаблона."
1601
1602 #: ../../../__w/calibre/calibre/manual/template_lang.rst:797
1603 msgid "Special notes for using templates in different contexts"
1604 msgstr "Особливі нотатки щодо використання шаблонів у різних контекстах"
1605
1606 #: ../../../__w/calibre/calibre/manual/template_lang.rst:799
1607 msgid ""
1608 "In the GUI (:guilabel:`Columns made from other columns` and "
1609 ":guilabel:`Template searches`):"
1610 msgstr "У графічному інтерфейсі (:guilabel:`Стовпчики на основі інших стовпчиків` і :guilabel:`Шаблонні пошуки`):"
1611
1612 #: ../../../__w/calibre/calibre/manual/template_lang.rst:801
1613 msgid "GPM templates work as before."
1614 msgstr "Шаблони GPM працюють так, як і у попередніх версіях."
1615
1616 #: ../../../__w/calibre/calibre/manual/template_lang.rst:802
1617 msgid "Python templates have full access to the calibre database."
1618 msgstr "Шаблони Python мають повний доступ до бази даних calibre."
1619
1620 #: ../../../__w/calibre/calibre/manual/template_lang.rst:804
1621 msgid "In icon rules:"
1622 msgstr "У правилах піктограм:"
1623
1624 #: ../../../__w/calibre/calibre/manual/template_lang.rst:806
1625 msgid ""
1626 "icon rule templates have no book data so field-based functions such as "
1627 ":ref:`ff_format_date_field`, :ref:`ff_list_count_field`, and "
1628 ":ref:`ff_check_yes_no` won't work."
1629 msgstr "шаблони правил піктограм не мають доступу до даних книги, а засновані на полях функції, зокрема :ref:`ff_format_date_field`, :ref:`ff_list_count_field` і :ref:`ff_check_yes_no` не працюватимуть."
1630
1631 #: ../../../__w/calibre/calibre/manual/template_lang.rst:808
1632 msgid "In the Content server:"
1633 msgstr "У сервері даних:"
1634
1635 #: ../../../__w/calibre/calibre/manual/template_lang.rst:810
1636 msgid ""
1637 "Templates have access to the new API but not the old API (LibraryDatabase)."
1638 msgstr "Шаблони мають доступ до нового програмного інтерфейсу, але не до старого (LibraryDatabase)."
1639
1640 #: ../../../__w/calibre/calibre/manual/template_lang.rst:811
1641 msgid ""
1642 "Because of the above, the following formatter functions are not guaranteed "
1643 "to work in GPM templates (composite columns, icon rules, etc) and should be "
1644 "avoided if you use the content server:"
1645 msgstr "Через наведене вище, не можемо гарантувати працездатності вказаних нижче функцій у шаблонах GPM (складені стовпчики, правила піктограм тощо); не варто використовувати ці функції, якщо ви користуєтеся сервером даних:"
1646
1647 #: ../../../__w/calibre/calibre/manual/template_lang.rst:813
1648 msgid ":ref:`ff_connected_device_name`"
1649 msgstr ":ref:`ff_connected_device_name`"
1650
1651 #: ../../../__w/calibre/calibre/manual/template_lang.rst:814
1652 msgid ":ref:`ff_connected_device_uuid`"
1653 msgstr ":ref:`ff_connected_device_uuid`"
1654
1655 #: ../../../__w/calibre/calibre/manual/template_lang.rst:815
1656 msgid ":ref:`ff_current_virtual_library_name`"
1657 msgstr ":ref:`ff_current_virtual_library_name`"
1658
1659 #: ../../../__w/calibre/calibre/manual/template_lang.rst:816
1660 msgid ":ref:`ff_is_marked`"
1661 msgstr ":ref:`ff_is_marked`"
1662
1663 #: ../../../__w/calibre/calibre/manual/template_lang.rst:817
1664 msgid ":ref:`ff_virtual_libraries`"
1665 msgstr ":ref:`ff_virtual_libraries`"
1666
1667 #: ../../../__w/calibre/calibre/manual/template_lang.rst:820
1668 msgid "Special notes for save/send templates"
1669 msgstr "Спеціальні нотатки щодо шаблонів збереження або надсилання"
1670
1671 #: ../../../__w/calibre/calibre/manual/template_lang.rst:822
1672 msgid ""
1673 "Special processing is applied when a template is used in a :guilabel:`Save "
1674 "to disk` or :guilabel:`Send to device` template. The values of the fields "
1675 "are cleaned, replacing characters that are special to file systems with "
1676 "underscores, including slashes. This means that field text cannot be used to"
1677 " create folders. However, slashes are not changed in prefix or suffix "
1678 "strings, so slashes in these strings will cause folders to be created. "
1679 "Because of this, you can create variable-depth folder structure."
1680 msgstr "До шаблонів, які використовуються для дій :guilabel:`Зберегти на диск` і :guilabel:`Надіслати на пристрій`, застосовується спеціальна обробка. Значення полів буде очищено із заміною символів, які мають спеціальне значення у файлових системах, зокрема символів похилих рисок, на символи підкреслювання. Це означає, що текст поля не можна використовувати для створення тек. Втім, похилі риски не замінюватимуться у рядках префікса і суфікса, отже похилі риски у цих рядках можна використати для створення тек. Таким чином, ви можете створити структуру тек довільного рівня вкладеності."
1681
1682 #: ../../../__w/calibre/calibre/manual/template_lang.rst:824
1683 msgid ""
1684 "For example, assume we want the folder structure `series/series_index - "
1685 "title`, with the caveat that if series does not exist, then the title should"
1686 " be in the top folder. The template to do this is::"
1687 msgstr "Наприклад, припустімо ми хочемо створити структуру тек `цикл/номер_у_циклі - назва`, із умовою, що якщо циклу не існує, назву слід розташувати у верхній теці. Шаблон для виконання цього завдання::"
1688
1689 #: ../../../__w/calibre/calibre/manual/template_lang.rst:828
1690 msgid "The slash and the hyphen appear only if series is not empty."
1691 msgstr "Похила риска і дефіс мають з'являтися, лише якщо цикл не є порожнім."
1692
1693 #: ../../../__w/calibre/calibre/manual/template_lang.rst:830
1694 msgid ""
1695 "The lookup function lets us do even fancier processing. For example, assume "
1696 "that if a book has a series, then we want the folder structure "
1697 "`series/series index - title.fmt`. If the book does not have a series then "
1698 "we want the folder structure `genre/author_sort/title.fmt`. If the book has "
1699 "no genre then we want to use 'Unknown'. We want two completely different "
1700 "paths, depending on the value of series."
1701 msgstr "Функція `lookup` надає вам змогу виконувати виконувати навіть ще вишуканішу обробку. Наприклад, припустімо, що якщо книга належить до циклу, ми хочемо мати структуру тек `цикл/номер у циклі - назва.формат`. Якщо книга не належить до циклу, нам потрібна структура тек `жанр/упорядковане ім’я автора/назва.формат`. Якщо ж книга не належить до певного жанру, слід скористатися текою 'Unknown'. Нам потрібно два повністю різних шляхи, залежно від значення параметра циклу."
1702
1703 #: ../../../__w/calibre/calibre/manual/template_lang.rst:832
1704 msgid "To accomplish this, we:"
1705 msgstr "Для виконання цього завдання ми:"
1706
1707 #: ../../../__w/calibre/calibre/manual/template_lang.rst:834
1708 msgid ""
1709 "Create a composite field (give it lookup name #aa) containing "
1710 "``{series}/{series_index} - {title}``. If the series is not empty, then this"
1711 " template will produce `series/series_index - title`."
1712 msgstr "Створимо складене поле (надавши йому назву #aa), що міститиме дані ``{series}/{series_index} - {title}``. Якщо значення циклу (series) є непорожнім, такий шаблон дасть нам `цикл/номер_у_циклі - назва`."
1713
1714 #: ../../../__w/calibre/calibre/manual/template_lang.rst:835
1715 msgid ""
1716 "Create a composite field (give it lookup name #bb) containing "
1717 "``{#genre:ifempty(Unknown)}/{author_sort}/{title}``. This template produces "
1718 "`genre/author_sort/title`, where an empty genre is replaced with `Unknown`."
1719 msgstr "Створимо складене поле (надавши йому назву #bb) із вмістом ``{#genre:ifempty(Unknown)}/{author_sort}/{title}``. Цей шаблон дає `жанр/упорядковані_автори/назва`. Якщо немає даних щодо жанру, запис жанру буде замінено на `Unknown`."
1720
1721 #: ../../../__w/calibre/calibre/manual/template_lang.rst:836
1722 msgid ""
1723 "Set the save template to ``{series:lookup(.,#aa,#bb)}``. This template "
1724 "chooses composite field ``#aa`` if series is not empty and composite field "
1725 "``#bb`` if series is empty. We therefore have two completely different save "
1726 "paths, depending on whether or not `series` is empty."
1727 msgstr "Встановимо шаблон збереження ``{series:lookup(.,#aa,#bb)}``. Цей шаблон вибирає складене поле ``#aa``, якщо значення запису циклу є непорожнім, і складене поле ``#bb``, якщо значення запису циклу є порожнім. Таким чином, ми матимемо повністю різні шляхи для збереження книг, залежно від того, чи є запис `series` порожнім."
1728
1729 #: ../../../__w/calibre/calibre/manual/template_lang.rst:839
1730 msgid "Tips"
1731 msgstr "Підказки"
1732
1733 #: ../../../__w/calibre/calibre/manual/template_lang.rst:841
1734 msgid ""
1735 "Use the Template Tester to test templates. Add the tester to the context "
1736 "menu for books in the library and/or give it a keyboard shortcut."
1737 msgstr "Для перевірки шаблонів скористайтеся засобом перевірки шаблонів. Додайте пункт засобу до контекстного меню для книг у бібліотеці і/або встановіть для нього клавіатурне скорочення."
1738
1739 #: ../../../__w/calibre/calibre/manual/template_lang.rst:842
1740 msgid ""
1741 "Templates can use other templates by referencing composite columns built "
1742 "with the desired template. Alternatively, you can use Stored Templates."
1743 msgstr "У шаблонах можна використовувати інші шаблони шляхом посилання на складені стовпчики, які побудовано за допомогою бажаних шаблонів. Крім того, ви можете скористатися «Збереженими шаблонами»."
1744
1745 #: ../../../__w/calibre/calibre/manual/template_lang.rst:843
1746 msgid ""
1747 "In a plugboard, you can set a field to empty (or whatever is equivalent to "
1748 "empty) by using the special template ``{}``. This template will always "
1749 "evaluate to an empty string."
1750 msgstr "У наборі метаданих ви можете вказати порожні значення поля (або вказати будь-який еквівалент порожнього поля) за допомогою спеціального шаблона ``{}``. Цей шаблон завжди обробляється як порожній рядок."
1751
1752 #: ../../../__w/calibre/calibre/manual/template_lang.rst:844
1753 msgid ""
1754 "The technique described above to show numbers even if they have a zero value"
1755 " works with the standard field series_index."
1756 msgstr "Описана вище методика для показу чисел працює зі стандартним полем series_index, навіть якщо вміст відповідного поля є порожнім."
1757
1758 #: ../../../__w/calibre/calibre/manual/template_lang.rst:849
1759 msgid "Template function reference"
1760 msgstr "Посилання на функцію шаблона"