Debian Codegraph @

translations/manual/pt_BR/function_mode.po

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