Debian Codegraph @

translations/manual/fi/creating_plugins.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 # Pekka Tuominen <[email protected]>, 2019
7 # Timo Virtanen <[email protected]>, 2017
8 msgid ""
9 msgstr ""
10 "Project-Id-Version: calibre\n"
11 "Report-Msgid-Bugs-To: \n"
12 "POT-Creation-Date: 2026-02-17 16:44+0000\n"
13 "PO-Revision-Date: 2014-06-17 08:35+0000\n"
14 "Last-Translator: Pekka Tuominen <[email protected]>, 2019\n"
15 "Language-Team: Finnish (http://app.transifex.com/calibre/calibre/language/fi/)\n"
16 "MIME-Version: 1.0\n"
17 "Content-Type: text/plain; charset=UTF-8\n"
18 "Content-Transfer-Encoding: 8bit\n"
19 "Language: fi\n"
20 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
21
22 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:4
23 msgid "Writing your own plugins to extend calibre's functionality"
24 msgstr "Omien lisäosien luominen calibren ominaisuuksia laajentamaan"
25
26 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:6
27 msgid ""
28 "calibre has a very modular design. Almost all functionality in calibre comes"
29 " in the form of plugins. Plugins are used for conversion, for downloading "
30 "news (though these are called recipes), for various components of the user "
31 "interface, to connect to different devices, to process files when adding "
32 "them to calibre and so on. You can get a complete list of all the built-in "
33 "plugins in calibre by going to :guilabel:`Preferences->Advanced->Plugins`."
34 msgstr "Calibren rakenne on hyvin modulaarinen. Lähes kaikki toiminnot on toteutettu lisäosien kautta. Lisäosia käytetään muuntamiseen, uutisten lataamiseen (vaikka niitä silloin kutsutaan resepteiksi), käyttöliittymän eri osiin, eri laitteisiin yhdistämiseen, tiedostojen muokkaamiseen kun niitä lisätään calibreen jne. Löydät täydellisen listan kaikista sisäänrakennetuista lisäosista avaamalla :guilabel:'Asetukset -> Edistyneet asetukset -> Lisäosat'."
35
36 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:8
37 msgid ""
38 "Here, we will teach you how to create your own plugins to add new features "
39 "to calibre."
40 msgstr "Tässä opastamme sinua omien lisäosien tekemisessä uusien toimintojen lisäämiseksi calibreen"
41
42 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:13
43 msgid "Contents"
44 msgstr "Sisältö"
45
46 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:15
47 msgid "This only applies to calibre releases >= 0.8.60"
48 msgstr "Koskee vain calibre versioita <=0.8.60"
49
50 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:18
51 msgid "Anatomy of a calibre plugin"
52 msgstr "calibre-lisäosan rakenne"
53
54 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:20
55 msgid ""
56 "A calibre plugin is very simple, it's just a ZIP file that contains some "
57 "Python code and any other resources like image files needed by the plugin. "
58 "Without further ado, let's see a basic example."
59 msgstr "calibre-lisäosa on hyvi yksinkertainen, ZIP-tiedostossa hiukan Python-koodia ja mahdolliset lisäosan tarvitsemat lisäresurssit, kuten kuvia. Katsotaanpa sitten yksinkertaista esimerkkiä."
60
61 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:24
62 msgid ""
63 "Suppose you have an installation of calibre that you are using to self "
64 "publish various e-documents in EPUB and MOBI formats. You would like all "
65 "files generated by calibre to have their publisher set as \"Hello world\", "
66 "here's how to do it. Create a file named :file:`__init__.py` (this is a "
67 "special name and must always be used for the main file of your plugin) and "
68 "enter the following Python code into it:"
69 msgstr "Jos vaikkapa käytät calibrea omien e-dokumenttiesi julkaisuun EPUB. tai MOBI-formaatissa, ja haluat asettaa kaikkiin calibren tuottamiin tiedostoihin julkaisijaksi \"Hello world\", tee näin. Luo tiedosto nimellä :file:'__init__.py' (lisäosan päätiedosto on aina tämän niminen) ja kirjoita siihen tämä Python-koodi:"
70
71 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:32
72 msgid ""
73 "That's all. To add this code to calibre as a plugin, simply run the "
74 "following in the folder in which you created :file:`__init__.py`::"
75 msgstr ""
76
77 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:38
78 msgid ""
79 "On macOS, the command line tools are inside the calibre bundle, for example,"
80 " if you installed calibre in :file:`/Applications` the command line tools "
81 "are in :file:`/Applications/calibre.app/Contents/MacOS/`."
82 msgstr ""
83
84 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:42
85 msgid ""
86 "You can download the Hello World plugin from "
87 ":download_file:`helloworld_plugin.zip`."
88 msgstr ""
89
90 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:45
91 msgid ""
92 "Every time you use calibre to convert a book, the plugin's :meth:`run` "
93 "method will be called and the converted book will have its publisher set to "
94 "\"Hello World\". This is a trivial plugin, let's move on to a more complex "
95 "example that actually adds a component to the user interface."
96 msgstr ""
97
98 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:50
99 msgid "A User Interface plugin"
100 msgstr "Käyttäjäliittymä liitännäinen"
101
102 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:52
103 msgid ""
104 "This plugin will be spread over a few files (to keep the code clean). It "
105 "will show you how to get resources (images or data files) from the plugin "
106 "ZIP file, allow users to configure your plugin, how to create elements in "
107 "the calibre user interface and how to access and query the books database in"
108 " calibre."
109 msgstr "Lisäosa muodostuu muutamasta tiedostosta (jotta koodi säilyy selkeänä). Se esittelee sinulle tavat hakea resursseja (kuvia tai tietoja) lisäosan ZIP-tiedostosta, sallia käyttäjien muokata lisäosan asetuksia, kuinka lisätä käyttöliittymään elementtejä sekä miten calibre-tietokantaan tehdään kyselyjä."
110
111 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:57
112 msgid ""
113 "You can download this plugin from :download_file:`interface_demo_plugin.zip`"
114 msgstr ""
115
116 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:61
117 msgid ""
118 "The first thing to note is that this ZIP file has a lot more files in it, "
119 "explained below, pay particular attention to ``plugin-import-name-"
120 "interface_demo.txt``."
121 msgstr "Ensimmäisenä huomaat että ZIPissä on paljon enemmän tiedostoja - nämä kuvataan alla, mutta kiinnitä huomiota erityisesti tiedostoon ``plugin-import-name-interface_demo.txt``."
122
123 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:64
124 msgid "**plugin-import-name-interface_demo.txt**"
125 msgstr "**plugin-import-name-interface_demo.txt**"
126
127 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:65
128 msgid ""
129 "An empty text file used to enable the multi-file plugin magic. This file "
130 "must be present in all plugins that use more than one .py file. It should be"
131 " empty and its filename must be of the form: ``plugin-import-"
132 "name-**some_name**.txt``. The presence of this file allows you to import "
133 "code from the .py files present inside the ZIP file, using a statement "
134 "like::"
135 msgstr "Tyhjä tekstitiedosto, joka mahdollistaa usean tiedoston lisäosatoiminnan. Tämän tiedoston on oltava kaikissa enempää kuin yhtä .py-tiedostoa käyttävissä lisäosissa. Se pidetään tyhjänä ja nimen on oltava muotoa: ``plugin-import-name-**jokin_nimi**.txt``. Tiedoston läsnäolo mahdollistaa koodin tuomisen ZIPin .py-tiedostoista, käyttämällä komentoja kuten::"
136
137 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:71
138 msgid ""
139 "The prefix ``calibre_plugins`` must always be present. ``some_name`` comes "
140 "from the filename of the empty text file. ``some_module`` refers to "
141 ":file:`some_module.py` file inside the ZIP file. Note that this importing is"
142 " just as powerful as regular Python imports. You can create packages and "
143 "subpackages of .py modules inside the ZIP file, just like you would normally"
144 " (by defining __init__.py in each sub-folder), and everything should \"just "
145 "work\"."
146 msgstr ""
147
148 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:76
149 msgid ""
150 "The name you use for ``some_name`` enters a global namespace shared by all "
151 "plugins, **so make it as unique as possible**. But remember that it must be "
152 "a valid Python identifier (only alphabets, numbers and the underscore)."
153 msgstr "Nimi jonka annat \"jokin_nimi\"-kohtaan tulee lisäosien jaettuun nimiavaruuteen, **joten tee siitä mahdollisimman yksilöllinen**. Muista kuitenkin noudattaa luvallisia Python-tunnistemuotoa (vain aakkosia, numeroita ja alaviiva)."
154
155 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:79
156 msgid "**__init__.py**"
157 msgstr "**__init__.py**"
158
159 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:80
160 msgid "As before, the file that defines the plugin class"
161 msgstr "Kuten edellä, lisäosan luokan määrittävä tiedosto"
162
163 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:82
164 msgid "**main.py**"
165 msgstr "**main.py**"
166
167 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:83
168 msgid "This file contains the actual code that does something useful"
169 msgstr "Tämä tiedosto sisältää varsinaisen toiminnallisen koodin"
170
171 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:85
172 msgid "**ui.py**"
173 msgstr "**ui.py**"
174
175 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:86
176 msgid "This file defines the interface part of the plugin"
177 msgstr "Tämä tiedosto määritää lisäosan käyttöliittymän"
178
179 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:88
180 msgid "**images/icon.png**"
181 msgstr "**images/icon.png**"
182
183 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:89
184 msgid "The icon for this plugin"
185 msgstr "Lisäosan kuvake"
186
187 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:91
188 msgid "**about.txt**"
189 msgstr "**about.txt**"
190
191 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:92
192 msgid "A text file with information about the plugin"
193 msgstr "Tekstitiedosto jossa on tietoa lisäosasta"
194
195 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:94
196 msgid "**translations**"
197 msgstr "**translations**"
198
199 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:95
200 msgid ""
201 "A folder containing .mo files with the translations of the user interface of"
202 " your plugin into different languages. See below for details."
203 msgstr "Kansio .mo-tiedostoja joissa on lisäosasi käyttöliittymän käännökset eri kielille. Katso lisätietoja alta."
204
205 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:99
206 msgid "Now let's look at the code."
207 msgstr "Katsotaan nyt koodia."
208
209 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:102
210 msgid "__init__.py"
211 msgstr "__init__.py"
212
213 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:104
214 msgid "First, the obligatory ``__init__.py`` to define the plugin metadata:"
215 msgstr "Ensin, pakollinen \"__init__.py\" joka määrittää lisäosan metatiedot:"
216
217 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:109
218 msgid ""
219 "The only noteworthy feature is the field :attr:`actual_plugin`. Since "
220 "calibre has both command line and GUI interfaces, GUI plugins like this one "
221 "should not load any GUI libraries in __init__.py. The actual_plugin field "
222 "does this for you, by telling calibre that the actual plugin is to be found "
223 "in another file inside your ZIP archive, which will only be loaded in a GUI "
224 "context."
225 msgstr "- Ainoa huomionarvoinen ominaisuus on kenttä :attr:`actual_plugin`. Koska calibressa on sekä komentorivi- että GUI-käyttöliittymät, tällaisten lisäosien ei pitäisi ladata käyttöliittymäkirjastoja __init__.py:ssä. Sen sijaan kenttä actual_plugin vastaa tästä, kertomalla calibrelle, että varsinainen lisäosa löytyy toisesta tiedostosta ZIPissä, ja se ladataan vain GUI-kontekstissa."
226
227 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:114
228 msgid ""
229 "Remember that for this to work, you must have a plugin-import-name-"
230 "some_name.txt file in your plugin ZIP file, as discussed above."
231 msgstr "Muista että toiminnan ehtona lisäosan ZIPissä on oltava tiedosto plugin-import-name-jokin_nimi.txt, kuten yllä mainittiin."
232
233 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:117
234 msgid ""
235 "Also there are a couple of methods for enabling user configuration of the "
236 "plugin. These are discussed below."
237 msgstr "Pari metodia mahdollistaa käyttäjäasetusten tekemisen. Niistä lisää alla."
238
239 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:120
240 msgid "ui.py"
241 msgstr "ui.py"
242
243 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:122
244 msgid ""
245 "Now let's look at ui.py which defines the actual GUI plugin. The source code"
246 " is heavily commented and should be self explanatory:"
247 msgstr "Seuraavaksi ui.py:stä, joka määrittää GUI-lisäosan. Tämä lähdekoodi on perusteellisesti kommentoitu ja sen pitäisi olla aika selkeä:"
248
249 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:128
250 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:220
251 msgid "main.py"
252 msgstr "main.py"
253
254 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:130
255 msgid "The actual logic to implement the Interface Plugin Demo dialog."
256 msgstr "Varsinainen logiikka, jolla Interface Plugin Demo -ikkuna suoritetaan."
257
258 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:136
259 msgid "Getting resources from the plugin ZIP file"
260 msgstr "Resurssien hakeminen lisäosan ZIP-tiedostosta"
261
262 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:138
263 msgid ""
264 "calibre's plugin loading system defines a couple of built-in functions that "
265 "allow you to conveniently get files from the plugin ZIP file."
266 msgstr "calibren lisäosien lataustoiminto tarjoaa pari sisäänrakennettua funktiota joilla voit sujuvasti hakea tiedostoja lisäosa-ZIPistä."
267
268 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:140
269 msgid "**get_resources(name_or_list_of_names)**"
270 msgstr "**get_resources(name_or_list_of_names)**"
271
272 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:141
273 msgid ""
274 "This function should be called with a list of paths to files inside the ZIP "
275 "file. For example to access the file :file:`icon.png` in the folder images "
276 "in the ZIP file, you would use: ``images/icon.png``. Always use a forward "
277 "slash as the path separator, even on Windows. When you pass in a single "
278 "name, the function will return the raw bytes of that file or None if the "
279 "name was not found in the ZIP file. If you pass in more than one name then "
280 "it returns a dictionary mapping the names to bytes. If a name is not found,"
281 " it will not be present in the returned dictionary."
282 msgstr ""
283
284 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:150
285 msgid "**get_icons(name_or_list_of_names, plugin_name='')**"
286 msgstr ""
287
288 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:151
289 msgid ""
290 "A wrapper for get_resources() that creates QIcon objects from the raw bytes "
291 "returned by get_resources. If a name is not found in the ZIP file the "
292 "corresponding QIcon will be null. In order to support icon theme-ing, pass "
293 "in the human friendly name of your plugin as ``plugin_name``. If the user is"
294 " using an icon theme with icons for your plugin, they will be loaded "
295 "preferentially."
296 msgstr ""
297
298 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:160
299 msgid "Enabling user configuration of your plugin"
300 msgstr "Käyttäjäasetusten salliminen lisäosassa"
301
302 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:162
303 msgid ""
304 "To allow users to configure your plugin, you must define three methods in "
305 "your base plugin class, **is_customizable**, **config_widget** and "
306 "**save_settings** as shown below:"
307 msgstr "Jotta lisäosan asetukset ovat käyttäjien muokattavissa, vaaditaan kolmen metodin määrittäminen lisäosan base-luokassa, **is_customizable**, **config_widget** ja **save_settings** alla olevan esimerkin mukaisesti:"
308
309 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:173
310 msgid ""
311 "calibre has many different ways to store configuration data (a legacy of its"
312 " long history). The recommended way is to use the **JSONConfig** class, "
313 "which stores your configuration information in a .json file."
314 msgstr "calibrella on useita keinoja tallentaa asetustietoja (kiitos pitkän historiansa). Suositeltu tapa on **JSONConfig**-luokan käyttäminen, jolloin asetustiedot tallentuvat .json-tiedostoon."
315
316 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:175
317 msgid ""
318 "The code to manage configuration data in the demo plugin is in config.py:"
319 msgstr "Asetustietojen hallintakoodi on demo-lisäosan config.py:ssä:"
320
321 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:180
322 msgid ""
323 "The ``prefs`` object is now available throughout the plugin code by a "
324 "simple::"
325 msgstr "\"prefs\"-objekti on nyt käytettävissä lisäosakoodista käyttäen yksinkertaista::"
326
327 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:185
328 msgid "You can see the ``prefs`` object being used in main.py:"
329 msgstr "\"prefs\"-objektin käytöstä näet esimerkin main.py:ssä:"
330
331 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:192
332 msgid "Edit book plugins"
333 msgstr "Muokkaa kirja-liitännäisiä"
334
335 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:194
336 msgid ""
337 "Now let's change gears for a bit and look at creating a plugin to add tools "
338 "to the calibre book editor. The plugin is available here: "
339 ":download_file:`editor_demo_plugin.zip`."
340 msgstr ""
341
342 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:198
343 msgid ""
344 "The first step, as for all plugins is to create the import name empty txt "
345 "file, as described :ref:`above <import_name_txt>`. We shall name the file "
346 "``plugin-import-name-editor_plugin_demo.txt``."
347 msgstr "Ensimmäinen askel, kuten kaikille lisäosille, on luoda tuontinimen tyhjä txt-tiedosto, kuten kerrottu :ref:'yllä <import_name_txt>'. Nimetään tämä ``plugin-import-name-editor_plugin_demo.txt``."
348
349 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:202
350 msgid ""
351 "Now we create the mandatory ``__init__.py`` file that contains metadata "
352 "about the plugin -- its name, author, version, etc."
353 msgstr "Sitten luodaan pakollinen \"__init__.py\"-tiedosto jossa on lisäosan metatiedot - sen nimi, tekijä, versio jne."
354
355 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:208
356 msgid ""
357 "A single editor plugin can provide multiple tools each tool corresponds to a"
358 " single button in the toolbar and entry in the :guilabel:`Plugins` menu in "
359 "the editor. These can have sub-menus in case the tool has multiple related "
360 "actions."
361 msgstr "Yksittäinen muokkauslisäosa voi tarjota useampia työkaluja joista kukin vastaa yhtä työkalurivin painiketta ja riviä muokkaimen :guilabel:'Lisäosat'-valikossa. Myös alivalikoita voi asettaa jos työkalulla on rinnakkaisia toimintoja."
362
363 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:212
364 msgid ""
365 "The tools must all be defined in the file ``main.py`` in your plugin. Every "
366 "tool is a class that inherits from the "
367 ":class:`calibre.gui2.tweak_book.plugin.Tool` class. Let's look at "
368 "``main.py`` from the demo plugin, the source code is heavily commented and "
369 "should be self-explanatory. Read the API documents of the "
370 ":class:`calibre.gui2.tweak_book.plugin.Tool` class for more details."
371 msgstr "Kaikki työkalut määritellään lisäosasi \"main.py\":ssä. Kukin työkalu on luokka, joka perii :class:`calibre.gui2.tweak_book.plugin.Tool` luokan. Käydään läpi demo-lisäosan \"main.py\", jonka koodi on perusteellisesti kuvattu ja helposti ymmärrettävä. Lue API-dokumentaatio class:`calibre.gui2.tweak_book.plugin.Tool` -luokalle saadaksesi tarkempia tietoja."
372
373 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:222
374 msgid ""
375 "Here we will see the definition of a single tool that will multiply all font"
376 " sizes in the book by a number provided by the user. This tool demonstrates "
377 "various important concepts that you will need in developing your own "
378 "plugins, so you should read the (heavily commented) source code carefully."
379 msgstr "Tämä määrittely on yksittäinen työkalu, joka monistaa kaikki tekstikoot kirjassa käyttäjän asettamalla kertoimella. Työkalu demonstroi useita tärkeitä konsepteja joita tarvitset omien lisäosiesi luomisessa, joten perehty lähdekoodin kuvauksiin huolellisesti."
380
381 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:230
382 msgid ""
383 "Let's break down ``main.py``. We see that it defines a single tool, named "
384 "*Magnify fonts*. This tool will ask the user for a number and multiply all "
385 "font sizes in the book by that number."
386 msgstr "Käydään läpi \"main.py\". Se määrittää yhden työkalun, nimeltä \"Magnify fonts\". Työkalu kysyy käyttäjältä lukua ja kertoo sillä kaikki kirjan tekstikoot."
387
388 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:234
389 msgid ""
390 "The first important thing is the tool name which you must set to some "
391 "relatively unique string as it will be used as the key for this tool."
392 msgstr "Ensimmäinen huomattava asia on, että työkalun nimen tulee olla suhteellisen uniikki lauseke, sillä se toimii työkalun tunnuksena."
393
394 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:237
395 msgid ""
396 "The next important entry point is the "
397 ":meth:`calibre.gui2.tweak_book.plugin.Tool.create_action`. This method "
398 "creates the QAction objects that appear in the plugins toolbar and plugin "
399 "menu. It also, optionally, assigns a keyboard shortcut that the user can "
400 "customize. The triggered signal from the QAction is connected to the "
401 "ask_user() method that asks the user for the font size multiplier, and then "
402 "runs the magnification code."
403 msgstr "Toiseksi, tärkein lähtöpiste on :meth:`calibre.gui2.tweak_book.plugin.Tool.create_action`. Tämä metodi luo QAction-objektit jotka näkyvät lisäosatyökalurivillä ja lisäosavalikossa. Sen avulla voi myös asettaa näppäinoikotien jonka käyttäjä voi mukauttaa. QActionin kutsuma signaali liittyy ask_user() metodiin joka pyytää käyttäjältä tekstikoon kerrointa, ja suorittaa sitten skaalauskoodin."
404
405 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:245
406 msgid ""
407 "The magnification code is well commented and fairly simple. The main things "
408 "to note are that you get a reference to the editor window as ``self.gui`` "
409 "and the editor *Boss* as ``self.boss``. The *Boss* is the object that "
410 "controls the editor user interface. It has many useful methods, that are "
411 "documented in the :class:`calibre.gui2.tweak_book.boss.Boss` class."
412 msgstr "Skaalauskoodi on kuvattu perusteellisesti ja aika yksinkertainen. Huomaa erityisesti viittaaminen muokkainikkunaan \"self.gui\":na ja muokkain *Boss*iin \"self.boss\":na. *Boss* on objekti joka ohjaa muokkaimen käyttöliittymää. Sillä on paljon hyödyllisiä metodeja, jotka on kuvattu :class:`calibre.gui2.tweak_book.boss.Boss` luokassa."
413
414 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:251
415 msgid ""
416 "Finally, there is ``self.current_container`` which is a reference to the "
417 "book being edited as a "
418 ":class:`calibre.ebooks.oeb.polish.container.Container` object. This "
419 "represents the book as a collection of its constituent HTML/CSS/image files "
420 "and has convenience methods for doing many useful things. The container "
421 "object and various useful utility functions that can be reused in your "
422 "plugin code are documented in :ref:`polish_api`."
423 msgstr "Lopuksi, \"self.current_container\" joka viittaa muokattavaan kirjaan :class:`calibre.ebooks.oeb.polish.container.Container`-objektina. Sen kautta kirja näkyy kokoelmana HTML/CSS/kuvatiedostojaan, ja sisältää metodeja moniin hyödyllisiin toimintoihin. container-objekti ja käytännöllisiä aputoimintoja joita voit käyttää lisäosakoodissasi on dokumentoitu :ref:`polish_api`:ssa."
424
425 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:259
426 msgid "Adding translations to your plugin"
427 msgstr "Lisätään käännös liitännäiseen"
428
429 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:261
430 msgid ""
431 "You can have all the user interface strings in your plugin translated and "
432 "displayed in whatever language is set for the main calibre user interface."
433 msgstr "Kaikki käyttöliittymätekstit voidaan kääntää ja esittää millä tahansa kielellä jota calibren käyttöliittymä on asetettu käyttämään."
434
435 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:264
436 msgid ""
437 "The first step is to go through your plugin's source code and mark all user "
438 "visible strings as translatable, by surrounding them in _(). For example::"
439 msgstr "Käy ensin läpi lisäosan koodi ja merkitse kaikki teksti käännettäviksi ympäröimällä ne _():lla. Esimerkiksi::"
440
441 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:269
442 msgid ""
443 "Then use some program to generate .po files from your plugin source code. "
444 "There should be one .po file for every language you want to translate into. "
445 "For example: de.po for German, fr.po for French and so on. You can use the "
446 "`Poedit <https://poedit.net/>`_ program for this."
447 msgstr ""
448
449 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:274
450 msgid ""
451 "Send these .po files to your translators. Once you get them back, compile "
452 "them into .mo files. You can again use Poedit for that, or just do::"
453 msgstr ""
454
455 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:279
456 msgid "Put the .mo files into the ``translations`` folder in your plugin."
457 msgstr "Laita .mo-tiedostot lisäosasi \"translations\"-kansioon."
458
459 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:281
460 msgid ""
461 "The last step is to simply call the function `load_translations()` at the "
462 "top of your plugin's .py files. For performance reasons you should only call"
463 " this function in those .py files that actually have translatable strings. "
464 "So in a typical User Interface plugin you would call it at the top of "
465 "``ui.py`` but not ``__init__.py``."
466 msgstr "Viimeinen vaihe on kutsua funktiota `load_translations()` lisäosasi .py-tiedostojen alussa. Suorituskykysyistä tee kutsu vain niissä .py-tiedostoissa joissa on käännettävää tekstiä. Eli tavallisesti kutsuisit käännöstä \"ui.py\":ssä, mutta et \"__init__.py\":ssä."
467
468 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:287
469 msgid ""
470 "You can test the translations of your plugins by changing the user interface"
471 " language in calibre under :guilabel:`Preferences->Interface->Look & feel` "
472 "or by running calibre with the ``CALIBRE_OVERRIDE_LANG`` environment "
473 "variable set. For example::"
474 msgstr ""
475
476 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:293
477 msgid ""
478 "Replace ``de`` with the language code of the language you want to test."
479 msgstr "Korvaa \"de\" haluamasi kielen kielikoodilla."
480
481 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:295
482 msgid ""
483 "For translations with plurals, use the ``ngettext()`` function instead of "
484 "``_()``. For example::"
485 msgstr ""
486
487 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:301
488 msgid "The plugin API"
489 msgstr "Liitännäinen API"
490
491 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:303
492 msgid ""
493 "As you may have noticed above, a plugin in calibre is a class. There are "
494 "different classes for the different types of plugins in calibre. Details on "
495 "each class, including the base class of all plugins can be found in "
496 ":ref:`plugins`."
497 msgstr "Kuten ehkä huomasit, lisäosa on calibressa luokka. Erityyppisille lisöosille on calibressa eri luokat. Lisätietoja luokista löytyy kohdasta :ref:'plugins'."
498
499 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:306
500 msgid ""
501 "Your plugin is almost certainly going to use code from calibre. To learn how"
502 " to find various bits of functionality in the calibre code base, read the "
503 "section on the calibre :ref:`code_layout`."
504 msgstr "Lisäosasi käyttää melko varmasti calibren koodia. Oppiaksesi calibren koodikannan toiminnoista, lue calibren :ref:`code_layout`."
505
506 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:311
507 msgid "Debugging plugins"
508 msgstr "Lisäosien virheenetsintä"
509
510 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:313
511 msgid ""
512 "The first, most important step is to run calibre in debug mode. You can do "
513 "this from the command line with::"
514 msgstr "Ensinnäkin, käynnistä calibre virheenetsintätilassa. Se onnistuu komentoriviltä kutsulla::"
515
516 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:317
517 msgid ""
518 "Or from within calibre by right-clicking the :guilabel:`Preferences` button "
519 "or using the :kbd:`Ctrl+Shift+R` keyboard shortcut."
520 msgstr ""
521
522 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:319
523 msgid ""
524 "When running from the command line, debug output will be printed to the "
525 "console, when running from within calibre the output will go to a txt file."
526 msgstr "Komentoriviltä käynnistettynä virheenetsintäraportti tulostuu komentorivi-ikkunaan, calibren sisällä käynnistettynä raportointi tulee txt-tiedostoon."
527
528 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:321
529 msgid ""
530 "You can insert print statements anywhere in your plugin code, they will be "
531 "output in debug mode. Remember, this is Python, you really shouldn't need "
532 "anything more than print statements to debug ;) I developed all of calibre "
533 "using just this debugging technique."
534 msgstr "Voit asettaa lisäosaasi mihin tahansa print-lausekkeen, jolloin ne tallentuvat virheenetsintätilassa. Muista, tämä on Python, printin pitäisi riittää virheenetsintään ;) Olen rakentanut koko calibren pelkästään sen avulla."
535
536 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:323
537 msgid ""
538 "You can quickly test changes to your plugin by using the following command "
539 "line::"
540 msgstr "Lisäosan muutoksia voi nopeasti testata komentoriviltä näin::"
541
542 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:328
543 msgid ""
544 "This will shutdown a running calibre, wait for the shutdown to complete, "
545 "then update your plugin in calibre and relaunch calibre."
546 msgstr "calibre sammutetaan, sammumisen jälkeen lisäosa päivitetään ja calibre käynnistyy uudestaan."
547
548 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:331
549 msgid "More plugin examples"
550 msgstr "Lisää esimerkkejä liitännäisistä"
551
552 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:333
553 msgid ""
554 "You can find a list of many sophisticated calibre plugins `here "
555 "<https://www.mobileread.com/forums/showthread.php?t=118764>`_."
556 msgstr ""
557
558 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:336
559 msgid "Sharing your plugins with others"
560 msgstr "Jaa liitännäinen "
561
562 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:338
563 msgid ""
564 "If you would like to share the plugins you have created with other users of "
565 "calibre, post your plugin in a new thread in the `calibre plugins forum "
566 "<https://www.mobileread.com/forums/forumdisplay.php?f=237>`_."
567 msgstr "Jos haluat jakaa lisäosasi muille käyttäjille, lataa lisäosasi uuteen ketjuun `calibre plugins forumilla <https://www.mobileread.com/forums/forumdisplay.php?f=237>`_."