| 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 |
# efef6ec5b435a041fce803c7f8af77d2_2341d43, 2018 |
| 7 |
# Jonatan Nyberg, 2026 |
| 8 |
# Jonatan Nyberg, 2016-2017,2021-2024,2026 |
| 9 |
# Jonatan Nyberg, 2019-2021 |
| 10 |
# efef6ec5b435a041fce803c7f8af77d2_2341d43, 2018 |
| 11 |
# Jonatan Nyberg, 2026 |
| 12 |
# Merarom <[email protected]>, 2014-2016 |
| 13 |
msgid "" |
| 14 |
msgstr "" |
| 15 |
"Project-Id-Version: calibre\n" |
| 16 |
"Report-Msgid-Bugs-To: \n" |
| 17 |
"POT-Creation-Date: 2026-07-30 18:07+0000\n" |
| 18 |
"PO-Revision-Date: 2014-11-21 02:54+0000\n" |
| 19 |
"Last-Translator: Jonatan Nyberg, 2026\n" |
| 20 |
"Language-Team: Swedish (http://app.transifex.com/calibre/calibre/language/sv/)\n" |
| 21 |
"MIME-Version: 1.0\n" |
| 22 |
"Content-Type: text/plain; charset=UTF-8\n" |
| 23 |
"Content-Transfer-Encoding: 8bit\n" |
| 24 |
"Language: sv\n" |
| 25 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n" |
| 26 |
|
| 27 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:2 |
| 28 |
msgid "Function mode for Search & replace in the Editor" |
| 29 |
msgstr "Funktionsläge för Sök & ersätt i Redigeraren" |
| 30 |
|
| 31 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:4 |
| 32 |
msgid "" |
| 33 |
"The :guilabel:`Search & replace` tool in the editor supports a *function " |
| 34 |
"mode*. In this mode, you can combine regular expressions (see :doc:`regexp`)" |
| 35 |
" with arbitrarily powerful Python functions to do all sorts of advanced text" |
| 36 |
" processing." |
| 37 |
msgstr "Verktyget :guilabel:`Sök & ersätt` i editorn stöder ett *funktionsläge*. I det här läget kan du kombinera reguljära uttryck (se :doc:`regexp`) med godtyckligt kraftfulla Python-funktioner för att utföra all möjlig avancerad textbehandling." |
| 38 |
|
| 39 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:9 |
| 40 |
msgid "" |
| 41 |
"In the standard *regexp* mode for search and replace, you specify both a " |
| 42 |
"regular expression to search for as well as a template that is used to " |
| 43 |
"replace all found matches. In function mode, instead of using a fixed " |
| 44 |
"template, you specify an arbitrary function, in the `Python programming " |
| 45 |
"language <https://docs.python.org>`_. This allows you to do lots of things " |
| 46 |
"that are not possible with simple templates." |
| 47 |
msgstr "I standardläget *regexp* för sök och ersätt anger du både ett reguljärt uttryck för att söka efter och en mall som används för att ersätta alla hittade matchningar. I funktionsläget, i stället för att använda en fast mall, anger du en godtycklig funktion, i `programmeringsspråket Python <https://docs.python.org>`_. Det här gör att du kan göra massor av saker som inte är möjliga med enkla mallar." |
| 48 |
|
| 49 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:16 |
| 50 |
msgid "" |
| 51 |
"Techniques for using function mode and the syntax will be described by means" |
| 52 |
" of examples, showing you how to create functions to perform progressively " |
| 53 |
"more complex tasks." |
| 54 |
msgstr "Tekniker för att använda funktionsläge och syntaxen beskrivs med hjälp av exempel, som visar dig hur du skapar funktioner för att utföra allt mer komplexa uppgifter." |
| 55 |
|
| 56 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:21 |
| 57 |
msgid "The Function mode" |
| 58 |
msgstr "Funktionsläget" |
| 59 |
|
| 60 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:26 |
| 61 |
msgid "Automatically fixing the case of headings in the document" |
| 62 |
msgstr "Automatiskt justera skiftläget med rubrikerna i dokumentet" |
| 63 |
|
| 64 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:28 |
| 65 |
msgid "" |
| 66 |
"Here, we will leverage one of the builtin functions in the editor to " |
| 67 |
"automatically change the case of all text inside heading tags to title " |
| 68 |
"case::" |
| 69 |
msgstr "Här kommer vi att utnyttja en av de inbyggda funktioner i redigeraren för att automatiskt ändra skiftläget för all text i rubriktaggar till versal::" |
| 70 |
|
| 71 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:33 |
| 72 |
msgid "" |
| 73 |
"For the function, simply choose the :guilabel:`Title-case text (ignore " |
| 74 |
"tags)` builtin function. This will change titles that look like: ``<h1>some " |
| 75 |
"titLE</h1>`` to ``<h1>Some Title</h1>``. It will work even if there are " |
| 76 |
"other HTML tags inside the heading tags." |
| 77 |
msgstr "För funktionen, välj helt enkelt den inbyggda funktionen :guilabel:`Title-case text (ignore tags)`. Detta kommer att ändra titlar som ser ut som: ``<h1>någon titel</h1>`` till ``<h1>Någon titel</h1>``. Det kommer att fungera även om det finns andra HTML-taggar inuti rubriktaggarna." |
| 78 |
|
| 79 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:40 |
| 80 |
msgid "Your first custom function - smartening hyphens" |
| 81 |
msgstr "Din första anpassade funktion - smartare bindestreck" |
| 82 |
|
| 83 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:42 |
| 84 |
msgid "" |
| 85 |
"The real power of function mode comes from being able to create your own " |
| 86 |
"functions to process text in arbitrary ways. The Smarten Punctuation tool in" |
| 87 |
" the editor leaves individual hyphens alone, so you can use this function to" |
| 88 |
" replace them with em-dashes." |
| 89 |
msgstr "Den verkliga styrkan i funktionsläget kommer från möjligheten att skapa egna funktioner som bearbetar text på valfria sätt. Verktyget Förbättra skiljetecken i redigeraren lämnar enskilda bindestreck oförändrade, så du kan använda den här funktionen för att ersätta dem med tankstreck." |
| 90 |
|
| 91 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:47 |
| 92 |
msgid "" |
| 93 |
"To create a new function, simply click the :guilabel:`Create/edit` button to" |
| 94 |
" create a new function and copy the Python code from below." |
| 95 |
msgstr "För att skapa en ny funktion, klickar du helt enkelt på knappen :guilabel:`Skapa/redigera` för att skapa en ny funktion och kopiera Python-koden från nedan." |
| 96 |
|
| 97 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:55 |
| 98 |
msgid "" |
| 99 |
"Every :guilabel:`Search & replace` custom function must have a unique name " |
| 100 |
"and consist of a Python function named replace, that accepts all the " |
| 101 |
"arguments shown above. For the moment, we won't worry about all the " |
| 102 |
"different arguments to ``replace()`` function. Just focus on the ``match`` " |
| 103 |
"argument. It represents a match when running a search and replace. Its full " |
| 104 |
"documentation in available `here " |
| 105 |
"<https://docs.python.org/library/re.html#match-objects>`_. ``match.group()``" |
| 106 |
" simply returns all the matched text and all we do is replace hyphens in " |
| 107 |
"that text with em-dashes, first replacing double hyphens and then single " |
| 108 |
"hyphens." |
| 109 |
msgstr "Varje :guilabel:`Sök och ersätt` anpassad funktion måste ha ett unikt namn och bestå av en Python-funktion med namnet ``replace``, som accepterar alla argument som visas ovan. För tillfället kommer vi inte oroa oss för alla olika argument för funktionen ``replace()``. Fokusera bara på argumentet ``match``. Det representerar en matchning när du söker och ersätter. Dess fullständiga dokumentation finns tillgänglig `här <https://docs.python.org/library/re.html#match-objects>`_. ``match.group()`` returnerar helt enkelt all den matchad text och allt vi gör är att ersätta bindestreck i den texten med em-bindestreck, ersätt först dubbla bindestreck och sedan enkla bindestreck." |
| 110 |
|
| 111 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:65 |
| 112 |
msgid "Use this function with the find regular expression::" |
| 113 |
msgstr "Använd den här funktionen med det reguljära uttrycket hitta::" |
| 114 |
|
| 115 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:69 |
| 116 |
msgid "" |
| 117 |
"And it will replace all hyphens with em-dashes, but only in actual text and " |
| 118 |
"not inside HTML tag definitions." |
| 119 |
msgstr "Och det kommer att ersätta alla bindestreck med em-streck, men bara i själva texten och inte inne i HTML-taggdefinitioner." |
| 120 |
|
| 121 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:74 |
| 122 |
msgid "" |
| 123 |
"The power of function mode - using a spelling dictionary to fix mis-" |
| 124 |
"hyphenated words" |
| 125 |
msgstr "Kraften av funktionsläge - med hjälp av en stavningsordboken att åtgärda felaktigt avstavade ord" |
| 126 |
|
| 127 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:76 |
| 128 |
msgid "" |
| 129 |
"Often, e-books created from scans of printed books contain mis-hyphenated " |
| 130 |
"words -- words that were split at the end of the line on the printed page. " |
| 131 |
"We will write a simple function to automatically find and fix such words." |
| 132 |
msgstr "Ofta innehåller böcker skapade av skanningar av tryckta böcker felavstavade ord -- ord som delades vid slutet av raden på den utskrivna sidan. Vi kommer att skriva en enkel funktion för att automatiskt hitta och åtgärda sådana ord." |
| 133 |
|
| 134 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:101 |
| 135 |
msgid "Use this function with the same find expression as before, namely::" |
| 136 |
msgstr "Använd denna funktion med samma sökuttryck som tidigare, det vill säga::" |
| 137 |
|
| 138 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:105 |
| 139 |
msgid "" |
| 140 |
"And it will magically fix all mis-hyphenated words in the text of the book. " |
| 141 |
"The main trick is to use one of the useful extra arguments to the replace " |
| 142 |
"function, ``dictionaries``. This refers to the dictionaries the editor " |
| 143 |
"itself uses to spell check text in the book. What this function does is look" |
| 144 |
" for words separated by a hyphen, remove the hyphen and check if the " |
| 145 |
"dictionary recognizes the composite word, if it does, the original words are" |
| 146 |
" replaced by the hyphen free composite word." |
| 147 |
msgstr "Och det kommer magiskt åtgärda alla felavstavade ord i texten i boken. Huvudtricket är att använda en av de användbara extra argument till replace-funktionen ``dictionaries``. Detta syftar på de ordböcker redigeraren själv använder för att stavningskontrollera text i boken. Vad denna funktion gör är att leta efter ord separerade med ett bindestreck, tar bort bindestrecket och kontrollerar om ordboken godkänner sammansatt ordet, om den gör det, ersättas de ursprungliga orden med de bindestrecksfria sammansatta orden." |
| 148 |
|
| 149 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:113 |
| 150 |
msgid "" |
| 151 |
"Note that one limitation of this technique is it will only work for mono-" |
| 152 |
"lingual books, because, by default, ``dictionaries.recognized()`` uses the " |
| 153 |
"main language of the book." |
| 154 |
msgstr "Observera att en begränsning av denna teknik är att den bara fungerar för enspråkiga böcker, eftersom ``dictionaries.recognized()`` som standard använder bokens huvudspråk." |
| 155 |
|
| 156 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:119 |
| 157 |
msgid "Auto numbering sections" |
| 158 |
msgstr "Automatisk numrera avsnitt" |
| 159 |
|
| 160 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:121 |
| 161 |
msgid "" |
| 162 |
"Now we will see something a little different. Suppose your HTML file has " |
| 163 |
"many sections, each with a heading in an :code:`<h2>` tag that looks like " |
| 164 |
":code:`<h2>Some text</h2>`. You can create a custom function that will " |
| 165 |
"automatically number these headings with consecutive section numbers, so " |
| 166 |
"that they look like :code:`<h2>1. Some text</h2>`." |
| 167 |
msgstr "Nu kommer vi att se något lite annorlunda. Anta att din HTML-fil har många avsnitt, var och en med en rubrik i en :code:`<h2>` tagg som ser ut som :code:`<h2>Some text</h2>`. Du kan skapa en anpassad funktion som automatiskt numrerar dessa rubriker med avsnittsnummer i följd, så att de ser ut :code:`<h2>1. Någon text</h2>`." |
| 168 |
|
| 169 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:137 |
| 170 |
msgid "Use it with the find expression::" |
| 171 |
msgstr "Använd det med sökuttrycket::" |
| 172 |
|
| 173 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:141 |
| 174 |
msgid "" |
| 175 |
"Place the cursor at the top of the file and click :guilabel:`Replace all`." |
| 176 |
msgstr "Placera markören överst i filen och klicka på :guilabel:`Ersätt alla`." |
| 177 |
|
| 178 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:143 |
| 179 |
msgid "" |
| 180 |
"This function uses another of the useful extra arguments to ``replace()``: " |
| 181 |
"the ``number`` argument. When doing a :guilabel:`Replace All` number is " |
| 182 |
"automatically incremented for every successive match." |
| 183 |
msgstr "Den här funktionen använder ett annat av de användbara extraargumenten till funktionen ``replace()``: ``number``. När du gör ett :guilabel:`Ersätt alla`-räknas numret upp automatiskt för varje efterföljande träff." |
| 184 |
|
| 185 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:147 |
| 186 |
msgid "" |
| 187 |
"Another new feature is the use of ``replace.file_order`` -- setting that to " |
| 188 |
"``'spine'`` means that if this search is run on multiple HTML files, the " |
| 189 |
"files are processed in the order in which they appear in the book. See " |
| 190 |
":ref:`file_order_replace_all` for details." |
| 191 |
msgstr "En annan ny funktion är användningen av ``replace.file_order`` -- inställningen att ``'spine'`` betyder att om denna sökning körs på flera HTML-filer bearbetas filerna i den ordning de visas i boken. Se :ref:`file_order_replace_all` för detaljer." |
| 192 |
|
| 193 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:154 |
| 194 |
msgid "Auto create a Table of Contents" |
| 195 |
msgstr "Skapa automatiskt en innehållsförteckning" |
| 196 |
|
| 197 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:156 |
| 198 |
msgid "" |
| 199 |
"Finally, let's try something a little more ambitious. Suppose your book has " |
| 200 |
"headings in ``h1`` and ``h2`` tags that look like ``<h1 id=\"someid\">Some " |
| 201 |
"Text</h1>``. We will auto-generate an HTML Table of Contents based on these " |
| 202 |
"headings. Create the custom function below:" |
| 203 |
msgstr "Låt oss slutligen prova något lite mer ambitiöst. Anta att boken har rubriker i taggarna ``h1`` och ``h2`` som ser ut så här: ``<h1 id=\"someid\">Någon text</h1>``. Vi ska automatiskt skapa en HTML-innehållsförteckning utifrån dessa rubriker. Skapa den anpassade funktionen nedan:" |
| 204 |
|
| 205 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:199 |
| 206 |
msgid "And use it with the find expression::" |
| 207 |
msgstr "Och använd den med sökuttrycket::" |
| 208 |
|
| 209 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:203 |
| 210 |
msgid "" |
| 211 |
"Run the search on :guilabel:`All text files` and at the end of the search, a" |
| 212 |
" window will popup with \"Debug output from your function\" which will have " |
| 213 |
"the HTML Table of Contents, ready to be pasted into :file:`toc.html`." |
| 214 |
msgstr "Kör sökningen på :guilabel:`Alla textfiler` och vid slutet av sökningen, kommer ett fönster dyka upp med \"Felsök utmatning från din funktion\" vilken kommer ha HTML-innehållsförteckning, klar att klistras in i :file:`toc.html`." |
| 215 |
|
| 216 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:207 |
| 217 |
msgid "" |
| 218 |
"The function above is heavily commented, so it should be easy to follow. The" |
| 219 |
" key new feature is the use of another useful extra argument to the " |
| 220 |
"``replace()`` function, the ``data`` object. The ``data`` object is a Python" |
| 221 |
" *dictionary* that persists between all successive invocations of " |
| 222 |
"``replace()`` during a single :guilabel:`Replace All` operation." |
| 223 |
msgstr "Funktionen ovan är kraftigt kommenterad, så den borde vara lätt att följa. Den viktigaste nya funktionen är användningen av ett annan användbart extra argument till funktionen ``replace()``, objektet ``data``. Objektet ``data`` är en Python *ordbok* som kvarstår mellan alla efterföljande anrop av ``replace()`` under en enda :guilabel:`Ersätt alla` operation." |
| 224 |
|
| 225 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:213 |
| 226 |
msgid "" |
| 227 |
"Another new feature is the use of ``call_after_last_match`` -- setting that " |
| 228 |
"to ``True`` on the ``replace()`` function means that the editor will call " |
| 229 |
"``replace()`` one extra time after all matches have been found. For this " |
| 230 |
"extra call, the match object will be ``None``." |
| 231 |
msgstr "En annan ny funktion är användningen av ``call_after_last_match`` -- genom att ställa in det till ``True`` på funktionen ``replace()`` innebär det att redigeraren kommer att anropa ``replace()`` en extra gång efter att alla träffar har hittats. För detta extra anrop kommer träffobjektet vara ``None``." |
| 232 |
|
| 233 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:218 |
| 234 |
msgid "" |
| 235 |
"This was just a demonstration to show you the power of function mode, if you" |
| 236 |
" really needed to generate a Table of Contents from headings in your book, " |
| 237 |
"you would be better off using the dedicated Table of Contents tool in " |
| 238 |
":guilabel:`Tools->Table of Contents`." |
| 239 |
msgstr "Det var bara en demonstration för att visa styrkan av funktionsläge, om du verkligen behövde skapa en innehållsförteckning från rubriker i din bok, kommer du ha större nytta av att använda det dedikerade innehållsförteckningsverktyget i :guilabel:`Verktyg->Innehållsförteckning`." |
| 240 |
|
| 241 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:224 |
| 242 |
msgid "The API for the function mode" |
| 243 |
msgstr "API för funktionsläget" |
| 244 |
|
| 245 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:226 |
| 246 |
msgid "" |
| 247 |
"All function mode functions must be Python functions named replace, with the" |
| 248 |
" following signature::" |
| 249 |
msgstr "Alla funktionsläge funktioner måste vara Python-funktioner som heter \"replace\" med följande signatur::" |
| 250 |
|
| 251 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:232 |
| 252 |
msgid "" |
| 253 |
"When a find/replace is run, for every match that is found, the ``replace()``" |
| 254 |
" function will be called, it must return the replacement string for that " |
| 255 |
"match. If no replacements are to be done, it should return ``match.group()``" |
| 256 |
" which is the original string. The various arguments to the ``replace()`` " |
| 257 |
"function are documented below." |
| 258 |
msgstr "När en sök/ersätt körs, för varje träff som hittas kommer funktionen ``replace()`` att anropas, den måste returnera ersättningssträngen för den träffen. Om inga ersättare ska göras, bör den returnera ``match.group()`` som är den ursprungliga strängen. De olika argumenten för funktionen ``replace()`` dokumenteras nedan." |
| 259 |
|
| 260 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:239 |
| 261 |
msgid "The ``match`` argument" |
| 262 |
msgstr "Argumentet ``match``" |
| 263 |
|
| 264 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:241 |
| 265 |
msgid "" |
| 266 |
"The ``match`` argument represents the currently found match. It is a `Python" |
| 267 |
" Match object <https://docs.python.org/library/re.html#match-objects>`_. Its" |
| 268 |
" most useful method is ``group()`` which can be used to get the matched text" |
| 269 |
" corresponding to individual capture groups in the search regular " |
| 270 |
"expression." |
| 271 |
msgstr "Argumentet ``match`` representerar den matchning som har hittats. Det är ett `Python Match-objekt <https://docs.python.org/library/re.html#match-objects>`_. Dess mest användbara metod är ``group()``, som kan användas för att hämta den matchade text som motsvarar enskilda fångstgrupper i det reguljära sökuttrycket." |
| 272 |
|
| 273 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:248 |
| 274 |
msgid "The ``number`` argument" |
| 275 |
msgstr "Argumentet ``number``" |
| 276 |
|
| 277 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:250 |
| 278 |
msgid "" |
| 279 |
"The ``number`` argument is the number of the current match. When you run " |
| 280 |
":guilabel:`Replace All`, every successive match will cause ``replace()`` to " |
| 281 |
"be called with an increasing number. The first match has number 1." |
| 282 |
msgstr "Argumentet ``number`` är numret på den aktuella träffen. När du kör :guilabel:`Ersätt alla`, kommer varje efterföljande träff att orsaka ``replace()`` att anropas med ett ökande antal. Första träff har nummer 1." |
| 283 |
|
| 284 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:255 |
| 285 |
msgid "The ``file_name`` argument" |
| 286 |
msgstr "Argumentet ``file_name``" |
| 287 |
|
| 288 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:257 |
| 289 |
msgid "" |
| 290 |
"This is the filename of the file in which the current match was found. When " |
| 291 |
"searching inside marked text, the ``file_name`` is empty. The ``file_name`` " |
| 292 |
"is in canonical form, a path relative to the root of the book, using ``/`` " |
| 293 |
"as the path separator." |
| 294 |
msgstr "Det här är filnamnet på filen där den aktuella träffen hittades. När du söker inuti markerad text är ``file_name`` tom. ``file_name`` är i kanonisk form, en relativ sökväg till roten av boken, med ``/`` som sökvägsavgränsare." |
| 295 |
|
| 296 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:263 |
| 297 |
msgid "The ``metadata`` argument" |
| 298 |
msgstr "Argumentet ``metadata``" |
| 299 |
|
| 300 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:265 |
| 301 |
msgid "" |
| 302 |
"This represents the metadata of the current book, such as title, authors, " |
| 303 |
"language, etc. It is an object of class " |
| 304 |
":class:`calibre.ebooks.metadata.book.base.Metadata`. Useful attributes " |
| 305 |
"include, ``title``, ``authors`` (a list of authors) and ``language`` (the " |
| 306 |
"language code)." |
| 307 |
msgstr "Detta representerar metadata för den aktuella boken, som titel, författare, språk, etc. Det är ett objekt av klassen :class:`calibre.ebooks.metadata.book.base.Metadata`. Användbara egenskaper inkluderar, ``title``, ``authors`` (en lista med författare) och ``language`` (språkkod)." |
| 308 |
|
| 309 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:271 |
| 310 |
msgid "The ``dictionaries`` argument" |
| 311 |
msgstr "Argumentet ``dictionaries``" |
| 312 |
|
| 313 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:273 |
| 314 |
msgid "" |
| 315 |
"This represents the collection of dictionaries used for spell checking the " |
| 316 |
"current book. Its most useful method is ``dictionaries.recognized(word)`` " |
| 317 |
"which will return ``True`` if the passed in word is recognized by the " |
| 318 |
"dictionary for the current book's language." |
| 319 |
msgstr "Detta innebär insamling av ordböcker som används för stavningskontroll den aktuella boken. Den användbaraste metoden ``dictionaries.recognized(word)`` vilken som returnerar ``True`` om givet in ord känns igen av ordbok för den aktuella bokens språk." |
| 320 |
|
| 321 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:279 |
| 322 |
msgid "The ``data`` argument" |
| 323 |
msgstr "``data``-argumentet" |
| 324 |
|
| 325 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:281 |
| 326 |
msgid "" |
| 327 |
"This a simple Python ``dictionary``. When you run :guilabel:`Replace all`, " |
| 328 |
"every successive match will cause ``replace()`` to be called with the same " |
| 329 |
"``dictionary`` as data. You can thus use it to store arbitrary data between " |
| 330 |
"invocations of ``replace()`` during a :guilabel:`Replace all` operation." |
| 331 |
msgstr "Detta är en enkel Python ``ordbok``. När du kör :guilabel:`Ersätt alla` kommer varje efterföljande träff att orsaka ``replace()`` att anropas med samma ``ordbok`` som data. Du kan alltså använda den för att lagra godtyckliga data mellan anrop av ``replace()`` under en :guilabel:`Ersätt alla`-operation." |
| 332 |
|
| 333 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:288 |
| 334 |
msgid "The ``functions`` argument" |
| 335 |
msgstr "``functions``-argumentet" |
| 336 |
|
| 337 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:290 |
| 338 |
msgid "" |
| 339 |
"The ``functions`` argument gives you access to all other user defined " |
| 340 |
"functions. This is useful for code re-use. You can define utility functions " |
| 341 |
"in one place and re-use them in all your other functions. For example, " |
| 342 |
"suppose you create a function named ``My Function`` like this:" |
| 343 |
msgstr "Argumentet ``functions`` ger dig åtkomst till alla andra användardefinierade funktioner. Det är användbart för återanvändning av kod. Du kan definiera hjälpfunktioner på ett ställe och återanvända dem i alla dina andra funktioner. Anta till exempel att du skapar en funktion med namnet ``My Function`` så här:" |
| 344 |
|
| 345 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:303 |
| 346 |
msgid "" |
| 347 |
"Then, in another function, you can access the ``utility()`` function like " |
| 348 |
"this:" |
| 349 |
msgstr "Sedan, i en annan funktion kan du komma åt ``utility()`` funktionen så här:" |
| 350 |
|
| 351 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:311 |
| 352 |
msgid "" |
| 353 |
"You can also use the functions object to store persistent data, that can be " |
| 354 |
"re-used by other functions. For example, you could have one function that " |
| 355 |
"when run with :guilabel:`Replace All` collects some data and another " |
| 356 |
"function that uses it when it is run afterwards. Consider the following two " |
| 357 |
"functions:" |
| 358 |
msgstr "Du kan också använda funktionsobjektet för att lagra beständiga data, som kan återanvändas av andra funktioner. Till exempel kan du ha en funktion som när den körs med :guilabel:`Ersätt alla` samlar in en del data och en annan funktion som använder den när den körs efteråt. Betrakta följande två funktioner:" |
| 359 |
|
| 360 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:331 |
| 361 |
msgid "Debugging your functions" |
| 362 |
msgstr "Felsökning av dina funktioner" |
| 363 |
|
| 364 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:333 |
| 365 |
msgid "" |
| 366 |
"You can debug the functions you create by using the standard ``print()`` " |
| 367 |
"function from Python. The output of print will be displayed in a popup " |
| 368 |
"window after the Find/replace has completed. You saw an example of using " |
| 369 |
"``print()`` to output an entire table of contents above." |
| 370 |
msgstr "Du kan felsöka de funktioner som du skapar med hjälp av standard ``print()`` funktionen från Python. Utskriften av print kommer visas i ett extrafönster efter att Sök/ersätt är klar. Du såg ett exempel på att använda ``print()`` för att mata ut en hel innehållsförteckning ovan." |
| 371 |
|
| 372 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:341 |
| 373 |
msgid "Choose file order when running on multiple HTML files" |
| 374 |
msgstr "Välj filordning när flera HTML-filer körs" |
| 375 |
|
| 376 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:343 |
| 377 |
msgid "" |
| 378 |
"When you run a :guilabel:`Replace all` on multiple HTML files, the order in " |
| 379 |
"which the files are processed depends on what files you have open for " |
| 380 |
"editing. You can force the search to process files in the order in which " |
| 381 |
"they appear by setting the ``file_order`` attribute on your function, like " |
| 382 |
"this:" |
| 383 |
msgstr "När du kör :guilabel:`Ersätt alla` i flera HTML-filer beror filernas bearbetningsordning på vilka filer du har öppnat för redigering. Du kan tvinga sökningen att bearbeta filerna i den ordning de förekommer genom att ange attributet ``file_order`` för funktionen så här:" |
| 384 |
|
| 385 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:355 |
| 386 |
msgid "" |
| 387 |
"``file_order`` accepts two values, ``spine`` and ``spine-reverse`` which " |
| 388 |
"cause the search to process multiple files in the order they appear in the " |
| 389 |
"book, either forwards or backwards, respectively." |
| 390 |
msgstr "``file_order`` accepterar två värden, ``spine`` och ``spine-reverse`` vilka får sökprocessen att behandla flera filer i den ordning de dyker upp i boken, antingen framåt eller bakåt." |
| 391 |
|
| 392 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:360 |
| 393 |
msgid "" |
| 394 |
"Having your function called an extra time after the last match is found" |
| 395 |
msgstr "Att få din funktion anropad en extra gång efter att den senaste träffen hittats" |
| 396 |
|
| 397 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:362 |
| 398 |
msgid "" |
| 399 |
"Sometimes, as in the auto generate table of contents example above, it is " |
| 400 |
"useful to have your function called an extra time after the last match is " |
| 401 |
"found. You can do this by setting the ``call_after_last_match`` attribute on" |
| 402 |
" your function, like this:" |
| 403 |
msgstr "Ibland, som i exemplet med den automatiskt skapande av innehållsförteckning ovan, är det användbart att få din funktion anropad en extra gång efter att den sista träffen hittats. Du kan göra detta genom att ställa in attributet ``call_after_last_match`` på din funktion, så här:" |
| 404 |
|
| 405 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:376 |
| 406 |
msgid "Appending the output from the function to marked text" |
| 407 |
msgstr "Lägga till utmatning från funktionen till markerad text" |
| 408 |
|
| 409 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:378 |
| 410 |
msgid "" |
| 411 |
"When running search and replace on marked text, it is sometimes useful to " |
| 412 |
"append some text to the end of the marked text. You can do that by setting " |
| 413 |
"the ``append_final_output_to_marked`` attribute on your function (note that " |
| 414 |
"you also need to set ``call_after_last_match``), like this:" |
| 415 |
msgstr "När du kör sök och ersätt på markerad text kan det ibland vara praktiskt att lägga till text i slutet av den markerade texten. Det kan du göra genom att ange attributet ``append_final_output_to_marked`` för funktionen (observera att du även måste ange ``call_after_last_match``) så här:" |
| 416 |
|
| 417 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:393 |
| 418 |
msgid "Suppressing the result dialog when performing searches on marked text" |
| 419 |
msgstr "Undertryck resultatdialogrutan när sökning sker med markerad text" |
| 420 |
|
| 421 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:395 |
| 422 |
msgid "" |
| 423 |
"You can also suppress the result dialog (which can slow down the repeated " |
| 424 |
"application of a search/replace on many blocks of text) by setting the " |
| 425 |
"``suppress_result_dialog`` attribute on your function, like this:" |
| 426 |
msgstr "Du kan också undertrycka resultatdialogrutan (som kan bromsa upp upprepad tillämpning av en sök/ersätt på många textblock ) genom att ställa in ``suppress_result_dialog`` attributet på din funktion, så här:" |
| 427 |
|
| 428 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:408 |
| 429 |
msgid "More examples" |
| 430 |
msgstr "Fler exempel" |
| 431 |
|
| 432 |
#: ../../../__w/calibre/calibre/manual/function_mode.rst:410 |
| 433 |
msgid "" |
| 434 |
"More useful examples, contributed by calibre users, can be found in the " |
| 435 |
"`calibre E-book editor forum " |
| 436 |
"<https://www.mobileread.com/forums/showthread.php?t=237181>`_." |
| 437 |
msgstr "Mer användbara exempel som tillförs av calibre-användare kan hittas i `forumet för calibre e-bokredigeraren <https://www.mobileread.com/forums/showthread.php?t=237181>`_." |