| 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 |
msgid "" |
| 7 |
msgstr "" |
| 8 |
"Project-Id-Version: calibre\n" |
| 9 |
"Report-Msgid-Bugs-To: \n" |
| 10 |
"POT-Creation-Date: 2026-02-17 16:44+0000\n" |
| 11 |
"PO-Revision-Date: 2014-06-17 08:35+0000\n" |
| 12 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
| 13 |
"Language-Team: French (Canada) (http://app.transifex.com/calibre/calibre/language/fr_CA/)\n" |
| 14 |
"MIME-Version: 1.0\n" |
| 15 |
"Content-Type: text/plain; charset=UTF-8\n" |
| 16 |
"Content-Transfer-Encoding: 8bit\n" |
| 17 |
"Language: fr_CA\n" |
| 18 |
"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" |
| 19 |
|
| 20 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:4 |
| 21 |
msgid "Writing your own plugins to extend calibre's functionality" |
| 22 |
msgstr "Écrire vos propres extensions pour étendre les fonctionnalités de calibre" |
| 23 |
|
| 24 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:6 |
| 25 |
msgid "" |
| 26 |
"calibre has a very modular design. Almost all functionality in calibre comes" |
| 27 |
" in the form of plugins. Plugins are used for conversion, for downloading " |
| 28 |
"news (though these are called recipes), for various components of the user " |
| 29 |
"interface, to connect to different devices, to process files when adding " |
| 30 |
"them to calibre and so on. You can get a complete list of all the built-in " |
| 31 |
"plugins in calibre by going to :guilabel:`Preferences->Advanced->Plugins`." |
| 32 |
msgstr "calibre a un design hautement modulaire. Presque toutes les fonctionnalités dans calibre viennent sous la forme d'extensions. Les extensions sont utilisées pour la conversion, pour télécharger des actualités (bien que celles-ci s'appellent des recettes), pour divers composants de l'interface utilisateur, pour connecter différents périphériques, pour traiter les fichiers lorsque vous les ajouter à calibre. Vous pouvez obtenir une liste complète de toutes les extensions intégrées dans calibre en allant à :guilabel:`Préférences->Avancé->Extensions`." |
| 33 |
|
| 34 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:8 |
| 35 |
msgid "" |
| 36 |
"Here, we will teach you how to create your own plugins to add new features " |
| 37 |
"to calibre." |
| 38 |
msgstr "Ici, nous vous apprendrons comment créer vos propres extensions pour ajouter de nouvelles fonctionnalités à calibre." |
| 39 |
|
| 40 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:13 |
| 41 |
msgid "Contents" |
| 42 |
msgstr "Contenu" |
| 43 |
|
| 44 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:15 |
| 45 |
msgid "This only applies to calibre releases >= 0.8.60" |
| 46 |
msgstr "Ceci s'applique uniquement aux versions de calibre >=0.8.60" |
| 47 |
|
| 48 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:18 |
| 49 |
msgid "Anatomy of a calibre plugin" |
| 50 |
msgstr "Anatomie d'une extension calibre" |
| 51 |
|
| 52 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:20 |
| 53 |
msgid "" |
| 54 |
"A calibre plugin is very simple, it's just a ZIP file that contains some " |
| 55 |
"Python code and any other resources like image files needed by the plugin. " |
| 56 |
"Without further ado, let's see a basic example." |
| 57 |
msgstr "Une extension calibre est très simple, c'est juste un fichier ZIP qui contient un peu de code Python et toutes les autres ressources comme les fichiers images nécessaires à l'extension. Sans plus tarder, voyons un exemple basique." |
| 58 |
|
| 59 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:24 |
| 60 |
msgid "" |
| 61 |
"Suppose you have an installation of calibre that you are using to self " |
| 62 |
"publish various e-documents in EPUB and MOBI formats. You would like all " |
| 63 |
"files generated by calibre to have their publisher set as \"Hello world\", " |
| 64 |
"here's how to do it. Create a file named :file:`__init__.py` (this is a " |
| 65 |
"special name and must always be used for the main file of your plugin) and " |
| 66 |
"enter the following Python code into it:" |
| 67 |
msgstr "Supposons que vous avez une installation de calibre que vous utilisez pour l'auto publication de divers e-documents aux formats EPUB et MOBI. Vous aimeriez que tous les fichiers générés par calibre aient leur éditeur paramétré à *Salut le monde*, voici comment faire. Créez un fichier nommé :file:`__init__.py` (c'est un nom spécial et doit toujours être utilisé pour le fichier principal de votre extension) entrez-y le code Python suivant :" |
| 68 |
|
| 69 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:32 |
| 70 |
msgid "" |
| 71 |
"That's all. To add this code to calibre as a plugin, simply run the " |
| 72 |
"following in the folder in which you created :file:`__init__.py`::" |
| 73 |
msgstr "C'est tout. Pour ajouter ce code à calibre en tant qu'extension, exécuter simplement ce qui suit dans le dossier dans lequel vous avez créé :file:`__init__.py`::" |
| 74 |
|
| 75 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:38 |
| 76 |
msgid "" |
| 77 |
"On macOS, the command line tools are inside the calibre bundle, for example," |
| 78 |
" if you installed calibre in :file:`/Applications` the command line tools " |
| 79 |
"are in :file:`/Applications/calibre.app/Contents/MacOS/`." |
| 80 |
msgstr "Sous macOS, les outils en de ligne de commande sont à l'intérieur de la suite logicielle calibre, par exemple, si vous installez calibre dans :file:`/Applications` les outils de ligne de commande sont dans :file:`/Applications/calibre.app/Contents/MacOS/`." |
| 81 |
|
| 82 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:42 |
| 83 |
msgid "" |
| 84 |
"You can download the Hello World plugin from " |
| 85 |
":download_file:`helloworld_plugin.zip`." |
| 86 |
msgstr "Vous pouvez télécharger le plugin Hello World depuis :download_file:`helloworld_plugin.zip`." |
| 87 |
|
| 88 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:45 |
| 89 |
msgid "" |
| 90 |
"Every time you use calibre to convert a book, the plugin's :meth:`run` " |
| 91 |
"method will be called and the converted book will have its publisher set to " |
| 92 |
"\"Hello World\". This is a trivial plugin, let's move on to a more complex " |
| 93 |
"example that actually adds a component to the user interface." |
| 94 |
msgstr "" |
| 95 |
|
| 96 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:50 |
| 97 |
msgid "A User Interface plugin" |
| 98 |
msgstr "Une extension d'Interface Utilisateur" |
| 99 |
|
| 100 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:52 |
| 101 |
msgid "" |
| 102 |
"This plugin will be spread over a few files (to keep the code clean). It " |
| 103 |
"will show you how to get resources (images or data files) from the plugin " |
| 104 |
"ZIP file, allow users to configure your plugin, how to create elements in " |
| 105 |
"the calibre user interface and how to access and query the books database in" |
| 106 |
" calibre." |
| 107 |
msgstr "Cette extension sera répartie sur quelques fichiers (pour maintenir le code propre). Il vous montrera comment obtenir des ressources (des fichiers d'images ou de données) à partir du fichier extension ZIP, permettra à des utilisateurs de configurer votre extension, comment créer des éléments dans l'Interface Utilisateur de calibre et comment accéder et questionner la base de données de livres de calibre." |
| 108 |
|
| 109 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:57 |
| 110 |
msgid "" |
| 111 |
"You can download this plugin from :download_file:`interface_demo_plugin.zip`" |
| 112 |
msgstr "Vous pouvez télécharger ce plugin à partir de :download_file:`interface_demo_plugin.zip`." |
| 113 |
|
| 114 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:61 |
| 115 |
msgid "" |
| 116 |
"The first thing to note is that this ZIP file has a lot more files in it, " |
| 117 |
"explained below, pay particular attention to ``plugin-import-name-" |
| 118 |
"interface_demo.txt``." |
| 119 |
msgstr "La première chose à noter est que le fichier ZIP contient beaucoup plus de fichiers, expliqués ci-dessous, prêtez particulièrement attention à ``plugin-import-name-interface_demo.txt``." |
| 120 |
|
| 121 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:64 |
| 122 |
msgid "**plugin-import-name-interface_demo.txt**" |
| 123 |
msgstr "**plugin-import-name-interface_demo.txt**" |
| 124 |
|
| 125 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:65 |
| 126 |
msgid "" |
| 127 |
"An empty text file used to enable the multi-file plugin magic. This file " |
| 128 |
"must be present in all plugins that use more than one .py file. It should be" |
| 129 |
" empty and its filename must be of the form: ``plugin-import-" |
| 130 |
"name-**some_name**.txt``. The presence of this file allows you to import " |
| 131 |
"code from the .py files present inside the ZIP file, using a statement " |
| 132 |
"like::" |
| 133 |
msgstr "Un fichier texte vide utilisé pour activer la magie de l'extension multi fichiers. Ce fichier doit être présent dans toutes les extensions qui utilisent plus d'un fichier .py. Il devra être vide et son nom de fichier doit être de la forme : plugin-import-name-**un_nom**.txt. La présence de ce fichier vous permet d'importer du code à partir de fichiers .py présents à l'intérieur du fichier ZIP, utilisant une déclaration comme::" |
| 134 |
|
| 135 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:71 |
| 136 |
msgid "" |
| 137 |
"The prefix ``calibre_plugins`` must always be present. ``some_name`` comes " |
| 138 |
"from the filename of the empty text file. ``some_module`` refers to " |
| 139 |
":file:`some_module.py` file inside the ZIP file. Note that this importing is" |
| 140 |
" just as powerful as regular Python imports. You can create packages and " |
| 141 |
"subpackages of .py modules inside the ZIP file, just like you would normally" |
| 142 |
" (by defining __init__.py in each sub-folder), and everything should \"just " |
| 143 |
"work\"." |
| 144 |
msgstr "" |
| 145 |
|
| 146 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:76 |
| 147 |
msgid "" |
| 148 |
"The name you use for ``some_name`` enters a global namespace shared by all " |
| 149 |
"plugins, **so make it as unique as possible**. But remember that it must be " |
| 150 |
"a valid Python identifier (only alphabets, numbers and the underscore)." |
| 151 |
msgstr "Le nom que vous utilisez pour ``un_nom`` introduit un espace de nom global partagé par toutes les extensions. **Aussi rendez le aussi unique que possible**. Mais rappelez-vous qu'il doit être un identifiant Python valide(uniquement des lettres, des nombres et le tiret bas)." |
| 152 |
|
| 153 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:79 |
| 154 |
msgid "**__init__.py**" |
| 155 |
msgstr "**__init__.py**" |
| 156 |
|
| 157 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:80 |
| 158 |
msgid "As before, the file that defines the plugin class" |
| 159 |
msgstr "Comme précédemment, le fichier qui définit la classe de l'extension" |
| 160 |
|
| 161 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:82 |
| 162 |
msgid "**main.py**" |
| 163 |
msgstr "**main.py**" |
| 164 |
|
| 165 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:83 |
| 166 |
msgid "This file contains the actual code that does something useful" |
| 167 |
msgstr "Ce fichier contient le code actuel qui fait quelque chose d'utile" |
| 168 |
|
| 169 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:85 |
| 170 |
msgid "**ui.py**" |
| 171 |
msgstr "**ui.py**" |
| 172 |
|
| 173 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:86 |
| 174 |
msgid "This file defines the interface part of the plugin" |
| 175 |
msgstr "Ce fichier définit la partie interface de l'extension" |
| 176 |
|
| 177 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:88 |
| 178 |
msgid "**images/icon.png**" |
| 179 |
msgstr "**images/icon.png**" |
| 180 |
|
| 181 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:89 |
| 182 |
msgid "The icon for this plugin" |
| 183 |
msgstr "L'icône pour ce plugin" |
| 184 |
|
| 185 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:91 |
| 186 |
msgid "**about.txt**" |
| 187 |
msgstr "**about.txt**" |
| 188 |
|
| 189 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:92 |
| 190 |
msgid "A text file with information about the plugin" |
| 191 |
msgstr "Un fichier texte contenant des informations sur le plugin" |
| 192 |
|
| 193 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:94 |
| 194 |
msgid "**translations**" |
| 195 |
msgstr "**traductions**" |
| 196 |
|
| 197 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:95 |
| 198 |
msgid "" |
| 199 |
"A folder containing .mo files with the translations of the user interface of" |
| 200 |
" your plugin into different languages. See below for details." |
| 201 |
msgstr "Un répertoire contenant des fichiers .mo avec les traductions de l'interface utilisateur de votre extension dans différentes langues. Voir ci-dessous pour les détails." |
| 202 |
|
| 203 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:99 |
| 204 |
msgid "Now let's look at the code." |
| 205 |
msgstr "Maintenant regardons le code" |
| 206 |
|
| 207 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:102 |
| 208 |
msgid "__init__.py" |
| 209 |
msgstr "__init__.py" |
| 210 |
|
| 211 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:104 |
| 212 |
msgid "First, the obligatory ``__init__.py`` to define the plugin metadata:" |
| 213 |
msgstr "Tout d'abord, l'obligatoirement ``__init__.py`` pour définir les métadonnées de l'extension :" |
| 214 |
|
| 215 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:109 |
| 216 |
msgid "" |
| 217 |
"The only noteworthy feature is the field :attr:`actual_plugin`. Since " |
| 218 |
"calibre has both command line and GUI interfaces, GUI plugins like this one " |
| 219 |
"should not load any GUI libraries in __init__.py. The actual_plugin field " |
| 220 |
"does this for you, by telling calibre that the actual plugin is to be found " |
| 221 |
"in another file inside your ZIP archive, which will only be loaded in a GUI " |
| 222 |
"context." |
| 223 |
msgstr "La seule caractéristique remarquable est le champ :attr:`actual_plugin`. Depuis que calibre a la ligne de commande et les interfaces de GUI, les extensions avec GUI comme celle-ci ne devrait charger aucune bibliothèques de GUI dans __init__.py. Le champ actual_plugin fait ceci pour vous, en disant à calibre que l'extension actuelle doit être trouvée dans un autre fichier à l'intérieur de votre archive ZIP, qui seront seulement chargées dans un contexte GUI." |
| 224 |
|
| 225 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:114 |
| 226 |
msgid "" |
| 227 |
"Remember that for this to work, you must have a plugin-import-name-" |
| 228 |
"some_name.txt file in your plugin ZIP file, as discussed above." |
| 229 |
msgstr "Rappelez-vous que pour que cela fonctionne, vous devez avoir un fichier plugin-import-name-un_nom.txt dans le fichier ZIP de votre extension, comme discuté plus haut." |
| 230 |
|
| 231 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:117 |
| 232 |
msgid "" |
| 233 |
"Also there are a couple of methods for enabling user configuration of the " |
| 234 |
"plugin. These are discussed below." |
| 235 |
msgstr "Il y a également quelques méthodes pour permettre la configuration utilisateur de l'extension. Celles-ci sont discutées ci-dessous." |
| 236 |
|
| 237 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:120 |
| 238 |
msgid "ui.py" |
| 239 |
msgstr "ui.py" |
| 240 |
|
| 241 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:122 |
| 242 |
msgid "" |
| 243 |
"Now let's look at ui.py which defines the actual GUI plugin. The source code" |
| 244 |
" is heavily commented and should be self explanatory:" |
| 245 |
msgstr "Maintenant regardons à ui.py qui définit le GUI habituel de l'extension. Le code source est fortement commenté et devrait être explicite :" |
| 246 |
|
| 247 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:128 |
| 248 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:220 |
| 249 |
msgid "main.py" |
| 250 |
msgstr "main.py" |
| 251 |
|
| 252 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:130 |
| 253 |
msgid "The actual logic to implement the Interface Plugin Demo dialog." |
| 254 |
msgstr "La logique actuelle pour mettre en application le dialogue de démo de l'interface de l'extension." |
| 255 |
|
| 256 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:136 |
| 257 |
msgid "Getting resources from the plugin ZIP file" |
| 258 |
msgstr "Obtention des ressources à partir du fichier ZIP de l'extension" |
| 259 |
|
| 260 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:138 |
| 261 |
msgid "" |
| 262 |
"calibre's plugin loading system defines a couple of built-in functions that " |
| 263 |
"allow you to conveniently get files from the plugin ZIP file." |
| 264 |
msgstr "Le système de chargement d'une extension calibre définit quelques fonctions intégrées qui permettent d'obtenir confortablement des fichiers à partir du fichier ZIP de l'extension." |
| 265 |
|
| 266 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:140 |
| 267 |
msgid "**get_resources(name_or_list_of_names)**" |
| 268 |
msgstr "**get_resources(name_or_list_of_names)**" |
| 269 |
|
| 270 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:141 |
| 271 |
msgid "" |
| 272 |
"This function should be called with a list of paths to files inside the ZIP " |
| 273 |
"file. For example to access the file :file:`icon.png` in the folder images " |
| 274 |
"in the ZIP file, you would use: ``images/icon.png``. Always use a forward " |
| 275 |
"slash as the path separator, even on Windows. When you pass in a single " |
| 276 |
"name, the function will return the raw bytes of that file or None if the " |
| 277 |
"name was not found in the ZIP file. If you pass in more than one name then " |
| 278 |
"it returns a dictionary mapping the names to bytes. If a name is not found," |
| 279 |
" it will not be present in the returned dictionary." |
| 280 |
msgstr "" |
| 281 |
|
| 282 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:150 |
| 283 |
msgid "**get_icons(name_or_list_of_names, plugin_name='')**" |
| 284 |
msgstr "" |
| 285 |
|
| 286 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:151 |
| 287 |
msgid "" |
| 288 |
"A wrapper for get_resources() that creates QIcon objects from the raw bytes " |
| 289 |
"returned by get_resources. If a name is not found in the ZIP file the " |
| 290 |
"corresponding QIcon will be null. In order to support icon theme-ing, pass " |
| 291 |
"in the human friendly name of your plugin as ``plugin_name``. If the user is" |
| 292 |
" using an icon theme with icons for your plugin, they will be loaded " |
| 293 |
"preferentially." |
| 294 |
msgstr "" |
| 295 |
|
| 296 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:160 |
| 297 |
msgid "Enabling user configuration of your plugin" |
| 298 |
msgstr "Activation de la configuration utilisateur pour votre extension" |
| 299 |
|
| 300 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:162 |
| 301 |
msgid "" |
| 302 |
"To allow users to configure your plugin, you must define three methods in " |
| 303 |
"your base plugin class, **is_customizable**, **config_widget** and " |
| 304 |
"**save_settings** as shown below:" |
| 305 |
msgstr "Pour permettre aux utilisateurs de configurer votre extension, vous devez définir trois méthodes dans votre classe de base de l'extension, **is_customizable**, **config_widget** et **save_settings** comme montré ci-dessous :" |
| 306 |
|
| 307 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:173 |
| 308 |
msgid "" |
| 309 |
"calibre has many different ways to store configuration data (a legacy of its" |
| 310 |
" long history). The recommended way is to use the **JSONConfig** class, " |
| 311 |
"which stores your configuration information in a .json file." |
| 312 |
msgstr "calibre a beaucoup de manières différentes pour stocker les données de configuration (un héritage de sa longue histoire). La manière recommandée est d'utiliser la classe **JSONConfig**, qui stocke votre information de configuration dans un fichier .json." |
| 313 |
|
| 314 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:175 |
| 315 |
msgid "" |
| 316 |
"The code to manage configuration data in the demo plugin is in config.py:" |
| 317 |
msgstr "Le code pour gérer le données de configuration dans l'extension démo est dans config.py :" |
| 318 |
|
| 319 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:180 |
| 320 |
msgid "" |
| 321 |
"The ``prefs`` object is now available throughout the plugin code by a " |
| 322 |
"simple::" |
| 323 |
msgstr "L'objet ``prefs`` est maintenant disponible dans tout le code de l'extension par un simple::" |
| 324 |
|
| 325 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:185 |
| 326 |
msgid "You can see the ``prefs`` object being used in main.py:" |
| 327 |
msgstr "Vous pouvez voir l'objet ``prefs`` en cours d'utilisation dans main.py :" |
| 328 |
|
| 329 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:192 |
| 330 |
msgid "Edit book plugins" |
| 331 |
msgstr "Extensions d'édition de livre" |
| 332 |
|
| 333 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:194 |
| 334 |
msgid "" |
| 335 |
"Now let's change gears for a bit and look at creating a plugin to add tools " |
| 336 |
"to the calibre book editor. The plugin is available here: " |
| 337 |
":download_file:`editor_demo_plugin.zip`." |
| 338 |
msgstr "Maintenant changeons de direction pour un moment et regardons à la création d'une extension pour ajouter des outils à l'éditeur de livre calibre. L'extension est disponible ici : :download_file:`editor_demo_plugin.zip`." |
| 339 |
|
| 340 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:198 |
| 341 |
msgid "" |
| 342 |
"The first step, as for all plugins is to create the import name empty txt " |
| 343 |
"file, as described :ref:`above <import_name_txt>`. We shall name the file " |
| 344 |
"``plugin-import-name-editor_plugin_demo.txt``." |
| 345 |
msgstr "La première étape comme pour toutes les extensions est de créer le nom du fichier txt vide d'importation, comme décrit :ref:`plus haut<import_name_txt>`. Nous appellerons vle fichier ``plugin-import-name-editor_plugin_demo.txt``." |
| 346 |
|
| 347 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:202 |
| 348 |
msgid "" |
| 349 |
"Now we create the mandatory ``__init__.py`` file that contains metadata " |
| 350 |
"about the plugin -- its name, author, version, etc." |
| 351 |
msgstr "Maintenant nous créons le fichier mandataire ``__init__.py`` qui contient les métadonnées à propos de l'extension -- ses nom, auteur, version, etc." |
| 352 |
|
| 353 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:208 |
| 354 |
msgid "" |
| 355 |
"A single editor plugin can provide multiple tools each tool corresponds to a" |
| 356 |
" single button in the toolbar and entry in the :guilabel:`Plugins` menu in " |
| 357 |
"the editor. These can have sub-menus in case the tool has multiple related " |
| 358 |
"actions." |
| 359 |
msgstr "Une simple extension éditeur peut procurer de multiples outils chaque outil correspond à un seul bouton dans la barre d'outils et une entrée dans le menu :guilabel:`Extensions` dans l'éditeur. Celle-ci peut avoir des sous menus dans le cas où l'outil à de multiples actions liées." |
| 360 |
|
| 361 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:212 |
| 362 |
msgid "" |
| 363 |
"The tools must all be defined in the file ``main.py`` in your plugin. Every " |
| 364 |
"tool is a class that inherits from the " |
| 365 |
":class:`calibre.gui2.tweak_book.plugin.Tool` class. Let's look at " |
| 366 |
"``main.py`` from the demo plugin, the source code is heavily commented and " |
| 367 |
"should be self-explanatory. Read the API documents of the " |
| 368 |
":class:`calibre.gui2.tweak_book.plugin.Tool` class for more details." |
| 369 |
msgstr "Les outils doivent tous être définis dans le fichier ``main.py`` dans votre extension. Chaque outil est une classe qui hérite de la classe :class:`calibre.gui2.tweak_book.plugin.Tool`. Regardons attentivement le ``main.py`` de l'extention démo, le code source est fortement commenté et devrait être explicite. Lisez les documents API de la classe :class:`calibre.gui2.tweak_book.plugin.Tool` pour plus de détails." |
| 370 |
|
| 371 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:222 |
| 372 |
msgid "" |
| 373 |
"Here we will see the definition of a single tool that will multiply all font" |
| 374 |
" sizes in the book by a number provided by the user. This tool demonstrates " |
| 375 |
"various important concepts that you will need in developing your own " |
| 376 |
"plugins, so you should read the (heavily commented) source code carefully." |
| 377 |
msgstr "Nous verrons ici la définition d'un outil simple qui multipliera toutes les tailles de police dans le livre par un nombre fourni par l'utilisateur? Cet outil démontre les différents concepts importants dont vous aurez besoin dans le développement de vos propres extensions, aussi vous devriez lire attentivement le code source (fortement commenté)." |
| 378 |
|
| 379 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:230 |
| 380 |
msgid "" |
| 381 |
"Let's break down ``main.py``. We see that it defines a single tool, named " |
| 382 |
"*Magnify fonts*. This tool will ask the user for a number and multiply all " |
| 383 |
"font sizes in the book by that number." |
| 384 |
msgstr "Décomposons ``main.py``. Nous voyons qu'il définit une seul outil, nommé *Magnify fonts*. Cet outil demandera à l'utilisateur un nombre et multipliera toutes les tailles de police dans le livre par ce nombre." |
| 385 |
|
| 386 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:234 |
| 387 |
msgid "" |
| 388 |
"The first important thing is the tool name which you must set to some " |
| 389 |
"relatively unique string as it will be used as the key for this tool." |
| 390 |
msgstr "La première chose importante est le nom d'outil que vous devez établir à une certaine chaîne relativement unique car elle sera employée comme clé pour cet outil." |
| 391 |
|
| 392 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:237 |
| 393 |
msgid "" |
| 394 |
"The next important entry point is the " |
| 395 |
":meth:`calibre.gui2.tweak_book.plugin.Tool.create_action`. This method " |
| 396 |
"creates the QAction objects that appear in the plugins toolbar and plugin " |
| 397 |
"menu. It also, optionally, assigns a keyboard shortcut that the user can " |
| 398 |
"customize. The triggered signal from the QAction is connected to the " |
| 399 |
"ask_user() method that asks the user for the font size multiplier, and then " |
| 400 |
"runs the magnification code." |
| 401 |
msgstr "L'entrée importante suivante est la :meth:`calibre.gui2.tweak_book.plugin.Tool.create_action`. Cette méthode crée les objects QAction qui apparaissent dans la barre d'outils et le menu extensions. Elle assigne aussi, optionnellement, un raccourci clavier que l'utilisateur peut personnaliser. Le signal de déclenchement de QAction est relié à la méthode ask_user () qui demande à l'utilisateur le multiplicateur de taille de la police, et puis exécute le code de grossissement." |
| 402 |
|
| 403 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:245 |
| 404 |
msgid "" |
| 405 |
"The magnification code is well commented and fairly simple. The main things " |
| 406 |
"to note are that you get a reference to the editor window as ``self.gui`` " |
| 407 |
"and the editor *Boss* as ``self.boss``. The *Boss* is the object that " |
| 408 |
"controls the editor user interface. It has many useful methods, that are " |
| 409 |
"documented in the :class:`calibre.gui2.tweak_book.boss.Boss` class." |
| 410 |
msgstr "Le code de grossissement est bien commenté assez simple. Les choses les plus importantes à noter sont que vous obtenez une référence à la fenêtre de l'éditeur comme ``self.gui`` et l'éditeur *Boss* comme ``self.boss``. Le *Boss* est l'objet qui contrôle l'interface utilisateur de l'éditeur. Il a beaucoup de méthodes utiles, elles sont documentées dans la classe :class:`calibre.gui2.tweak_book.boss.Boss`." |
| 411 |
|
| 412 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:251 |
| 413 |
msgid "" |
| 414 |
"Finally, there is ``self.current_container`` which is a reference to the " |
| 415 |
"book being edited as a " |
| 416 |
":class:`calibre.ebooks.oeb.polish.container.Container` object. This " |
| 417 |
"represents the book as a collection of its constituent HTML/CSS/image files " |
| 418 |
"and has convenience methods for doing many useful things. The container " |
| 419 |
"object and various useful utility functions that can be reused in your " |
| 420 |
"plugin code are documented in :ref:`polish_api`." |
| 421 |
msgstr "Finalement, il y a ``self.current_container`` qui est ue référence au livre en cours d'édition comme un objet :class:`calibre.ebooks.oeb.polish.container.Container`. Ceci représente le livre comme une collection de ses fichiers constituants HTML/CSS/image et a des méthodes commodes pour faire beaucoup de choses utiles. L'objet container et diverses fonctions de service utiles qui peuvent être réutilisées en votre code d'extension sont documentées dans :ref:`polish_api`." |
| 422 |
|
| 423 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:259 |
| 424 |
msgid "Adding translations to your plugin" |
| 425 |
msgstr "Ajout des traductions à votre extension" |
| 426 |
|
| 427 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:261 |
| 428 |
msgid "" |
| 429 |
"You can have all the user interface strings in your plugin translated and " |
| 430 |
"displayed in whatever language is set for the main calibre user interface." |
| 431 |
msgstr "Vous pouvez avoir toutes les chaînes de l'interface utilisateur dans votre extension traduites et affichées dans n'importe quelle langue paramétrée pour l'interface utilisateur principale de calibre." |
| 432 |
|
| 433 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:264 |
| 434 |
msgid "" |
| 435 |
"The first step is to go through your plugin's source code and mark all user " |
| 436 |
"visible strings as translatable, by surrounding them in _(). For example::" |
| 437 |
msgstr "La première étape est de faire le tour du code source de votre extension et marquer toutes les chaînes visibles par l'utilisateur comme traduisible, en les entourant dans _(). Par exemple::" |
| 438 |
|
| 439 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:269 |
| 440 |
msgid "" |
| 441 |
"Then use some program to generate .po files from your plugin source code. " |
| 442 |
"There should be one .po file for every language you want to translate into. " |
| 443 |
"For example: de.po for German, fr.po for French and so on. You can use the " |
| 444 |
"`Poedit <https://poedit.net/>`_ program for this." |
| 445 |
msgstr "Utilisez alors un programme pour générer les fichiers .po à partir du code source de votre extension. Il devrait y avoir un fichier .po pour chaque langue dans laquelle vous voulez une traduction. Par exemple de.po pour l'allemand, fr.po pour le français et ainsi de suite. Vous pouvez utiliser le programme `Poedit <https://poedit.net/>`_ pour cela." |
| 446 |
|
| 447 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:274 |
| 448 |
msgid "" |
| 449 |
"Send these .po files to your translators. Once you get them back, compile " |
| 450 |
"them into .mo files. You can again use Poedit for that, or just do::" |
| 451 |
msgstr "Envoyez ces fichiers .po à vos traducteurs. Une fois que vous les obtenez en retour, compilez les dans des fichiers .mo. Vous pouvez encore utilisez Poedit pour cela, ou juste faire::" |
| 452 |
|
| 453 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:279 |
| 454 |
msgid "Put the .mo files into the ``translations`` folder in your plugin." |
| 455 |
msgstr "Déposez les fichiers .mo dans le répertoire ``translations`` dans votre extension." |
| 456 |
|
| 457 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:281 |
| 458 |
msgid "" |
| 459 |
"The last step is to simply call the function `load_translations()` at the " |
| 460 |
"top of your plugin's .py files. For performance reasons you should only call" |
| 461 |
" this function in those .py files that actually have translatable strings. " |
| 462 |
"So in a typical User Interface plugin you would call it at the top of " |
| 463 |
"``ui.py`` but not ``__init__.py``." |
| 464 |
msgstr "La dernière étape est de simplement appeler la fonction `load_translations()` en haut de vos fichiers .py d'extension. Pour des raisons de performance, vous devriez seulement appeler cette fonction dans les fichiers .py qui ont réellement des chaînes traduisibles. Aussi dans une Interface Utilisateur typique vous devriez l'appeler en haut de ``ui.py`` mais pas de ``__init__.py``." |
| 465 |
|
| 466 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:287 |
| 467 |
msgid "" |
| 468 |
"You can test the translations of your plugins by changing the user interface" |
| 469 |
" language in calibre under :guilabel:`Preferences->Interface->Look & feel` " |
| 470 |
"or by running calibre with the ``CALIBRE_OVERRIDE_LANG`` environment " |
| 471 |
"variable set. For example::" |
| 472 |
msgstr "" |
| 473 |
|
| 474 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:293 |
| 475 |
msgid "" |
| 476 |
"Replace ``de`` with the language code of the language you want to test." |
| 477 |
msgstr "Remplac``de`` avec le code de langue de la langue que vous voulez tester." |
| 478 |
|
| 479 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:295 |
| 480 |
msgid "" |
| 481 |
"For translations with plurals, use the ``ngettext()`` function instead of " |
| 482 |
"``_()``. For example::" |
| 483 |
msgstr "" |
| 484 |
|
| 485 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:301 |
| 486 |
msgid "The plugin API" |
| 487 |
msgstr "L'API extension" |
| 488 |
|
| 489 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:303 |
| 490 |
msgid "" |
| 491 |
"As you may have noticed above, a plugin in calibre is a class. There are " |
| 492 |
"different classes for the different types of plugins in calibre. Details on " |
| 493 |
"each class, including the base class of all plugins can be found in " |
| 494 |
":ref:`plugins`." |
| 495 |
msgstr "Comme vous avez pu le constatez plus haut, une extension dans calibre est une classe. Il a différentes classes pour les différents types d'extension dans calibre. Les détails sur chaque classe, incluant la classe de base de toutes les extensions peuvent être trouvés dans :ref:`plugins`." |
| 496 |
|
| 497 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:306 |
| 498 |
msgid "" |
| 499 |
"Your plugin is almost certainly going to use code from calibre. To learn how" |
| 500 |
" to find various bits of functionality in the calibre code base, read the " |
| 501 |
"section on the calibre :ref:`code_layout`." |
| 502 |
msgstr "Votre extension va presque certainement employer le code de calibre. Pour apprendre comment trouver les diverses parties de fonctionnalités dans le code de base de calibre, lisez la section sur le :ref:`code_layout` calibre." |
| 503 |
|
| 504 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:311 |
| 505 |
msgid "Debugging plugins" |
| 506 |
msgstr "Dépannage des extensions" |
| 507 |
|
| 508 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:313 |
| 509 |
msgid "" |
| 510 |
"The first, most important step is to run calibre in debug mode. You can do " |
| 511 |
"this from the command line with::" |
| 512 |
msgstr "Tout d'abord, l'étape la plus importante est d'exécuter calibre en mode dépannage. Vous pouvez faire cela depuis la ligne de commande avec::" |
| 513 |
|
| 514 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:317 |
| 515 |
msgid "" |
| 516 |
"Or from within calibre by right-clicking the :guilabel:`Preferences` button " |
| 517 |
"or using the :kbd:`Ctrl+Shift+R` keyboard shortcut." |
| 518 |
msgstr "Ou, dans calibre, en faisant un clic droit sur le bouton :guilabel:`Préférences` ou en utilisant le raccourci clavier :kbd:`Ctrl+Shift+R`." |
| 519 |
|
| 520 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:319 |
| 521 |
msgid "" |
| 522 |
"When running from the command line, debug output will be printed to the " |
| 523 |
"console, when running from within calibre the output will go to a txt file." |
| 524 |
msgstr "Lors de l'exécution en ligne de commande, la sortie de dépannage sera affichée dans la console, lors de l'exécution depuis calibre la sortie ira dans un fichier txt." |
| 525 |
|
| 526 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:321 |
| 527 |
msgid "" |
| 528 |
"You can insert print statements anywhere in your plugin code, they will be " |
| 529 |
"output in debug mode. Remember, this is Python, you really shouldn't need " |
| 530 |
"anything more than print statements to debug ;) I developed all of calibre " |
| 531 |
"using just this debugging technique." |
| 532 |
msgstr "Vous pouvez insérer des déclarations n'importe où dans votre code d'extension, elles seront reprises dans le mode dépannage. Rappelez-vous, ceci est du Python, vous ne devriez n'avoir vraiment besoin de rien de plus que les déclarations pour corriger ;) J'ai développé entièrement calibre en utilisant juste cette technique d'élimination des imperfections." |
| 533 |
|
| 534 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:323 |
| 535 |
msgid "" |
| 536 |
"You can quickly test changes to your plugin by using the following command " |
| 537 |
"line::" |
| 538 |
msgstr "Vous pouvez rapidement tester les changements de votre extension en utilisant la ligne de commande suivante::" |
| 539 |
|
| 540 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:328 |
| 541 |
msgid "" |
| 542 |
"This will shutdown a running calibre, wait for the shutdown to complete, " |
| 543 |
"then update your plugin in calibre and relaunch calibre." |
| 544 |
msgstr "Ceci arrêtera un calibre en cours d'exécution, attendez que l'arrêt soit complet, mettez alors à jour votre extension à jour dans calibre et relancez calibre." |
| 545 |
|
| 546 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:331 |
| 547 |
msgid "More plugin examples" |
| 548 |
msgstr "Plus d'exemples d'extensions" |
| 549 |
|
| 550 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:333 |
| 551 |
msgid "" |
| 552 |
"You can find a list of many sophisticated calibre plugins `here " |
| 553 |
"<https://www.mobileread.com/forums/showthread.php?t=118764>`_." |
| 554 |
msgstr "Vous pouvez trouver une liste de nombreuses extensions calibre sophistiquées `ici<https://www.mobileread.com/forums/showthread.php?t=118764>`_." |
| 555 |
|
| 556 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:336 |
| 557 |
msgid "Sharing your plugins with others" |
| 558 |
msgstr "Partager vos extensions avec les autres" |
| 559 |
|
| 560 |
#: ../../../__w/calibre/calibre/manual/creating_plugins.rst:338 |
| 561 |
msgid "" |
| 562 |
"If you would like to share the plugins you have created with other users of " |
| 563 |
"calibre, post your plugin in a new thread in the `calibre plugins forum " |
| 564 |
"<https://www.mobileread.com/forums/forumdisplay.php?f=237>`_." |
| 565 |
msgstr "Si vous aimeriez partager les extensions que vous avez créées avec d'autres utilisateurs de calibre, postez votre extension dans un nouveau fil de discussion sur le `forum des extensions calibre <https://www.mobileread.com/forums/forumdisplay.php?f=237>`_." |