| 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 |
# Armin Geller <[email protected]>, 2014 |
| 7 |
# Ettore Atalan <[email protected]>, 2014 |
| 8 |
# ILB, 2014,2025 |
| 9 |
# 3Stadt <[email protected]>, 2016 |
| 10 |
# 75b2456ff925a21e1fb1c9b0eec898b6_dd7fae1 <eacf3b7eb4b0679577492913a01c86b6_200915>, 2015 |
| 11 |
# Simon Schütte, 2014-2016 |
| 12 |
# StefanStern <[email protected]>, 2015 |
| 13 |
# RiseT, 2015-2016 |
| 14 |
# Vo He <[email protected]>, 2021 |
| 15 |
msgid "" |
| 16 |
msgstr "" |
| 17 |
"Project-Id-Version: calibre\n" |
| 18 |
"Report-Msgid-Bugs-To: \n" |
| 19 |
"POT-Creation-Date: 2026-02-17 16:44+0000\n" |
| 20 |
"PO-Revision-Date: 2014-06-17 08:35+0000\n" |
| 21 |
"Last-Translator: ILB, 2014,2025\n" |
| 22 |
"Language-Team: German (http://app.transifex.com/calibre/calibre/language/de/)\n" |
| 23 |
"MIME-Version: 1.0\n" |
| 24 |
"Content-Type: text/plain; charset=UTF-8\n" |
| 25 |
"Content-Transfer-Encoding: 8bit\n" |
| 26 |
"Language: de\n" |
| 27 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n" |
| 28 |
|
| 29 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:4 |
| 30 |
msgid "Writing your own plugins to extend calibre's functionality" |
| 31 |
msgstr "Schreibe Deine eigenen Erweiterungen zur Anpassung von Calibres Funktionalität" |
| 32 |
|
| 33 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:6 |
| 34 |
msgid "" |
| 35 |
"calibre has a very modular design. Almost all functionality in calibre comes" |
| 36 |
" in the form of plugins. Plugins are used for conversion, for downloading " |
| 37 |
"news (though these are called recipes), for various components of the user " |
| 38 |
"interface, to connect to different devices, to process files when adding " |
| 39 |
"them to calibre and so on. You can get a complete list of all the built-in " |
| 40 |
"plugins in calibre by going to :guilabel:`Preferences->Advanced->Plugins`." |
| 41 |
msgstr "Calibre ist Modular aufgebaut. Fast alle Funktionen in Calibre sind mit Plugin's erstellt. Sie werden zum Umwandeln, zum herunterladen von Newsfeeds (dann nennen wir sie Rezepte - recipes), als Teil der Benutzeroberfläche, zum Verbinden zwischen verschiedenen Komponenten, zum Bearbeiten von Dateien beim Import und so weiter genutzt. Eine komplette Liste aller eingebauten Plugin's sehen Sie unter: guilabel:`Preferences->Advanced->Plugins`." |
| 42 |
|
| 43 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:8 |
| 44 |
msgid "" |
| 45 |
"Here, we will teach you how to create your own plugins to add new features " |
| 46 |
"to calibre." |
| 47 |
msgstr "Hier werden Sie lernen, wie Sie ihre eigene Erweiterung erstellen, um neue Funktionen zu |app| hinzuzufügen." |
| 48 |
|
| 49 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:13 |
| 50 |
msgid "Contents" |
| 51 |
msgstr "Inhalte" |
| 52 |
|
| 53 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:15 |
| 54 |
msgid "This only applies to calibre releases >= 0.8.60" |
| 55 |
msgstr "Dies gilt nur für Calibre Versionen >= 0.8.60" |
| 56 |
|
| 57 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:18 |
| 58 |
msgid "Anatomy of a calibre plugin" |
| 59 |
msgstr "Aufbau einer Calibre-Erweiterung" |
| 60 |
|
| 61 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:20 |
| 62 |
msgid "" |
| 63 |
"A calibre plugin is very simple, it's just a ZIP file that contains some " |
| 64 |
"Python code and any other resources like image files needed by the plugin. " |
| 65 |
"Without further ado, let's see a basic example." |
| 66 |
msgstr "Ein Calibre Plugin ist sehr einfach. Es besteht aus einer Zip-Datei, die eine Python - (vgl. Programmiersprache) Datei und weiteren Teilen die dafür notwendig sind - wie Bilder - enthält.\nAm besten Sie sehen sich ein Beispiel an." |
| 67 |
|
| 68 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:24 |
| 69 |
msgid "" |
| 70 |
"Suppose you have an installation of calibre that you are using to self " |
| 71 |
"publish various e-documents in EPUB and MOBI formats. You would like all " |
| 72 |
"files generated by calibre to have their publisher set as \"Hello world\", " |
| 73 |
"here's how to do it. Create a file named :file:`__init__.py` (this is a " |
| 74 |
"special name and must always be used for the main file of your plugin) and " |
| 75 |
"enter the following Python code into it:" |
| 76 |
msgstr "Angenommen Sie haben eine Installation von Calibre die Sie dafür nutzen eigene e-Dokumente im EPUB und MOBI format zu publizieren. Für alle Ihre Dateien soll Calibre den 'publisher' -Metatag auf 'Hello world' setzen. Unten sehen Sie wie das gemacht wird. \nErstellen Sie eine (Text-) Datei mit dem Namen file:`__init__.py` (Diese Bezeichnung muß jedem Plugin als Dateiname gegeben werden) öffnen Sie die Datei in einem Editor und schreiben Sie folgenden Programmcode hinein:" |
| 77 |
|
| 78 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:32 |
| 79 |
msgid "" |
| 80 |
"That's all. To add this code to calibre as a plugin, simply run the " |
| 81 |
"following in the folder in which you created :file:`__init__.py`::" |
| 82 |
msgstr "Das war es schon. Um dieses kleine Programm nun als Plugin zu Calibre hinzuzufügen, wechseln Sie in den Ordner Ihrer kleinen Datei und führen Sie folgenden Befehl (auf der Komandozeile) aus.:" |
| 83 |
|
| 84 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:38 |
| 85 |
msgid "" |
| 86 |
"On macOS, the command line tools are inside the calibre bundle, for example," |
| 87 |
" if you installed calibre in :file:`/Applications` the command line tools " |
| 88 |
"are in :file:`/Applications/calibre.app/Contents/MacOS/`." |
| 89 |
msgstr "Für macOS sind die Komandozeilentools in Calibre integriert. Sollte Calibre z.B. in :file:`/Applications` installiert sein, dann finden Sie die Tools unter :file:`/Applications/calibre.app/Contents/MacOS/`." |
| 90 |
|
| 91 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:42 |
| 92 |
msgid "" |
| 93 |
"You can download the Hello World plugin from " |
| 94 |
":download_file:`helloworld_plugin.zip`." |
| 95 |
msgstr "" |
| 96 |
|
| 97 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:45 |
| 98 |
msgid "" |
| 99 |
"Every time you use calibre to convert a book, the plugin's :meth:`run` " |
| 100 |
"method will be called and the converted book will have its publisher set to " |
| 101 |
"\"Hello World\". This is a trivial plugin, let's move on to a more complex " |
| 102 |
"example that actually adds a component to the user interface." |
| 103 |
msgstr "" |
| 104 |
|
| 105 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:50 |
| 106 |
msgid "A User Interface plugin" |
| 107 |
msgstr "Ein Benutzeroberflächen-Plugin" |
| 108 |
|
| 109 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:52 |
| 110 |
msgid "" |
| 111 |
"This plugin will be spread over a few files (to keep the code clean). It " |
| 112 |
"will show you how to get resources (images or data files) from the plugin " |
| 113 |
"ZIP file, allow users to configure your plugin, how to create elements in " |
| 114 |
"the calibre user interface and how to access and query the books database in" |
| 115 |
" calibre." |
| 116 |
msgstr "Diese Plugin wir auf ein paar Dateien verteilt (damit die einzelnen Teile überschaubar bleiben). Sie erkennen daran wie Sie auf, in der Plugin-Datei enthaltene, Resourcen (Bilder oder Daten) zugreifen, Nutzern erlauben Ihr Plugin zu konfigurieren, wie Sie Elemente der Benutzeroberfläche erstellen und wie Sie die Datenbank der Bücher in Calibre ansprechen und darin suchen." |
| 117 |
|
| 118 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:57 |
| 119 |
msgid "" |
| 120 |
"You can download this plugin from :download_file:`interface_demo_plugin.zip`" |
| 121 |
msgstr "" |
| 122 |
|
| 123 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:61 |
| 124 |
msgid "" |
| 125 |
"The first thing to note is that this ZIP file has a lot more files in it, " |
| 126 |
"explained below, pay particular attention to ``plugin-import-name-" |
| 127 |
"interface_demo.txt``." |
| 128 |
msgstr "Wichtig ist das die ZIP-Datei, die Ihr Plugin ist, nicht ganz wenige Dateien enthält. Unten sehen Sie eine Beschreibung achten Sie besonders auf ``plugin-import-name-interface_demo.txt``." |
| 129 |
|
| 130 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:64 |
| 131 |
msgid "**plugin-import-name-interface_demo.txt**" |
| 132 |
msgstr "**plugin-import-name-interface_demo.txt**" |
| 133 |
|
| 134 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:65 |
| 135 |
msgid "" |
| 136 |
"An empty text file used to enable the multi-file plugin magic. This file " |
| 137 |
"must be present in all plugins that use more than one .py file. It should be" |
| 138 |
" empty and its filename must be of the form: ``plugin-import-" |
| 139 |
"name-**some_name**.txt``. The presence of this file allows you to import " |
| 140 |
"code from the .py files present inside the ZIP file, using a statement " |
| 141 |
"like::" |
| 142 |
msgstr "Um in einem Plugin mehrere (Programm-) Dateien zu nutzen (Module nennt man das in Python) müssen diese einem genauen Namensschema entsprechen. Die Datei an sich hat keinen Inhalt. Die Form des Dateinamens ist : ``plugin-import-name-**some_name**.txt``. \nImmer wenn in der ZIP-Datei eine solche Datei existiert können Sie innerhalb des Plugins Programmcode aus allen anderen enthaltenen .py Dateien auf folgende Art nutzen:" |
| 143 |
|
| 144 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:71 |
| 145 |
msgid "" |
| 146 |
"The prefix ``calibre_plugins`` must always be present. ``some_name`` comes " |
| 147 |
"from the filename of the empty text file. ``some_module`` refers to " |
| 148 |
":file:`some_module.py` file inside the ZIP file. Note that this importing is" |
| 149 |
" just as powerful as regular Python imports. You can create packages and " |
| 150 |
"subpackages of .py modules inside the ZIP file, just like you would normally" |
| 151 |
" (by defining __init__.py in each sub-folder), and everything should \"just " |
| 152 |
"work\"." |
| 153 |
msgstr "" |
| 154 |
|
| 155 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:76 |
| 156 |
msgid "" |
| 157 |
"The name you use for ``some_name`` enters a global namespace shared by all " |
| 158 |
"plugins, **so make it as unique as possible**. But remember that it must be " |
| 159 |
"a valid Python identifier (only alphabets, numbers and the underscore)." |
| 160 |
msgstr "Der Name den Sie für eine Datei bei ``some_name`` wählen, ist in allen Plugins verfügbar und damit global! Er sollte natürlich nicht schon vorhanden sein, da Sie ansonsten die schon vorhandenen Funktionen ersetzen. Wählen Sie also den Name möglichst eindeutig und \"beschreibend\" aus. Zusätzlich muss der Name den Python vorschriften entsprechen: Nur Buchstaben, Nummern und der Unterstrich sind erlaubt." |
| 161 |
|
| 162 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:79 |
| 163 |
msgid "**__init__.py**" |
| 164 |
msgstr "**__init__.py**" |
| 165 |
|
| 166 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:80 |
| 167 |
msgid "As before, the file that defines the plugin class" |
| 168 |
msgstr "Wie schon zuvor ist das eine Datei, die eine Plugin Klasse definiert" |
| 169 |
|
| 170 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:82 |
| 171 |
msgid "**main.py**" |
| 172 |
msgstr "**main.py**" |
| 173 |
|
| 174 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:83 |
| 175 |
msgid "This file contains the actual code that does something useful" |
| 176 |
msgstr "Diese Datei enthält den eigentlichen Code, der etwas nützliches tut" |
| 177 |
|
| 178 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:85 |
| 179 |
msgid "**ui.py**" |
| 180 |
msgstr "**ui.py**" |
| 181 |
|
| 182 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:86 |
| 183 |
msgid "This file defines the interface part of the plugin" |
| 184 |
msgstr "Diese Datei definiert das Benutzer Interface des Plugin's" |
| 185 |
|
| 186 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:88 |
| 187 |
msgid "**images/icon.png**" |
| 188 |
msgstr "**images/icon.png**" |
| 189 |
|
| 190 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:89 |
| 191 |
msgid "The icon for this plugin" |
| 192 |
msgstr "Das Symbol für diese Erweiterung" |
| 193 |
|
| 194 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:91 |
| 195 |
msgid "**about.txt**" |
| 196 |
msgstr "**about.txt**" |
| 197 |
|
| 198 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:92 |
| 199 |
msgid "A text file with information about the plugin" |
| 200 |
msgstr "Eine Textdatei mit einer Beschreibung des Plugin" |
| 201 |
|
| 202 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:94 |
| 203 |
msgid "**translations**" |
| 204 |
msgstr "**translations**" |
| 205 |
|
| 206 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:95 |
| 207 |
msgid "" |
| 208 |
"A folder containing .mo files with the translations of the user interface of" |
| 209 |
" your plugin into different languages. See below for details." |
| 210 |
msgstr "Ein Ordner, der .mo-Dateien mit Übersetzungen der Benutzeroberfläche Ihrer Erweiterung in verschiedenen Sprachen enthält. Details nachfolgend." |
| 211 |
|
| 212 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:99 |
| 213 |
msgid "Now let's look at the code." |
| 214 |
msgstr "Nun ein Blick auf den Code." |
| 215 |
|
| 216 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:102 |
| 217 |
msgid "__init__.py" |
| 218 |
msgstr "__init__.py" |
| 219 |
|
| 220 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:104 |
| 221 |
msgid "First, the obligatory ``__init__.py`` to define the plugin metadata:" |
| 222 |
msgstr "Zuerst die obligatorische ``__init__.py`, in dieser werden plugin metadaten gesetzt." |
| 223 |
|
| 224 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:109 |
| 225 |
msgid "" |
| 226 |
"The only noteworthy feature is the field :attr:`actual_plugin`. Since " |
| 227 |
"calibre has both command line and GUI interfaces, GUI plugins like this one " |
| 228 |
"should not load any GUI libraries in __init__.py. The actual_plugin field " |
| 229 |
"does this for you, by telling calibre that the actual plugin is to be found " |
| 230 |
"in another file inside your ZIP archive, which will only be loaded in a GUI " |
| 231 |
"context." |
| 232 |
msgstr "Das einzig erwähnenswerte Datum hier ist das Datenfeld :attr:`actual_plugin`. Da Calibre sowohl ein Komandozeilen- als auch ein grafisches Interface hat, sollte nicht gleich in der ersten Datei schon eine grafische Schnittstelle geladen werden. Das Feld \"actual_plugin\" weist darauf hin das sich eben dort ein User Interface befindet. Dieses wird eben nur dann ausgeführt, wenn das Plugin innerhalb der grafischen Oberfläche gestartet wird." |
| 233 |
|
| 234 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:114 |
| 235 |
msgid "" |
| 236 |
"Remember that for this to work, you must have a plugin-import-name-" |
| 237 |
"some_name.txt file in your plugin ZIP file, as discussed above." |
| 238 |
msgstr "Denke daran, damit das funktionieren kann, muß in der Plugin - ZIP- Datei eine Datei mit dem Namen wie: plugin-import-name-some_name.txt file enthalten sein, wie weiter oben gezeigt." |
| 239 |
|
| 240 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:117 |
| 241 |
msgid "" |
| 242 |
"Also there are a couple of methods for enabling user configuration of the " |
| 243 |
"plugin. These are discussed below." |
| 244 |
msgstr "Zudem gibt es ein paar Methoden die das Konfigurieren des Plugin durch die Nutzer ermöglichen. Wie das geht erfahren Sie weiter unten." |
| 245 |
|
| 246 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:120 |
| 247 |
msgid "ui.py" |
| 248 |
msgstr "ui.py" |
| 249 |
|
| 250 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:122 |
| 251 |
msgid "" |
| 252 |
"Now let's look at ui.py which defines the actual GUI plugin. The source code" |
| 253 |
" is heavily commented and should be self explanatory:" |
| 254 |
msgstr "Schauen Sie nun die Datei ui.py an. In dieser definieren Sie wie eine grafische Benutzeroberfläche Ihres Plugin aussehen wird. Der Sourcecode (Quellcode) ist sehr gut kommentiert und sollte selbsterklärend sein:" |
| 255 |
|
| 256 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:128 |
| 257 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:220 |
| 258 |
msgid "main.py" |
| 259 |
msgstr "main.py" |
| 260 |
|
| 261 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:130 |
| 262 |
msgid "The actual logic to implement the Interface Plugin Demo dialog." |
| 263 |
msgstr "Die aktuelle Logik um das Benutzerinterface für einen Plugin Demo Dialog zu implementieren." |
| 264 |
|
| 265 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:136 |
| 266 |
msgid "Getting resources from the plugin ZIP file" |
| 267 |
msgstr "Ressourcen aus der Plugin ZIP-Datei nutzen" |
| 268 |
|
| 269 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:138 |
| 270 |
msgid "" |
| 271 |
"calibre's plugin loading system defines a couple of built-in functions that " |
| 272 |
"allow you to conveniently get files from the plugin ZIP file." |
| 273 |
msgstr "Calibres Plugin 'loading system' stellt eine Reihe von eingebauten Funktionen bereit, mit denen man Dateien und Inhalte aus der Plugin ZIP-Datei bekommt." |
| 274 |
|
| 275 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:140 |
| 276 |
msgid "**get_resources(name_or_list_of_names)**" |
| 277 |
msgstr "**get_resources(name_or_list_of_names)**" |
| 278 |
|
| 279 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:141 |
| 280 |
msgid "" |
| 281 |
"This function should be called with a list of paths to files inside the ZIP " |
| 282 |
"file. For example to access the file :file:`icon.png` in the folder images " |
| 283 |
"in the ZIP file, you would use: ``images/icon.png``. Always use a forward " |
| 284 |
"slash as the path separator, even on Windows. When you pass in a single " |
| 285 |
"name, the function will return the raw bytes of that file or None if the " |
| 286 |
"name was not found in the ZIP file. If you pass in more than one name then " |
| 287 |
"it returns a dictionary mapping the names to bytes. If a name is not found," |
| 288 |
" it will not be present in the returned dictionary." |
| 289 |
msgstr "" |
| 290 |
|
| 291 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:150 |
| 292 |
msgid "**get_icons(name_or_list_of_names, plugin_name='')**" |
| 293 |
msgstr "" |
| 294 |
|
| 295 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:151 |
| 296 |
msgid "" |
| 297 |
"A wrapper for get_resources() that creates QIcon objects from the raw bytes " |
| 298 |
"returned by get_resources. If a name is not found in the ZIP file the " |
| 299 |
"corresponding QIcon will be null. In order to support icon theme-ing, pass " |
| 300 |
"in the human friendly name of your plugin as ``plugin_name``. If the user is" |
| 301 |
" using an icon theme with icons for your plugin, they will be loaded " |
| 302 |
"preferentially." |
| 303 |
msgstr "" |
| 304 |
|
| 305 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:160 |
| 306 |
msgid "Enabling user configuration of your plugin" |
| 307 |
msgstr "Benutzer-Einstellungen des Plug-Ins aktivieren " |
| 308 |
|
| 309 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:162 |
| 310 |
msgid "" |
| 311 |
"To allow users to configure your plugin, you must define three methods in " |
| 312 |
"your base plugin class, **is_customizable**, **config_widget** and " |
| 313 |
"**save_settings** as shown below:" |
| 314 |
msgstr "" |
| 315 |
|
| 316 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:173 |
| 317 |
msgid "" |
| 318 |
"calibre has many different ways to store configuration data (a legacy of its" |
| 319 |
" long history). The recommended way is to use the **JSONConfig** class, " |
| 320 |
"which stores your configuration information in a .json file." |
| 321 |
msgstr "" |
| 322 |
|
| 323 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:175 |
| 324 |
msgid "" |
| 325 |
"The code to manage configuration data in the demo plugin is in config.py:" |
| 326 |
msgstr "" |
| 327 |
|
| 328 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:180 |
| 329 |
msgid "" |
| 330 |
"The ``prefs`` object is now available throughout the plugin code by a " |
| 331 |
"simple::" |
| 332 |
msgstr "Das ``prefs``-Objekt ist nun überall im gesamten Erweiterungs-Code verfügbar über ein einfaches::" |
| 333 |
|
| 334 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:185 |
| 335 |
msgid "You can see the ``prefs`` object being used in main.py:" |
| 336 |
msgstr "" |
| 337 |
|
| 338 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:192 |
| 339 |
msgid "Edit book plugins" |
| 340 |
msgstr "Buch-Plug-In bearbeiten" |
| 341 |
|
| 342 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:194 |
| 343 |
msgid "" |
| 344 |
"Now let's change gears for a bit and look at creating a plugin to add tools " |
| 345 |
"to the calibre book editor. The plugin is available here: " |
| 346 |
":download_file:`editor_demo_plugin.zip`." |
| 347 |
msgstr "" |
| 348 |
|
| 349 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:198 |
| 350 |
msgid "" |
| 351 |
"The first step, as for all plugins is to create the import name empty txt " |
| 352 |
"file, as described :ref:`above <import_name_txt>`. We shall name the file " |
| 353 |
"``plugin-import-name-editor_plugin_demo.txt``." |
| 354 |
msgstr "" |
| 355 |
|
| 356 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:202 |
| 357 |
msgid "" |
| 358 |
"Now we create the mandatory ``__init__.py`` file that contains metadata " |
| 359 |
"about the plugin -- its name, author, version, etc." |
| 360 |
msgstr "" |
| 361 |
|
| 362 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:208 |
| 363 |
msgid "" |
| 364 |
"A single editor plugin can provide multiple tools each tool corresponds to a" |
| 365 |
" single button in the toolbar and entry in the :guilabel:`Plugins` menu in " |
| 366 |
"the editor. These can have sub-menus in case the tool has multiple related " |
| 367 |
"actions." |
| 368 |
msgstr "" |
| 369 |
|
| 370 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:212 |
| 371 |
msgid "" |
| 372 |
"The tools must all be defined in the file ``main.py`` in your plugin. Every " |
| 373 |
"tool is a class that inherits from the " |
| 374 |
":class:`calibre.gui2.tweak_book.plugin.Tool` class. Let's look at " |
| 375 |
"``main.py`` from the demo plugin, the source code is heavily commented and " |
| 376 |
"should be self-explanatory. Read the API documents of the " |
| 377 |
":class:`calibre.gui2.tweak_book.plugin.Tool` class for more details." |
| 378 |
msgstr "" |
| 379 |
|
| 380 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:222 |
| 381 |
msgid "" |
| 382 |
"Here we will see the definition of a single tool that will multiply all font" |
| 383 |
" sizes in the book by a number provided by the user. This tool demonstrates " |
| 384 |
"various important concepts that you will need in developing your own " |
| 385 |
"plugins, so you should read the (heavily commented) source code carefully." |
| 386 |
msgstr "" |
| 387 |
|
| 388 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:230 |
| 389 |
msgid "" |
| 390 |
"Let's break down ``main.py``. We see that it defines a single tool, named " |
| 391 |
"*Magnify fonts*. This tool will ask the user for a number and multiply all " |
| 392 |
"font sizes in the book by that number." |
| 393 |
msgstr "" |
| 394 |
|
| 395 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:234 |
| 396 |
msgid "" |
| 397 |
"The first important thing is the tool name which you must set to some " |
| 398 |
"relatively unique string as it will be used as the key for this tool." |
| 399 |
msgstr "" |
| 400 |
|
| 401 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:237 |
| 402 |
msgid "" |
| 403 |
"The next important entry point is the " |
| 404 |
":meth:`calibre.gui2.tweak_book.plugin.Tool.create_action`. This method " |
| 405 |
"creates the QAction objects that appear in the plugins toolbar and plugin " |
| 406 |
"menu. It also, optionally, assigns a keyboard shortcut that the user can " |
| 407 |
"customize. The triggered signal from the QAction is connected to the " |
| 408 |
"ask_user() method that asks the user for the font size multiplier, and then " |
| 409 |
"runs the magnification code." |
| 410 |
msgstr "" |
| 411 |
|
| 412 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:245 |
| 413 |
msgid "" |
| 414 |
"The magnification code is well commented and fairly simple. The main things " |
| 415 |
"to note are that you get a reference to the editor window as ``self.gui`` " |
| 416 |
"and the editor *Boss* as ``self.boss``. The *Boss* is the object that " |
| 417 |
"controls the editor user interface. It has many useful methods, that are " |
| 418 |
"documented in the :class:`calibre.gui2.tweak_book.boss.Boss` class." |
| 419 |
msgstr "" |
| 420 |
|
| 421 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:251 |
| 422 |
msgid "" |
| 423 |
"Finally, there is ``self.current_container`` which is a reference to the " |
| 424 |
"book being edited as a " |
| 425 |
":class:`calibre.ebooks.oeb.polish.container.Container` object. This " |
| 426 |
"represents the book as a collection of its constituent HTML/CSS/image files " |
| 427 |
"and has convenience methods for doing many useful things. The container " |
| 428 |
"object and various useful utility functions that can be reused in your " |
| 429 |
"plugin code are documented in :ref:`polish_api`." |
| 430 |
msgstr "" |
| 431 |
|
| 432 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:259 |
| 433 |
msgid "Adding translations to your plugin" |
| 434 |
msgstr "Hinzufügen von Übersetzungen zu Ihrer Erweiterung" |
| 435 |
|
| 436 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:261 |
| 437 |
msgid "" |
| 438 |
"You can have all the user interface strings in your plugin translated and " |
| 439 |
"displayed in whatever language is set for the main calibre user interface." |
| 440 |
msgstr "" |
| 441 |
|
| 442 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:264 |
| 443 |
msgid "" |
| 444 |
"The first step is to go through your plugin's source code and mark all user " |
| 445 |
"visible strings as translatable, by surrounding them in _(). For example::" |
| 446 |
msgstr "" |
| 447 |
|
| 448 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:269 |
| 449 |
msgid "" |
| 450 |
"Then use some program to generate .po files from your plugin source code. " |
| 451 |
"There should be one .po file for every language you want to translate into. " |
| 452 |
"For example: de.po for German, fr.po for French and so on. You can use the " |
| 453 |
"`Poedit <https://poedit.net/>`_ program for this." |
| 454 |
msgstr "" |
| 455 |
|
| 456 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:274 |
| 457 |
msgid "" |
| 458 |
"Send these .po files to your translators. Once you get them back, compile " |
| 459 |
"them into .mo files. You can again use Poedit for that, or just do::" |
| 460 |
msgstr "" |
| 461 |
|
| 462 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:279 |
| 463 |
msgid "Put the .mo files into the ``translations`` folder in your plugin." |
| 464 |
msgstr "Verschieben Sie die .mo-Dateien in den ``translations``-Ordner Ihrer Erweiterung." |
| 465 |
|
| 466 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:281 |
| 467 |
msgid "" |
| 468 |
"The last step is to simply call the function `load_translations()` at the " |
| 469 |
"top of your plugin's .py files. For performance reasons you should only call" |
| 470 |
" this function in those .py files that actually have translatable strings. " |
| 471 |
"So in a typical User Interface plugin you would call it at the top of " |
| 472 |
"``ui.py`` but not ``__init__.py``." |
| 473 |
msgstr "" |
| 474 |
|
| 475 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:287 |
| 476 |
msgid "" |
| 477 |
"You can test the translations of your plugins by changing the user interface" |
| 478 |
" language in calibre under :guilabel:`Preferences->Interface->Look & feel` " |
| 479 |
"or by running calibre with the ``CALIBRE_OVERRIDE_LANG`` environment " |
| 480 |
"variable set. For example::" |
| 481 |
msgstr "" |
| 482 |
|
| 483 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:293 |
| 484 |
msgid "" |
| 485 |
"Replace ``de`` with the language code of the language you want to test." |
| 486 |
msgstr "\"de\" mit dem Sprachcode der zu testenden Sprache ersetzen." |
| 487 |
|
| 488 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:295 |
| 489 |
msgid "" |
| 490 |
"For translations with plurals, use the ``ngettext()`` function instead of " |
| 491 |
"``_()``. For example::" |
| 492 |
msgstr "" |
| 493 |
|
| 494 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:301 |
| 495 |
msgid "The plugin API" |
| 496 |
msgstr "Die Erweiterungs-API" |
| 497 |
|
| 498 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:303 |
| 499 |
msgid "" |
| 500 |
"As you may have noticed above, a plugin in calibre is a class. There are " |
| 501 |
"different classes for the different types of plugins in calibre. Details on " |
| 502 |
"each class, including the base class of all plugins can be found in " |
| 503 |
":ref:`plugins`." |
| 504 |
msgstr "" |
| 505 |
|
| 506 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:306 |
| 507 |
msgid "" |
| 508 |
"Your plugin is almost certainly going to use code from calibre. To learn how" |
| 509 |
" to find various bits of functionality in the calibre code base, read the " |
| 510 |
"section on the calibre :ref:`code_layout`." |
| 511 |
msgstr "" |
| 512 |
|
| 513 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:311 |
| 514 |
msgid "Debugging plugins" |
| 515 |
msgstr "Fehlerdiagnose bei Erweiterungen" |
| 516 |
|
| 517 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:313 |
| 518 |
msgid "" |
| 519 |
"The first, most important step is to run calibre in debug mode. You can do " |
| 520 |
"this from the command line with::" |
| 521 |
msgstr "" |
| 522 |
|
| 523 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:317 |
| 524 |
msgid "" |
| 525 |
"Or from within calibre by right-clicking the :guilabel:`Preferences` button " |
| 526 |
"or using the :kbd:`Ctrl+Shift+R` keyboard shortcut." |
| 527 |
msgstr "" |
| 528 |
|
| 529 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:319 |
| 530 |
msgid "" |
| 531 |
"When running from the command line, debug output will be printed to the " |
| 532 |
"console, when running from within calibre the output will go to a txt file." |
| 533 |
msgstr "" |
| 534 |
|
| 535 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:321 |
| 536 |
msgid "" |
| 537 |
"You can insert print statements anywhere in your plugin code, they will be " |
| 538 |
"output in debug mode. Remember, this is Python, you really shouldn't need " |
| 539 |
"anything more than print statements to debug ;) I developed all of calibre " |
| 540 |
"using just this debugging technique." |
| 541 |
msgstr "" |
| 542 |
|
| 543 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:323 |
| 544 |
msgid "" |
| 545 |
"You can quickly test changes to your plugin by using the following command " |
| 546 |
"line::" |
| 547 |
msgstr "" |
| 548 |
|
| 549 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:328 |
| 550 |
msgid "" |
| 551 |
"This will shutdown a running calibre, wait for the shutdown to complete, " |
| 552 |
"then update your plugin in calibre and relaunch calibre." |
| 553 |
msgstr "Damit wird das laufende Calibre Programm beendet. Warten Sie, bis sich Calibre vollständig beendet hat. Dann aktualisieren Sie Ihre Erweiterung und starten Calibre neu." |
| 554 |
|
| 555 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:331 |
| 556 |
msgid "More plugin examples" |
| 557 |
msgstr "Weitere Erweiterungs-Beispiele" |
| 558 |
|
| 559 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:333 |
| 560 |
msgid "" |
| 561 |
"You can find a list of many sophisticated calibre plugins `here " |
| 562 |
"<https://www.mobileread.com/forums/showthread.php?t=118764>`_." |
| 563 |
msgstr "" |
| 564 |
|
| 565 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:336 |
| 566 |
msgid "Sharing your plugins with others" |
| 567 |
msgstr "Teilen Ihrer Erweiterungen mit anderen" |
| 568 |
|
| 569 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:338 |
| 570 |
msgid "" |
| 571 |
"If you would like to share the plugins you have created with other users of " |
| 572 |
"calibre, post your plugin in a new thread in the `calibre plugins forum " |
| 573 |
"<https://www.mobileread.com/forums/forumdisplay.php?f=237>`_." |
| 574 |
msgstr "" |