| 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]>, 2016-2017,2020-2021,2023-2024,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-11-21 02:54+0000\n" |
| 13 |
"Last-Translator: Yuri Chornoivan <[email protected]>, 2016-2017,2020-2021,2023-2024,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/function_mode.rst:2 |
| 22 |
msgid "Function mode for Search & replace in the Editor" |
| 23 |
msgstr "Функціональний режим для пошуку і заміни у редакторі" |
| 24 |
|
| 25 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:4 |
| 26 |
msgid "" |
| 27 |
"The :guilabel:`Search & replace` tool in the editor supports a *function " |
| 28 |
"mode*. In this mode, you can combine regular expressions (see :doc:`regexp`)" |
| 29 |
" with arbitrarily powerful Python functions to do all sorts of advanced text" |
| 30 |
" processing." |
| 31 |
msgstr "У інструменті пошуку із заміною редактора передбачено підтримку *функціонального режиму*. У цьому режимі ви можете поєднувати формальні вирази (див. :doc:`regexp`) із довільними потужними функціями Python для виконання усіх типів розширеної обробки тексту." |
| 32 |
|
| 33 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:9 |
| 34 |
msgid "" |
| 35 |
"In the standard *regexp* mode for search and replace, you specify both a " |
| 36 |
"regular expression to search for as well as a template that is used to " |
| 37 |
"replace all found matches. In function mode, instead of using a fixed " |
| 38 |
"template, you specify an arbitrary function, in the `Python programming " |
| 39 |
"language <https://docs.python.org>`_. This allows you to do lots of things " |
| 40 |
"that are not possible with simple templates." |
| 41 |
msgstr "У стандартному режимі *формальних виразів* для пошуку з заміною ви вказуєте формальний вираз для пошуку і шаблон, який буде використано для заміни усіх відповідників. У функціональному режимі, замість використання фіксованого шаблона, ви вказуєте довільну функцію, яку написано `мовою програмування Python <https://docs.python.org>`_. Це надає вам змогу виконувати багато завдань, які неможливо виконати за допомогою простих шаблонів." |
| 42 |
|
| 43 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:16 |
| 44 |
msgid "" |
| 45 |
"Techniques for using function mode and the syntax will be described by means" |
| 46 |
" of examples, showing you how to create functions to perform progressively " |
| 47 |
"more complex tasks." |
| 48 |
msgstr "Методики використання функціонального режиму та синтаксис буде описано у форматі прикладів, які продемонструють вам, як створити функції, які виконуватимуть усе більш складні завдання." |
| 49 |
|
| 50 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:21 |
| 51 |
msgid "The Function mode" |
| 52 |
msgstr "Режим функцій" |
| 53 |
|
| 54 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:26 |
| 55 |
msgid "Automatically fixing the case of headings in the document" |
| 56 |
msgstr "Автоматичне виправлення регістру літер у заголовках документа" |
| 57 |
|
| 58 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:28 |
| 59 |
msgid "" |
| 60 |
"Here, we will leverage one of the builtin functions in the editor to " |
| 61 |
"automatically change the case of all text inside heading tags to title " |
| 62 |
"case::" |
| 63 |
msgstr "Тут ми підсилимо одну із вбудованих функцій редактора, реалізувавши автоматичну заміну регістру символів усього тексту у теґах заголовків на регістр заголовків::" |
| 64 |
|
| 65 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:33 |
| 66 |
msgid "" |
| 67 |
"For the function, simply choose the :guilabel:`Title-case text (ignore " |
| 68 |
"tags)` builtin function. This will change titles that look like: ``<h1>some " |
| 69 |
"titLE</h1>`` to ``<h1>Some Title</h1>``. It will work even if there are " |
| 70 |
"other HTML tags inside the heading tags." |
| 71 |
msgstr "Для цієї функції просто виберіть вбудовану функцію :guilabel:`Title-case text (ignore tags)`. Ця функція змінює заголовки ось так: з ``<h1>якийсь заГОЛОВОК</h1>`` виходить ``<h1>Якийсь Заголовок</h1>``. Вона працюватиме, навіть якщо у теґах заголовка місяться інші теґи HTML." |
| 72 |
|
| 73 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:40 |
| 74 |
msgid "Your first custom function - smartening hyphens" |
| 75 |
msgstr "Ваша перша нетипова функція — кмітливе розставляння дефісів" |
| 76 |
|
| 77 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:42 |
| 78 |
msgid "" |
| 79 |
"The real power of function mode comes from being able to create your own " |
| 80 |
"functions to process text in arbitrary ways. The Smarten Punctuation tool in" |
| 81 |
" the editor leaves individual hyphens alone, so you can use this function to" |
| 82 |
" replace them with em-dashes." |
| 83 |
msgstr "Справжня потужність функціонального режиму полягає у можливості створення власних функцій для довільної обробки тексту. Інструмент кмітливої пунктуації у редакторі не чіпає окремих дефісів, отже ви можете скористатися цією функцією для заміни їх на тире." |
| 84 |
|
| 85 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:47 |
| 86 |
msgid "" |
| 87 |
"To create a new function, simply click the :guilabel:`Create/edit` button to" |
| 88 |
" create a new function and copy the Python code from below." |
| 89 |
msgstr "Щоб створити нову функцію, просто натисніть кнопку :guilabel:`Створити/Редагувати` для створення нової функції і скопіюйте код Python, наведений нижче." |
| 90 |
|
| 91 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:55 |
| 92 |
msgid "" |
| 93 |
"Every :guilabel:`Search & replace` custom function must have a unique name " |
| 94 |
"and consist of a Python function named replace, that accepts all the " |
| 95 |
"arguments shown above. For the moment, we won't worry about all the " |
| 96 |
"different arguments to ``replace()`` function. Just focus on the ``match`` " |
| 97 |
"argument. It represents a match when running a search and replace. Its full " |
| 98 |
"documentation in available `here " |
| 99 |
"<https://docs.python.org/library/re.html#match-objects>`_. ``match.group()``" |
| 100 |
" simply returns all the matched text and all we do is replace hyphens in " |
| 101 |
"that text with em-dashes, first replacing double hyphens and then single " |
| 102 |
"hyphens." |
| 103 |
msgstr "Кожна нетипова функція пошуку з заміною повинна мати неповторну назву і складатися з функції python із назвою replace, яка приймає усі аргументи, вказані вище. Для початку, пропустимо усі різні аргументи функції ``replace()``. Зосередимо нашу увагу на аргументі ``match``. Він представляє відповідник рядка пошуку під час пошуку з заміною. Повну документацію щодо нього можна знайти `тут <https://docs.python.org/library/re.html#match-objects>`_. ``match.group()`` просто повертає увесь відповідний текст, і усе, що нам лишається зробити, це замінити дефіси у цьому тексті на тире. Спочатку замінюємо подвійні дефіси, а потім одинарні." |
| 104 |
|
| 105 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:65 |
| 106 |
msgid "Use this function with the find regular expression::" |
| 107 |
msgstr "Скористайтеся цією функцією у формальному виразі пошуку:" |
| 108 |
|
| 109 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:69 |
| 110 |
msgid "" |
| 111 |
"And it will replace all hyphens with em-dashes, but only in actual text and " |
| 112 |
"not inside HTML tag definitions." |
| 113 |
msgstr "І вона замінити усі дефіси на тире, але лише у справжньому тексті, а не у визначеннях теґів HTML." |
| 114 |
|
| 115 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:74 |
| 116 |
msgid "" |
| 117 |
"The power of function mode - using a spelling dictionary to fix mis-" |
| 118 |
"hyphenated words" |
| 119 |
msgstr "Потужність режиму функцій — використання словника для перевірки правопису для виправлення слів із помилковими дефісами" |
| 120 |
|
| 121 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:76 |
| 122 |
msgid "" |
| 123 |
"Often, e-books created from scans of printed books contain mis-hyphenated " |
| 124 |
"words -- words that were split at the end of the line on the printed page. " |
| 125 |
"We will write a simple function to automatically find and fix such words." |
| 126 |
msgstr "Часто у електронних книгах, які створено на основі даних оптичного розпізнавання тексту друкованих книг, містяться слова із помилковими переносами — слова, які було розділено дефісом наприкінці рядка друкованої сторінки. Давайте напишемо просту функцію, яка автоматично виявлятиме і виправлятиме такі слова." |
| 127 |
|
| 128 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:101 |
| 129 |
msgid "Use this function with the same find expression as before, namely::" |
| 130 |
msgstr "Скористайтеся цією функцією із тим самим виразом для пошуку, що і раніше, а саме::" |
| 131 |
|
| 132 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:105 |
| 133 |
msgid "" |
| 134 |
"And it will magically fix all mis-hyphenated words in the text of the book. " |
| 135 |
"The main trick is to use one of the useful extra arguments to the replace " |
| 136 |
"function, ``dictionaries``. This refers to the dictionaries the editor " |
| 137 |
"itself uses to spell check text in the book. What this function does is look" |
| 138 |
" for words separated by a hyphen, remove the hyphen and check if the " |
| 139 |
"dictionary recognizes the composite word, if it does, the original words are" |
| 140 |
" replaced by the hyphen free composite word." |
| 141 |
msgstr "І вона чарівним чином виправить усі слова із помилковими дефісами у тексті книги. Основним трюком тут є використання одного з корисних аргументів функції replace, а саме аргументу ``dictionaries``. Цей аргумент посилається на словники, які редактор використовує для перевірки правопису тексту книги. Ця функція шукає слова, які відокремлено дефісом, вилучає дефіс і перевіряє, чи розпізнається словником з’єднане слово. Якщо слово розпізнається, початкові слова буде замінено об’єднаним словом без дефіса." |
| 142 |
|
| 143 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:113 |
| 144 |
msgid "" |
| 145 |
"Note that one limitation of this technique is it will only work for mono-" |
| 146 |
"lingual books, because, by default, ``dictionaries.recognized()`` uses the " |
| 147 |
"main language of the book." |
| 148 |
msgstr "Зауважте, що одним із обмежень цієї методики є те, що вона працюватиме лише для одномовних книг, оскільки, типово, ``dictionaries.recognized()`` використовує основну мову книги." |
| 149 |
|
| 150 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:119 |
| 151 |
msgid "Auto numbering sections" |
| 152 |
msgstr "Автоматична нумерація розділів" |
| 153 |
|
| 154 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:121 |
| 155 |
msgid "" |
| 156 |
"Now we will see something a little different. Suppose your HTML file has " |
| 157 |
"many sections, each with a heading in an :code:`<h2>` tag that looks like " |
| 158 |
":code:`<h2>Some text</h2>`. You can create a custom function that will " |
| 159 |
"automatically number these headings with consecutive section numbers, so " |
| 160 |
"that they look like :code:`<h2>1. Some text</h2>`." |
| 161 |
msgstr "Тепер ми розглянемо дещо інший приклад. Припустімо, що у вашому файлі HTML багато розділів, кожен з яких має заголовок у тезі :code:`<h2>`, який виглядає так: :code:`<h2>Якийсь текст</h2>`. Ви можете створити нетипову функцію, яка автоматично нумеруватиме такі заголовки послідовними номерами розділів, щоб виходило ось таке: :code:`<h2>1. Якийсь текст</h2>`." |
| 162 |
|
| 163 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:137 |
| 164 |
msgid "Use it with the find expression::" |
| 165 |
msgstr "Скористайтеся цим у виразі для пошуку::" |
| 166 |
|
| 167 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:141 |
| 168 |
msgid "" |
| 169 |
"Place the cursor at the top of the file and click :guilabel:`Replace all`." |
| 170 |
msgstr "Розташуйте курсор на початку файла і натисніть кнопку :guilabel:`Замінити усі`." |
| 171 |
|
| 172 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:143 |
| 173 |
msgid "" |
| 174 |
"This function uses another of the useful extra arguments to ``replace()``: " |
| 175 |
"the ``number`` argument. When doing a :guilabel:`Replace All` number is " |
| 176 |
"automatically incremented for every successive match." |
| 177 |
msgstr "У цій функції використано ще один з корисних додаткових аргументів ``replace()``: аргумент ``number``. Під час виконання дії :guilabel:`Замінити усе` число автоматично збільшуватиметься для кожного наступного відповідника." |
| 178 |
|
| 179 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:147 |
| 180 |
msgid "" |
| 181 |
"Another new feature is the use of ``replace.file_order`` -- setting that to " |
| 182 |
"``'spine'`` means that if this search is run on multiple HTML files, the " |
| 183 |
"files are processed in the order in which they appear in the book. See " |
| 184 |
":ref:`file_order_replace_all` for details." |
| 185 |
msgstr "Ще однією новою можливістю є використання ``replace.file_order`` — встановлення значення ``'spine'`` означає, що якщо пошук виконуватиметься для декількох файлів HTML, вони оброблятимуться у порядку, у якому з’являтимуться у тексті книги. Див. :ref:`file_order_replace_all`, щоб дізнатися більше." |
| 186 |
|
| 187 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:154 |
| 188 |
msgid "Auto create a Table of Contents" |
| 189 |
msgstr "Автоматичне створення списку змісту" |
| 190 |
|
| 191 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:156 |
| 192 |
msgid "" |
| 193 |
"Finally, let's try something a little more ambitious. Suppose your book has " |
| 194 |
"headings in ``h1`` and ``h2`` tags that look like ``<h1 id=\"someid\">Some " |
| 195 |
"Text</h1>``. We will auto-generate an HTML Table of Contents based on these " |
| 196 |
"headings. Create the custom function below:" |
| 197 |
msgstr "Нарешті, спробуймо щось трохи амбіційніше. Припустімо, що у вашій книзі є заголовки у теґах ``h1`` і ``h2``, які виглядають так: ``<h1 id=\"якийсь_ідентифікатор\">Якийсь Текст</h1>``. Ми автоматично створимо таблицю змісту HTML на основі цих заголовків. Створіть таку нетипову функцію:" |
| 198 |
|
| 199 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:199 |
| 200 |
msgid "And use it with the find expression::" |
| 201 |
msgstr "І скористайтеся цим у виразі для пошуку::" |
| 202 |
|
| 203 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:203 |
| 204 |
msgid "" |
| 205 |
"Run the search on :guilabel:`All text files` and at the end of the search, a" |
| 206 |
" window will popup with \"Debug output from your function\" which will have " |
| 207 |
"the HTML Table of Contents, ready to be pasted into :file:`toc.html`." |
| 208 |
msgstr "Виконайте пошук у :guilabel:`Всіх текстових файлах`. Наприкінці пошуку буде показано контекстне вікно «Діагностичні повідомлення від вашої функції», у якому буде показано таблицю змісту у форматі HTML, готову до вставлення до :file:`toc.html`." |
| 209 |
|
| 210 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:207 |
| 211 |
msgid "" |
| 212 |
"The function above is heavily commented, so it should be easy to follow. The" |
| 213 |
" key new feature is the use of another useful extra argument to the " |
| 214 |
"``replace()`` function, the ``data`` object. The ``data`` object is a Python" |
| 215 |
" *dictionary* that persists between all successive invocations of " |
| 216 |
"``replace()`` during a single :guilabel:`Replace All` operation." |
| 217 |
msgstr "Наведений вище код функції містить багато коментарів, тому його доволі просто зрозуміти. Ключовою новою можливістю є використання ще одного додаткового аргументу функції ``replace()``, а саме, об’єкта ``data``. Об’єкт ``data`` є *словником* Python, який зберігається протягом усіх послідовних викликів ``replace()`` під час виконання однієї дії :guilabel:`Замінити всі`." |
| 218 |
|
| 219 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:213 |
| 220 |
msgid "" |
| 221 |
"Another new feature is the use of ``call_after_last_match`` -- setting that " |
| 222 |
"to ``True`` on the ``replace()`` function means that the editor will call " |
| 223 |
"``replace()`` one extra time after all matches have been found. For this " |
| 224 |
"extra call, the match object will be ``None``." |
| 225 |
msgstr "Ще однією новою можливістю є використання ``call_after_last_match`` — встановлення для цієї змінної значення ``True`` у функції ``replace()`` означає, що редактор викликатиме ``replace()`` додатковий раз після знайдення усіх відповідників. Для цього додаткового виклику об’єктом-відповідником буде ``None``." |
| 226 |
|
| 227 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:218 |
| 228 |
msgid "" |
| 229 |
"This was just a demonstration to show you the power of function mode, if you" |
| 230 |
" really needed to generate a Table of Contents from headings in your book, " |
| 231 |
"you would be better off using the dedicated Table of Contents tool in " |
| 232 |
":guilabel:`Tools->Table of Contents`." |
| 233 |
msgstr "Тут наведено лише приклади потужності функціонального режиму. Якщо вам дійсно потрібно створити таблицю змісту на основі заголовків у вашій книзі, вам варто скористатися спеціалізованим інструментом для створення таблиць змісту, а саме, пунктом меню :guilabel:`Інструменти -> Зміст`." |
| 234 |
|
| 235 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:224 |
| 236 |
msgid "The API for the function mode" |
| 237 |
msgstr "Програмний інтерфейс функціонального режиму" |
| 238 |
|
| 239 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:226 |
| 240 |
msgid "" |
| 241 |
"All function mode functions must be Python functions named replace, with the" |
| 242 |
" following signature::" |
| 243 |
msgstr "Усі функції режиму функцій мають бути функціями Python із назвою replace, з таким підписом::" |
| 244 |
|
| 245 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:232 |
| 246 |
msgid "" |
| 247 |
"When a find/replace is run, for every match that is found, the ``replace()``" |
| 248 |
" function will be called, it must return the replacement string for that " |
| 249 |
"match. If no replacements are to be done, it should return ``match.group()``" |
| 250 |
" which is the original string. The various arguments to the ``replace()`` " |
| 251 |
"function are documented below." |
| 252 |
msgstr "Під час виконання дії із пошуку з заміною для кожного знайденого відповідника викликатиметься функція ``replace()`` і має бути повернуто замінений рядок для кожного відповідника. Якщо замін не виконуватиметься, має бути повернуто ``match.group()``, яким є початковий рядок. Документацію з різноманітних аргументів функції ``replace()`` наведено нижче." |
| 253 |
|
| 254 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:239 |
| 255 |
msgid "The ``match`` argument" |
| 256 |
msgstr "Аргумент «match»" |
| 257 |
|
| 258 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:241 |
| 259 |
msgid "" |
| 260 |
"The ``match`` argument represents the currently found match. It is a `Python" |
| 261 |
" Match object <https://docs.python.org/library/re.html#match-objects>`_. Its" |
| 262 |
" most useful method is ``group()`` which can be used to get the matched text" |
| 263 |
" corresponding to individual capture groups in the search regular " |
| 264 |
"expression." |
| 265 |
msgstr "Аргумент ``match`` представляє поточний знайдений відповідник. Це `об’єкт Match Python <https://docs.python.org/library/re.html#match-objects>`_. Його найкориснішим методом є ``group()``, метод, яким можна скористатися для отримання відповідного тексту для окремих груп захоплення під час пошуку за формальним виразом." |
| 266 |
|
| 267 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:248 |
| 268 |
msgid "The ``number`` argument" |
| 269 |
msgstr "Аргумент «number»" |
| 270 |
|
| 271 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:250 |
| 272 |
msgid "" |
| 273 |
"The ``number`` argument is the number of the current match. When you run " |
| 274 |
":guilabel:`Replace All`, every successive match will cause ``replace()`` to " |
| 275 |
"be called with an increasing number. The first match has number 1." |
| 276 |
msgstr "Аргумент ``number`` є номером поточного відповідника. Коли ви наказуєте програмі :guilabel:`Замінити усе`, виявлення кожного наступного відповідника призводитиме до того, що ``replace()`` викликатиметься зі збільшеним числом. Перший відповідник матиме номер 1." |
| 277 |
|
| 278 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:255 |
| 279 |
msgid "The ``file_name`` argument" |
| 280 |
msgstr "Аргумент «file_name»" |
| 281 |
|
| 282 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:257 |
| 283 |
msgid "" |
| 284 |
"This is the filename of the file in which the current match was found. When " |
| 285 |
"searching inside marked text, the ``file_name`` is empty. The ``file_name`` " |
| 286 |
"is in canonical form, a path relative to the root of the book, using ``/`` " |
| 287 |
"as the path separator." |
| 288 |
msgstr "Це назва файла, у якому було знайдено поточний відповідник. Якщо пошук виконується у позначеному фрагменті тексту, значення ``file_name`` є порожнім. Значення ``file_name`` записується у канонічній формі, як шлях відносно кореневої теки книги. з використанням роздільника елементів шляху ``/``." |
| 289 |
|
| 290 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:263 |
| 291 |
msgid "The ``metadata`` argument" |
| 292 |
msgstr "Аргумент «metadata»" |
| 293 |
|
| 294 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:265 |
| 295 |
msgid "" |
| 296 |
"This represents the metadata of the current book, such as title, authors, " |
| 297 |
"language, etc. It is an object of class " |
| 298 |
":class:`calibre.ebooks.metadata.book.base.Metadata`. Useful attributes " |
| 299 |
"include, ``title``, ``authors`` (a list of authors) and ``language`` (the " |
| 300 |
"language code)." |
| 301 |
msgstr "Є метаданими поточної книги, зокрема даними щодо назви, авторів, мови тощо. Є об’єктом класу :class:`calibre.ebooks.metadata.book.base.Metadata`. Серед особливо корисних атрибутів, ``title`` (назва або заголовок книги), ``authors`` (список авторів) та ``language`` (код мови)." |
| 302 |
|
| 303 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:271 |
| 304 |
msgid "The ``dictionaries`` argument" |
| 305 |
msgstr "Аргумент «dictionaries»" |
| 306 |
|
| 307 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:273 |
| 308 |
msgid "" |
| 309 |
"This represents the collection of dictionaries used for spell checking the " |
| 310 |
"current book. Its most useful method is ``dictionaries.recognized(word)`` " |
| 311 |
"which will return ``True`` if the passed in word is recognized by the " |
| 312 |
"dictionary for the current book's language." |
| 313 |
msgstr "Збірка словників, які використовуються для перевірки правопису у поточній книзі. Найкориснішим методом є ``dictionaries.recognized(слово)``. Цей метод повертає ``True``, якщо слово пройшло перевірку за словником для мови поточної книги." |
| 314 |
|
| 315 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:279 |
| 316 |
msgid "The ``data`` argument" |
| 317 |
msgstr "Аргумент «data»" |
| 318 |
|
| 319 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:281 |
| 320 |
msgid "" |
| 321 |
"This a simple Python ``dictionary``. When you run :guilabel:`Replace all`, " |
| 322 |
"every successive match will cause ``replace()`` to be called with the same " |
| 323 |
"``dictionary`` as data. You can thus use it to store arbitrary data between " |
| 324 |
"invocations of ``replace()`` during a :guilabel:`Replace all` operation." |
| 325 |
msgstr "Це простий ``словник`` Python. Після натискання кнопки :guilabel:`Замінити всі` кожен наступний відповідник спричинятиме виклик ``replace()`` із тим самим ``словником`` як даними. Таким чином, ви можете скористатися ним для збереження довільних даних між викликами ``replace()`` під час виконання дії :guilabel:`Замінити всі`." |
| 326 |
|
| 327 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:288 |
| 328 |
msgid "The ``functions`` argument" |
| 329 |
msgstr "Аргумент «functions»" |
| 330 |
|
| 331 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:290 |
| 332 |
msgid "" |
| 333 |
"The ``functions`` argument gives you access to all other user defined " |
| 334 |
"functions. This is useful for code re-use. You can define utility functions " |
| 335 |
"in one place and re-use them in all your other functions. For example, " |
| 336 |
"suppose you create a function named ``My Function`` like this:" |
| 337 |
msgstr "Аргумент ``functions`` надає вам доступ до усіх інших визначених користувачем функцій. Корисний для повторного використання коду. Ви можете визначити допоміжні функції у одному місці, а потім скористатися ними у всіх інших ваших функціях. Наприклад, припустімо, що ви створили таку функцію із назвою ``My Function``:" |
| 338 |
|
| 339 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:303 |
| 340 |
msgid "" |
| 341 |
"Then, in another function, you can access the ``utility()`` function like " |
| 342 |
"this:" |
| 343 |
msgstr "Далі, у іншій функції, ви можете отримати доступ до функції ``utility()`` ось так:" |
| 344 |
|
| 345 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:311 |
| 346 |
msgid "" |
| 347 |
"You can also use the functions object to store persistent data, that can be " |
| 348 |
"re-used by other functions. For example, you could have one function that " |
| 349 |
"when run with :guilabel:`Replace All` collects some data and another " |
| 350 |
"function that uses it when it is run afterwards. Consider the following two " |
| 351 |
"functions:" |
| 352 |
msgstr "Ви також можете скористатися об’єктом ``functions`` для зберігання даних, які може бути повторно використано іншими функціями. Наприклад, ви можете створити функцію, яка під час запуску за допомогою кнопки :guilabel:`Замінити всі` збирає певні дані, і іншу функцію, яка використовує ці зібрані дані під час запуску. Розгляньмо такі дві функції:" |
| 353 |
|
| 354 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:331 |
| 355 |
msgid "Debugging your functions" |
| 356 |
msgstr "Діагностика ваших функцій" |
| 357 |
|
| 358 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:333 |
| 359 |
msgid "" |
| 360 |
"You can debug the functions you create by using the standard ``print()`` " |
| 361 |
"function from Python. The output of print will be displayed in a popup " |
| 362 |
"window after the Find/replace has completed. You saw an example of using " |
| 363 |
"``print()`` to output an entire table of contents above." |
| 364 |
msgstr "Ви можете виконувати діагностику створених вами функцій за допомогою стандартної функції ``print()`` Python. Виведені цією функцією дані буде показано у контекстному вікні після завершення дії з пошуку з заміною. Вище було наведено приклад використання ``print()`` для виведення цілої таблиці змісту." |
| 365 |
|
| 366 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:341 |
| 367 |
msgid "Choose file order when running on multiple HTML files" |
| 368 |
msgstr "Вибір порядку файлів під час запуску для обробки декількох файлів HTML" |
| 369 |
|
| 370 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:343 |
| 371 |
msgid "" |
| 372 |
"When you run a :guilabel:`Replace all` on multiple HTML files, the order in " |
| 373 |
"which the files are processed depends on what files you have open for " |
| 374 |
"editing. You can force the search to process files in the order in which " |
| 375 |
"they appear by setting the ``file_order`` attribute on your function, like " |
| 376 |
"this:" |
| 377 |
msgstr "Якщо ви виконуєте дію :guilabel:`Замінити всі` для декількох файлів HTML одночасно, порядок, у якому оброблятимуться файли, залежить від того, які з файлів було відкрито для редагування. Ви можете наказати обробляти файли у порядку, у якому вони з’являються у книзі, встановленням атрибута ``file_order`` для вашої функції, ось так:" |
| 378 |
|
| 379 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:355 |
| 380 |
msgid "" |
| 381 |
"``file_order`` accepts two values, ``spine`` and ``spine-reverse`` which " |
| 382 |
"cause the search to process multiple files in the order they appear in the " |
| 383 |
"book, either forwards or backwards, respectively." |
| 384 |
msgstr "``file_order`` приймає два значення, ``spine`` і ``spine-reverse``, які спричиняють обробку декількох файлів у порядку, у якому вони зустрічаються у книзі, послідовно вниз або вгору списком, відповідно." |
| 385 |
|
| 386 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:360 |
| 387 |
msgid "" |
| 388 |
"Having your function called an extra time after the last match is found" |
| 389 |
msgstr "Як зробити так, що вашу функцію було викликано ще раз після виявлення останнього відповідника" |
| 390 |
|
| 391 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:362 |
| 392 |
msgid "" |
| 393 |
"Sometimes, as in the auto generate table of contents example above, it is " |
| 394 |
"useful to have your function called an extra time after the last match is " |
| 395 |
"found. You can do this by setting the ``call_after_last_match`` attribute on" |
| 396 |
" your function, like this:" |
| 397 |
msgstr "Іноді, як у прикладі із автоматичним створенням таблиці змісту, який наведено вище, корисно зробити так, щоб вашу функцію було викликано ще раз після виявлення останнього відповідника. Зробити це можна встановленням для вашої функції атрибута ``call_after_last_match``, ось так:" |
| 398 |
|
| 399 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:376 |
| 400 |
msgid "Appending the output from the function to marked text" |
| 401 |
msgstr "Дописування виведеного функцією до позначеного тексту" |
| 402 |
|
| 403 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:378 |
| 404 |
msgid "" |
| 405 |
"When running search and replace on marked text, it is sometimes useful to " |
| 406 |
"append some text to the end of the marked text. You can do that by setting " |
| 407 |
"the ``append_final_output_to_marked`` attribute on your function (note that " |
| 408 |
"you also need to set ``call_after_last_match``), like this:" |
| 409 |
msgstr "Якщо виконується пошук з заміною для позначеного фрагмента тексту, іноді корисно дописувати текст наприкінці позначеного фрагмента. Зробити це можна встановленням для вашої функції атрибута ``append_final_output_to_marked`` (зауважте, що також слід встановити ``call_after_last_match``), ось так:" |
| 410 |
|
| 411 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:393 |
| 412 |
msgid "Suppressing the result dialog when performing searches on marked text" |
| 413 |
msgstr "Придушення діалогового вікна результатів під час виконання пошуків у позначеному тексті" |
| 414 |
|
| 415 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:395 |
| 416 |
msgid "" |
| 417 |
"You can also suppress the result dialog (which can slow down the repeated " |
| 418 |
"application of a search/replace on many blocks of text) by setting the " |
| 419 |
"``suppress_result_dialog`` attribute on your function, like this:" |
| 420 |
msgstr "Крім того, ви можете придушити появу діалогового вікна результатів (що може уповільнити регулярне застосування пошуку з заміною до багатьох блоків тексту) встановивши для вашої функції атрибут ``suppress_result_dialog``, ось так:" |
| 421 |
|
| 422 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:408 |
| 423 |
msgid "More examples" |
| 424 |
msgstr "Додаткові приклади" |
| 425 |
|
| 426 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:410 |
| 427 |
msgid "" |
| 428 |
"More useful examples, contributed by calibre users, can be found in the " |
| 429 |
"`calibre E-book editor forum " |
| 430 |
"<https://www.mobileread.com/forums/showthread.php?t=237181>`_." |
| 431 |
msgstr "Додаткові корисні приклади, авторами яких є користувачі calibre, можна знайти на `форумі редактора книг calibre <https://www.mobileread.com/forums/showthread.php?t=237181>`_." |