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