Debian Codegraph @

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