Debian Codegraph @

translations/manual/fr/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 # Xotes <[email protected]>, 2015
7 # Anaïs V. <[email protected]>, 2014
8 # Franck, 2017
9 # Ptit Prince <[email protected]>, 2014-2015
10 # Ptit Prince <[email protected]>, 2016-2017,2019-2022
11 # un_pogaz, 2022-2023
12 # un_pogaz, 2026
13 msgid ""
14 msgstr ""
15 "Project-Id-Version: calibre\n"
16 "Report-Msgid-Bugs-To: \n"
17 "POT-Creation-Date: 2026-02-17 16:44+0000\n"
18 "PO-Revision-Date: 2014-06-17 08:35+0000\n"
19 "Last-Translator: un_pogaz, 2026\n"
20 "Language-Team: French (http://app.transifex.com/calibre/calibre/language/fr/)\n"
21 "MIME-Version: 1.0\n"
22 "Content-Type: text/plain; charset=UTF-8\n"
23 "Content-Transfer-Encoding: 8bit\n"
24 "Language: fr\n"
25 "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n"
26
27 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:4
28 msgid "Writing your own plugins to extend calibre's functionality"
29 msgstr "Écrire vos propres extensions pour étendre les fonctionnalités de calibre"
30
31 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:6
32 msgid ""
33 "calibre has a very modular design. Almost all functionality in calibre comes"
34 " in the form of plugins. Plugins are used for conversion, for downloading "
35 "news (though these are called recipes), for various components of the user "
36 "interface, to connect to different devices, to process files when adding "
37 "them to calibre and so on. You can get a complete list of all the built-in "
38 "plugins in calibre by going to :guilabel:`Preferences->Advanced->Plugins`."
39 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 dans :guilabel:`Préférences->Avancé->Extensions`."
40
41 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:8
42 msgid ""
43 "Here, we will teach you how to create your own plugins to add new features "
44 "to calibre."
45 msgstr "Ici, nous vous apprendrons comment créer vos propres extensions pour ajouter de nouvelles fonctionnalités à calibre."
46
47 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:13
48 msgid "Contents"
49 msgstr "Contenu"
50
51 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:15
52 msgid "This only applies to calibre releases >= 0.8.60"
53 msgstr "Ceci s'applique uniquement aux versions de calibre >=0.8.60"
54
55 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:18
56 msgid "Anatomy of a calibre plugin"
57 msgstr "Anatomie d'une extension calibre"
58
59 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:20
60 msgid ""
61 "A calibre plugin is very simple, it's just a ZIP file that contains some "
62 "Python code and any other resources like image files needed by the plugin. "
63 "Without further ado, let's see a basic example."
64 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."
65
66 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:24
67 msgid ""
68 "Suppose you have an installation of calibre that you are using to self "
69 "publish various e-documents in EPUB and MOBI formats. You would like all "
70 "files generated by calibre to have their publisher set as \"Hello world\", "
71 "here's how to do it. Create a file named :file:`__init__.py` (this is a "
72 "special name and must always be used for the main file of your plugin) and "
73 "enter the following Python code into it:"
74 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 :"
75
76 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:32
77 msgid ""
78 "That's all. To add this code to calibre as a plugin, simply run the "
79 "following in the folder in which you created :file:`__init__.py`::"
80 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`::"
81
82 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:38
83 msgid ""
84 "On macOS, the command line tools are inside the calibre bundle, for example,"
85 " if you installed calibre in :file:`/Applications` the command line tools "
86 "are in :file:`/Applications/calibre.app/Contents/MacOS/`."
87 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/`."
88
89 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:42
90 msgid ""
91 "You can download the Hello World plugin from "
92 ":download_file:`helloworld_plugin.zip`."
93 msgstr "Vous pouvez télécharger le plugin Hello World depuis :download_file:`helloworld_plugin.zip`."
94
95 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:45
96 msgid ""
97 "Every time you use calibre to convert a book, the plugin's :meth:`run` "
98 "method will be called and the converted book will have its publisher set to "
99 "\"Hello World\". This is a trivial plugin, let's move on to a more complex "
100 "example that actually adds a component to the user interface."
101 msgstr "A chaque fois que vous utilisez calibre pour convertir un livre, la méthode de l'extension :meth:`run` sera appelée et les livres convertis auront leur éditeur établi à « Hello World ». C'est une extension banale, passons à un exemple plus complexe qui habituellement ajoute un composant à l'interface utilisateur."
102
103 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:50
104 msgid "A User Interface plugin"
105 msgstr "Une extension d'Interface Utilisateur"
106
107 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:52
108 msgid ""
109 "This plugin will be spread over a few files (to keep the code clean). It "
110 "will show you how to get resources (images or data files) from the plugin "
111 "ZIP file, allow users to configure your plugin, how to create elements in "
112 "the calibre user interface and how to access and query the books database in"
113 " calibre."
114 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."
115
116 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:57
117 msgid ""
118 "You can download this plugin from :download_file:`interface_demo_plugin.zip`"
119 msgstr "Vous pouvez télécharger ce plugin à partir de :download_file:`interface_demo_plugin.zip`."
120
121 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:61
122 msgid ""
123 "The first thing to note is that this ZIP file has a lot more files in it, "
124 "explained below, pay particular attention to ``plugin-import-name-"
125 "interface_demo.txt``."
126 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``."
127
128 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:64
129 msgid "**plugin-import-name-interface_demo.txt**"
130 msgstr "**plugin-import-name-interface_demo.txt**"
131
132 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:65
133 msgid ""
134 "An empty text file used to enable the multi-file plugin magic. This file "
135 "must be present in all plugins that use more than one .py file. It should be"
136 " empty and its filename must be of the form: ``plugin-import-"
137 "name-**some_name**.txt``. The presence of this file allows you to import "
138 "code from the .py files present inside the ZIP file, using a statement "
139 "like::"
140 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::"
141
142 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:71
143 msgid ""
144 "The prefix ``calibre_plugins`` must always be present. ``some_name`` comes "
145 "from the filename of the empty text file. ``some_module`` refers to "
146 ":file:`some_module.py` file inside the ZIP file. Note that this importing is"
147 " just as powerful as regular Python imports. You can create packages and "
148 "subpackages of .py modules inside the ZIP file, just like you would normally"
149 " (by defining __init__.py in each sub-folder), and everything should \"just "
150 "work\"."
151 msgstr "Le préfixe ``calibre_plugins`` doit toujours être présent. ``some_name`` provient du nom de fichier du fichier texte vide. ``some_module`` se réfère au fichier :file:`some_module.py` dans le fichier ZIP. Notez que cette importation est tout aussi puissante que les importations Python régulières. Vous pouvez créer des paquets et des sous paquets de modules .py à l'intérieur du fichier ZIP, tout comme vous le feriez normalement (en définissant __init__.py dans chaque sous dossier), et tout devrait \"fonctionner correctement\"."
152
153 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:76
154 msgid ""
155 "The name you use for ``some_name`` enters a global namespace shared by all "
156 "plugins, **so make it as unique as possible**. But remember that it must be "
157 "a valid Python identifier (only alphabets, numbers and the underscore)."
158 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)."
159
160 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:79
161 msgid "**__init__.py**"
162 msgstr "**__init__.py**"
163
164 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:80
165 msgid "As before, the file that defines the plugin class"
166 msgstr "Comme précédemment, le fichier qui définit la classe de l'extension"
167
168 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:82
169 msgid "**main.py**"
170 msgstr "**main.py**"
171
172 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:83
173 msgid "This file contains the actual code that does something useful"
174 msgstr "Ce fichier contient le code actuel qui fait quelque chose d'utile"
175
176 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:85
177 msgid "**ui.py**"
178 msgstr "**ui.py**"
179
180 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:86
181 msgid "This file defines the interface part of the plugin"
182 msgstr "Ce fichier définit la partie interface de l'extension"
183
184 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:88
185 msgid "**images/icon.png**"
186 msgstr "**images/icon.png**"
187
188 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:89
189 msgid "The icon for this plugin"
190 msgstr "L'icône pour ce plugin"
191
192 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:91
193 msgid "**about.txt**"
194 msgstr "**about.txt**"
195
196 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:92
197 msgid "A text file with information about the plugin"
198 msgstr "Un fichier texte contenant des informations sur le plugin"
199
200 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:94
201 msgid "**translations**"
202 msgstr "**traductions**"
203
204 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:95
205 msgid ""
206 "A folder containing .mo files with the translations of the user interface of"
207 " your plugin into different languages. See below for details."
208 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."
209
210 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:99
211 msgid "Now let's look at the code."
212 msgstr "Maintenant regardons le code"
213
214 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:102
215 msgid "__init__.py"
216 msgstr "__init__.py"
217
218 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:104
219 msgid "First, the obligatory ``__init__.py`` to define the plugin metadata:"
220 msgstr "Tout d'abord, l'obligatoirement ``__init__.py`` pour définir les métadonnées de l'extension :"
221
222 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:109
223 msgid ""
224 "The only noteworthy feature is the field :attr:`actual_plugin`. Since "
225 "calibre has both command line and GUI interfaces, GUI plugins like this one "
226 "should not load any GUI libraries in __init__.py. The actual_plugin field "
227 "does this for you, by telling calibre that the actual plugin is to be found "
228 "in another file inside your ZIP archive, which will only be loaded in a GUI "
229 "context."
230 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."
231
232 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:114
233 msgid ""
234 "Remember that for this to work, you must have a plugin-import-name-"
235 "some_name.txt file in your plugin ZIP file, as discussed above."
236 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."
237
238 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:117
239 msgid ""
240 "Also there are a couple of methods for enabling user configuration of the "
241 "plugin. These are discussed below."
242 msgstr "Il y a également quelques méthodes pour permettre la configuration utilisateur de l'extension. Celles-ci sont discutées ci-dessous."
243
244 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:120
245 msgid "ui.py"
246 msgstr "ui.py"
247
248 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:122
249 msgid ""
250 "Now let's look at ui.py which defines the actual GUI plugin. The source code"
251 " is heavily commented and should be self explanatory:"
252 msgstr "Maintenant regardons à ui.py qui définit le GUI habituel de l'extension. Le code source est fortement commenté et devrait être explicite :"
253
254 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:128
255 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:220
256 msgid "main.py"
257 msgstr "main.py"
258
259 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:130
260 msgid "The actual logic to implement the Interface Plugin Demo dialog."
261 msgstr "La logique actuelle pour mettre en application le dialogue de démo de l'interface de l'extension."
262
263 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:136
264 msgid "Getting resources from the plugin ZIP file"
265 msgstr "Obtention des ressources à partir du fichier ZIP de l'extension"
266
267 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:138
268 msgid ""
269 "calibre's plugin loading system defines a couple of built-in functions that "
270 "allow you to conveniently get files from the plugin ZIP file."
271 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."
272
273 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:140
274 msgid "**get_resources(name_or_list_of_names)**"
275 msgstr "**get_resources(name_or_list_of_names)**"
276
277 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:141
278 msgid ""
279 "This function should be called with a list of paths to files inside the ZIP "
280 "file. For example to access the file :file:`icon.png` in the folder images "
281 "in the ZIP file, you would use: ``images/icon.png``. Always use a forward "
282 "slash as the path separator, even on Windows. When you pass in a single "
283 "name, the function will return the raw bytes of that file or None if the "
284 "name was not found in the ZIP file. If you pass in more than one name then "
285 "it returns a dictionary mapping the names to bytes. If a name is not found,"
286 " it will not be present in the returned dictionary."
287 msgstr "Cette fonction devra être appelée avec une liste de chemins vers les fichiers à l'intérieur du fichier ZIP. Par exemple pour accéder au fichier :file:`icon.png` dans le dossier images dans le fichier ZIP, vous devriez utiliser : ``images/icon.png``. Toujours utiliser une barre oblique comme séparateur de chemin, même sous Windows. Quand vous analysez un nom seul, la fonction retournera les octets bruts ou Aucun si le nom n'est pas trouvé dans le fichier ZIP. Si vous analysez plus d'un nom alors il renvoie un dictionnaire mappant les noms aux octets. Si un nom n'est pas trouvé, il ne sera pas présent dans le dictionnaire retourné."
288
289 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:150
290 msgid "**get_icons(name_or_list_of_names, plugin_name='')**"
291 msgstr "**get_icons(name_or_list_of_names, plugin_name='')**"
292
293 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:151
294 msgid ""
295 "A wrapper for get_resources() that creates QIcon objects from the raw bytes "
296 "returned by get_resources. If a name is not found in the ZIP file the "
297 "corresponding QIcon will be null. In order to support icon theme-ing, pass "
298 "in the human friendly name of your plugin as ``plugin_name``. If the user is"
299 " using an icon theme with icons for your plugin, they will be loaded "
300 "preferentially."
301 msgstr "Un enveloppeur pour get_resources() qui crée des objets QIcon à partir des octets bruts retournés par get_resources. Si un nom n'est pas trouvé dans le fichier ZIP, le QIcon correspondant sera nul. Afin de supporter les thèmes d'icônes, entrez le nom convivial de votre plugin comme ``plugin_name``. Si l'utilisateur utilise un thème d'icônes avec des icônes pour votre plugin, ils seront chargés de préférence."
302
303 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:160
304 msgid "Enabling user configuration of your plugin"
305 msgstr "Activation de la configuration utilisateur pour votre extension"
306
307 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:162
308 msgid ""
309 "To allow users to configure your plugin, you must define three methods in "
310 "your base plugin class, **is_customizable**, **config_widget** and "
311 "**save_settings** as shown below:"
312 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 :"
313
314 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:173
315 msgid ""
316 "calibre has many different ways to store configuration data (a legacy of its"
317 " long history). The recommended way is to use the **JSONConfig** class, "
318 "which stores your configuration information in a .json file."
319 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."
320
321 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:175
322 msgid ""
323 "The code to manage configuration data in the demo plugin is in config.py:"
324 msgstr "Le code pour gérer le données de configuration dans l'extension démo est dans config.py :"
325
326 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:180
327 msgid ""
328 "The ``prefs`` object is now available throughout the plugin code by a "
329 "simple::"
330 msgstr "L'objet ``prefs`` est maintenant disponible dans tout le code de l'extension par un simple::"
331
332 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:185
333 msgid "You can see the ``prefs`` object being used in main.py:"
334 msgstr "Vous pouvez voir l'objet ``prefs`` en cours d'utilisation dans main.py :"
335
336 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:192
337 msgid "Edit book plugins"
338 msgstr "Extensions d'édition de livre"
339
340 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:194
341 msgid ""
342 "Now let's change gears for a bit and look at creating a plugin to add tools "
343 "to the calibre book editor. The plugin is available here: "
344 ":download_file:`editor_demo_plugin.zip`."
345 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`."
346
347 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:198
348 msgid ""
349 "The first step, as for all plugins is to create the import name empty txt "
350 "file, as described :ref:`above <import_name_txt>`. We shall name the file "
351 "``plugin-import-name-editor_plugin_demo.txt``."
352 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``."
353
354 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:202
355 msgid ""
356 "Now we create the mandatory ``__init__.py`` file that contains metadata "
357 "about the plugin -- its name, author, version, etc."
358 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."
359
360 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:208
361 msgid ""
362 "A single editor plugin can provide multiple tools each tool corresponds to a"
363 " single button in the toolbar and entry in the :guilabel:`Plugins` menu in "
364 "the editor. These can have sub-menus in case the tool has multiple related "
365 "actions."
366 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."
367
368 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:212
369 msgid ""
370 "The tools must all be defined in the file ``main.py`` in your plugin. Every "
371 "tool is a class that inherits from the "
372 ":class:`calibre.gui2.tweak_book.plugin.Tool` class. Let's look at "
373 "``main.py`` from the demo plugin, the source code is heavily commented and "
374 "should be self-explanatory. Read the API documents of the "
375 ":class:`calibre.gui2.tweak_book.plugin.Tool` class for more details."
376 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."
377
378 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:222
379 msgid ""
380 "Here we will see the definition of a single tool that will multiply all font"
381 " sizes in the book by a number provided by the user. This tool demonstrates "
382 "various important concepts that you will need in developing your own "
383 "plugins, so you should read the (heavily commented) source code carefully."
384 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é)."
385
386 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:230
387 msgid ""
388 "Let's break down ``main.py``. We see that it defines a single tool, named "
389 "*Magnify fonts*. This tool will ask the user for a number and multiply all "
390 "font sizes in the book by that number."
391 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."
392
393 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:234
394 msgid ""
395 "The first important thing is the tool name which you must set to some "
396 "relatively unique string as it will be used as the key for this tool."
397 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."
398
399 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:237
400 msgid ""
401 "The next important entry point is the "
402 ":meth:`calibre.gui2.tweak_book.plugin.Tool.create_action`. This method "
403 "creates the QAction objects that appear in the plugins toolbar and plugin "
404 "menu. It also, optionally, assigns a keyboard shortcut that the user can "
405 "customize. The triggered signal from the QAction is connected to the "
406 "ask_user() method that asks the user for the font size multiplier, and then "
407 "runs the magnification code."
408 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."
409
410 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:245
411 msgid ""
412 "The magnification code is well commented and fairly simple. The main things "
413 "to note are that you get a reference to the editor window as ``self.gui`` "
414 "and the editor *Boss* as ``self.boss``. The *Boss* is the object that "
415 "controls the editor user interface. It has many useful methods, that are "
416 "documented in the :class:`calibre.gui2.tweak_book.boss.Boss` class."
417 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`."
418
419 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:251
420 msgid ""
421 "Finally, there is ``self.current_container`` which is a reference to the "
422 "book being edited as a "
423 ":class:`calibre.ebooks.oeb.polish.container.Container` object. This "
424 "represents the book as a collection of its constituent HTML/CSS/image files "
425 "and has convenience methods for doing many useful things. The container "
426 "object and various useful utility functions that can be reused in your "
427 "plugin code are documented in :ref:`polish_api`."
428 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`."
429
430 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:259
431 msgid "Adding translations to your plugin"
432 msgstr "Ajout des traductions à votre extension"
433
434 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:261
435 msgid ""
436 "You can have all the user interface strings in your plugin translated and "
437 "displayed in whatever language is set for the main calibre user interface."
438 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."
439
440 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:264
441 msgid ""
442 "The first step is to go through your plugin's source code and mark all user "
443 "visible strings as translatable, by surrounding them in _(). For example::"
444 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::"
445
446 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:269
447 msgid ""
448 "Then use some program to generate .po files from your plugin source code. "
449 "There should be one .po file for every language you want to translate into. "
450 "For example: de.po for German, fr.po for French and so on. You can use the "
451 "`Poedit <https://poedit.net/>`_ program for this."
452 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."
453
454 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:274
455 msgid ""
456 "Send these .po files to your translators. Once you get them back, compile "
457 "them into .mo files. You can again use Poedit for that, or just do::"
458 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::"
459
460 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:279
461 msgid "Put the .mo files into the ``translations`` folder in your plugin."
462 msgstr "Déposez les fichiers .mo dans le répertoire ``translations`` dans votre extension."
463
464 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:281
465 msgid ""
466 "The last step is to simply call the function `load_translations()` at the "
467 "top of your plugin's .py files. For performance reasons you should only call"
468 " this function in those .py files that actually have translatable strings. "
469 "So in a typical User Interface plugin you would call it at the top of "
470 "``ui.py`` but not ``__init__.py``."
471 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``."
472
473 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:287
474 msgid ""
475 "You can test the translations of your plugins by changing the user interface"
476 " language in calibre under :guilabel:`Preferences->Interface->Look & feel` "
477 "or by running calibre with the ``CALIBRE_OVERRIDE_LANG`` environment "
478 "variable set. For example::"
479 msgstr "Vous pouvez tester les traductions de vos extensions en changeant la langue de l'interface utilisateur dans calibre dans :guilabel:`Préférences->Interface->Apparence` ou en exécutant calibre avec la variable d'environnement ``CALIBRE_OVERRIDE_LANG``. Par exemple ::"
480
481 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:293
482 msgid ""
483 "Replace ``de`` with the language code of the language you want to test."
484 msgstr "Remplac``de`` avec le code de langue de la langue que vous voulez tester."
485
486 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:295
487 msgid ""
488 "For translations with plurals, use the ``ngettext()`` function instead of "
489 "``_()``. For example::"
490 msgstr "Pour les traductions avec des pluriels, utilisez la fonction ``ngettext()`` au lieu de ``_()``. Par exemple ::"
491
492 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:301
493 msgid "The plugin API"
494 msgstr "L'API extension"
495
496 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:303
497 msgid ""
498 "As you may have noticed above, a plugin in calibre is a class. There are "
499 "different classes for the different types of plugins in calibre. Details on "
500 "each class, including the base class of all plugins can be found in "
501 ":ref:`plugins`."
502 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`."
503
504 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:306
505 msgid ""
506 "Your plugin is almost certainly going to use code from calibre. To learn how"
507 " to find various bits of functionality in the calibre code base, read the "
508 "section on the calibre :ref:`code_layout`."
509 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."
510
511 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:311
512 msgid "Debugging plugins"
513 msgstr "Dépannage des extensions"
514
515 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:313
516 msgid ""
517 "The first, most important step is to run calibre in debug mode. You can do "
518 "this from the command line with::"
519 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::"
520
521 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:317
522 msgid ""
523 "Or from within calibre by right-clicking the :guilabel:`Preferences` button "
524 "or using the :kbd:`Ctrl+Shift+R` keyboard shortcut."
525 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`."
526
527 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:319
528 msgid ""
529 "When running from the command line, debug output will be printed to the "
530 "console, when running from within calibre the output will go to a txt file."
531 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."
532
533 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:321
534 msgid ""
535 "You can insert print statements anywhere in your plugin code, they will be "
536 "output in debug mode. Remember, this is Python, you really shouldn't need "
537 "anything more than print statements to debug ;) I developed all of calibre "
538 "using just this debugging technique."
539 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."
540
541 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:323
542 msgid ""
543 "You can quickly test changes to your plugin by using the following command "
544 "line::"
545 msgstr "Vous pouvez rapidement tester les changements de votre extension en utilisant la ligne de commande suivante::"
546
547 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:328
548 msgid ""
549 "This will shutdown a running calibre, wait for the shutdown to complete, "
550 "then update your plugin in calibre and relaunch calibre."
551 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."
552
553 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:331
554 msgid "More plugin examples"
555 msgstr "Plus d'exemples d'extensions"
556
557 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:333
558 msgid ""
559 "You can find a list of many sophisticated calibre plugins `here "
560 "<https://www.mobileread.com/forums/showthread.php?t=118764>`_."
561 msgstr "Vous pouvez trouver une liste de nombreuses extensions calibre sophistiquées `ici<https://www.mobileread.com/forums/showthread.php?t=118764>`_."
562
563 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:336
564 msgid "Sharing your plugins with others"
565 msgstr "Partager vos extensions avec les autres"
566
567 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:338
568 msgid ""
569 "If you would like to share the plugins you have created with other users of "
570 "calibre, post your plugin in a new thread in the `calibre plugins forum "
571 "<https://www.mobileread.com/forums/forumdisplay.php?f=237>`_."
572 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>`_."