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