# SOME DESCRIPTIVE TITLE. # Copyright (C) Kovid Goyal # This file is distributed under the same license as the calibre package. # # Translators: # Xotes , 2015 # Anaïs V. , 2014 # Franck, 2017 # Ptit Prince , 2014-2015 # Ptit Prince , 2016-2017,2019-2022 # un_pogaz, 2022-2023 # un_pogaz, 2026 msgid "" msgstr "" "Project-Id-Version: calibre\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-02-17 16:44+0000\n" "PO-Revision-Date: 2014-06-17 08:35+0000\n" "Last-Translator: un_pogaz, 2026\n" "Language-Team: French (http://app.transifex.com/calibre/calibre/language/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fr\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:4 msgid "Writing your own plugins to extend calibre's functionality" msgstr "Écrire vos propres extensions pour étendre les fonctionnalités de calibre" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:6 msgid "" "calibre has a very modular design. Almost all functionality in calibre comes" " in the form of plugins. Plugins are used for conversion, for downloading " "news (though these are called recipes), for various components of the user " "interface, to connect to different devices, to process files when adding " "them to calibre and so on. You can get a complete list of all the built-in " "plugins in calibre by going to :guilabel:`Preferences->Advanced->Plugins`." 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`." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:8 msgid "" "Here, we will teach you how to create your own plugins to add new features " "to calibre." msgstr "Ici, nous vous apprendrons comment créer vos propres extensions pour ajouter de nouvelles fonctionnalités à calibre." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:13 msgid "Contents" msgstr "Contenu" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:15 msgid "This only applies to calibre releases >= 0.8.60" msgstr "Ceci s'applique uniquement aux versions de calibre >=0.8.60" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:18 msgid "Anatomy of a calibre plugin" msgstr "Anatomie d'une extension calibre" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:20 msgid "" "A calibre plugin is very simple, it's just a ZIP file that contains some " "Python code and any other resources like image files needed by the plugin. " "Without further ado, let's see a basic example." 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." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:24 msgid "" "Suppose you have an installation of calibre that you are using to self " "publish various e-documents in EPUB and MOBI formats. You would like all " "files generated by calibre to have their publisher set as \"Hello world\", " "here's how to do it. Create a file named :file:`__init__.py` (this is a " "special name and must always be used for the main file of your plugin) and " "enter the following Python code into it:" 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 :" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:32 msgid "" "That's all. To add this code to calibre as a plugin, simply run the " "following in the folder in which you created :file:`__init__.py`::" 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`::" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:38 msgid "" "On macOS, the command line tools are inside the calibre bundle, for example," " if you installed calibre in :file:`/Applications` the command line tools " "are in :file:`/Applications/calibre.app/Contents/MacOS/`." 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/`." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:42 msgid "" "You can download the Hello World plugin from " ":download_file:`helloworld_plugin.zip`." msgstr "Vous pouvez télécharger le plugin Hello World depuis :download_file:`helloworld_plugin.zip`." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:45 msgid "" "Every time you use calibre to convert a book, the plugin's :meth:`run` " "method will be called and the converted book will have its publisher set to " "\"Hello World\". This is a trivial plugin, let's move on to a more complex " "example that actually adds a component to the user interface." 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." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:50 msgid "A User Interface plugin" msgstr "Une extension d'Interface Utilisateur" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:52 msgid "" "This plugin will be spread over a few files (to keep the code clean). It " "will show you how to get resources (images or data files) from the plugin " "ZIP file, allow users to configure your plugin, how to create elements in " "the calibre user interface and how to access and query the books database in" " calibre." 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." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:57 msgid "" "You can download this plugin from :download_file:`interface_demo_plugin.zip`" msgstr "Vous pouvez télécharger ce plugin à partir de :download_file:`interface_demo_plugin.zip`." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:61 msgid "" "The first thing to note is that this ZIP file has a lot more files in it, " "explained below, pay particular attention to ``plugin-import-name-" "interface_demo.txt``." 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``." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:64 msgid "**plugin-import-name-interface_demo.txt**" msgstr "**plugin-import-name-interface_demo.txt**" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:65 msgid "" "An empty text file used to enable the multi-file plugin magic. This file " "must be present in all plugins that use more than one .py file. It should be" " empty and its filename must be of the form: ``plugin-import-" "name-**some_name**.txt``. The presence of this file allows you to import " "code from the .py files present inside the ZIP file, using a statement " "like::" 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::" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:71 msgid "" "The prefix ``calibre_plugins`` must always be present. ``some_name`` comes " "from the filename of the empty text file. ``some_module`` refers to " ":file:`some_module.py` file inside the ZIP file. Note that this importing is" " just as powerful as regular Python imports. You can create packages and " "subpackages of .py modules inside the ZIP file, just like you would normally" " (by defining __init__.py in each sub-folder), and everything should \"just " "work\"." 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\"." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:76 msgid "" "The name you use for ``some_name`` enters a global namespace shared by all " "plugins, **so make it as unique as possible**. But remember that it must be " "a valid Python identifier (only alphabets, numbers and the underscore)." 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)." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:79 msgid "**__init__.py**" msgstr "**__init__.py**" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:80 msgid "As before, the file that defines the plugin class" msgstr "Comme précédemment, le fichier qui définit la classe de l'extension" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:82 msgid "**main.py**" msgstr "**main.py**" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:83 msgid "This file contains the actual code that does something useful" msgstr "Ce fichier contient le code actuel qui fait quelque chose d'utile" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:85 msgid "**ui.py**" msgstr "**ui.py**" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:86 msgid "This file defines the interface part of the plugin" msgstr "Ce fichier définit la partie interface de l'extension" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:88 msgid "**images/icon.png**" msgstr "**images/icon.png**" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:89 msgid "The icon for this plugin" msgstr "L'icône pour ce plugin" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:91 msgid "**about.txt**" msgstr "**about.txt**" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:92 msgid "A text file with information about the plugin" msgstr "Un fichier texte contenant des informations sur le plugin" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:94 msgid "**translations**" msgstr "**traductions**" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:95 msgid "" "A folder containing .mo files with the translations of the user interface of" " your plugin into different languages. See below for details." 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." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:99 msgid "Now let's look at the code." msgstr "Maintenant regardons le code" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:102 msgid "__init__.py" msgstr "__init__.py" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:104 msgid "First, the obligatory ``__init__.py`` to define the plugin metadata:" msgstr "Tout d'abord, l'obligatoirement ``__init__.py`` pour définir les métadonnées de l'extension :" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:109 msgid "" "The only noteworthy feature is the field :attr:`actual_plugin`. Since " "calibre has both command line and GUI interfaces, GUI plugins like this one " "should not load any GUI libraries in __init__.py. The actual_plugin field " "does this for you, by telling calibre that the actual plugin is to be found " "in another file inside your ZIP archive, which will only be loaded in a GUI " "context." 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." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:114 msgid "" "Remember that for this to work, you must have a plugin-import-name-" "some_name.txt file in your plugin ZIP file, as discussed above." 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." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:117 msgid "" "Also there are a couple of methods for enabling user configuration of the " "plugin. These are discussed below." msgstr "Il y a également quelques méthodes pour permettre la configuration utilisateur de l'extension. Celles-ci sont discutées ci-dessous." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:120 msgid "ui.py" msgstr "ui.py" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:122 msgid "" "Now let's look at ui.py which defines the actual GUI plugin. The source code" " is heavily commented and should be self explanatory:" msgstr "Maintenant regardons à ui.py qui définit le GUI habituel de l'extension. Le code source est fortement commenté et devrait être explicite :" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:128 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:220 msgid "main.py" msgstr "main.py" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:130 msgid "The actual logic to implement the Interface Plugin Demo dialog." msgstr "La logique actuelle pour mettre en application le dialogue de démo de l'interface de l'extension." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:136 msgid "Getting resources from the plugin ZIP file" msgstr "Obtention des ressources à partir du fichier ZIP de l'extension" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:138 msgid "" "calibre's plugin loading system defines a couple of built-in functions that " "allow you to conveniently get files from the plugin ZIP file." 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." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:140 msgid "**get_resources(name_or_list_of_names)**" msgstr "**get_resources(name_or_list_of_names)**" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:141 msgid "" "This function should be called with a list of paths to files inside the ZIP " "file. For example to access the file :file:`icon.png` in the folder images " "in the ZIP file, you would use: ``images/icon.png``. Always use a forward " "slash as the path separator, even on Windows. When you pass in a single " "name, the function will return the raw bytes of that file or None if the " "name was not found in the ZIP file. If you pass in more than one name then " "it returns a dictionary mapping the names to bytes. If a name is not found," " it will not be present in the returned dictionary." 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é." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:150 msgid "**get_icons(name_or_list_of_names, plugin_name='')**" msgstr "**get_icons(name_or_list_of_names, plugin_name='')**" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:151 msgid "" "A wrapper for get_resources() that creates QIcon objects from the raw bytes " "returned by get_resources. If a name is not found in the ZIP file the " "corresponding QIcon will be null. In order to support icon theme-ing, pass " "in the human friendly name of your plugin as ``plugin_name``. If the user is" " using an icon theme with icons for your plugin, they will be loaded " "preferentially." 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." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:160 msgid "Enabling user configuration of your plugin" msgstr "Activation de la configuration utilisateur pour votre extension" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:162 msgid "" "To allow users to configure your plugin, you must define three methods in " "your base plugin class, **is_customizable**, **config_widget** and " "**save_settings** as shown below:" 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 :" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:173 msgid "" "calibre has many different ways to store configuration data (a legacy of its" " long history). The recommended way is to use the **JSONConfig** class, " "which stores your configuration information in a .json file." 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." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:175 msgid "" "The code to manage configuration data in the demo plugin is in config.py:" msgstr "Le code pour gérer le données de configuration dans l'extension démo est dans config.py :" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:180 msgid "" "The ``prefs`` object is now available throughout the plugin code by a " "simple::" msgstr "L'objet ``prefs`` est maintenant disponible dans tout le code de l'extension par un simple::" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:185 msgid "You can see the ``prefs`` object being used in main.py:" msgstr "Vous pouvez voir l'objet ``prefs`` en cours d'utilisation dans main.py :" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:192 msgid "Edit book plugins" msgstr "Extensions d'édition de livre" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:194 msgid "" "Now let's change gears for a bit and look at creating a plugin to add tools " "to the calibre book editor. The plugin is available here: " ":download_file:`editor_demo_plugin.zip`." 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`." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:198 msgid "" "The first step, as for all plugins is to create the import name empty txt " "file, as described :ref:`above `. We shall name the file " "``plugin-import-name-editor_plugin_demo.txt``." 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`. Nous appellerons vle fichier ``plugin-import-name-editor_plugin_demo.txt``." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:202 msgid "" "Now we create the mandatory ``__init__.py`` file that contains metadata " "about the plugin -- its name, author, version, etc." 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." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:208 msgid "" "A single editor plugin can provide multiple tools each tool corresponds to a" " single button in the toolbar and entry in the :guilabel:`Plugins` menu in " "the editor. These can have sub-menus in case the tool has multiple related " "actions." 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." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:212 msgid "" "The tools must all be defined in the file ``main.py`` in your plugin. Every " "tool is a class that inherits from the " ":class:`calibre.gui2.tweak_book.plugin.Tool` class. Let's look at " "``main.py`` from the demo plugin, the source code is heavily commented and " "should be self-explanatory. Read the API documents of the " ":class:`calibre.gui2.tweak_book.plugin.Tool` class for more details." 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." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:222 msgid "" "Here we will see the definition of a single tool that will multiply all font" " sizes in the book by a number provided by the user. This tool demonstrates " "various important concepts that you will need in developing your own " "plugins, so you should read the (heavily commented) source code carefully." 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é)." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:230 msgid "" "Let's break down ``main.py``. We see that it defines a single tool, named " "*Magnify fonts*. This tool will ask the user for a number and multiply all " "font sizes in the book by that number." 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." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:234 msgid "" "The first important thing is the tool name which you must set to some " "relatively unique string as it will be used as the key for this tool." 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." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:237 msgid "" "The next important entry point is the " ":meth:`calibre.gui2.tweak_book.plugin.Tool.create_action`. This method " "creates the QAction objects that appear in the plugins toolbar and plugin " "menu. It also, optionally, assigns a keyboard shortcut that the user can " "customize. The triggered signal from the QAction is connected to the " "ask_user() method that asks the user for the font size multiplier, and then " "runs the magnification code." 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." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:245 msgid "" "The magnification code is well commented and fairly simple. The main things " "to note are that you get a reference to the editor window as ``self.gui`` " "and the editor *Boss* as ``self.boss``. The *Boss* is the object that " "controls the editor user interface. It has many useful methods, that are " "documented in the :class:`calibre.gui2.tweak_book.boss.Boss` class." 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`." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:251 msgid "" "Finally, there is ``self.current_container`` which is a reference to the " "book being edited as a " ":class:`calibre.ebooks.oeb.polish.container.Container` object. This " "represents the book as a collection of its constituent HTML/CSS/image files " "and has convenience methods for doing many useful things. The container " "object and various useful utility functions that can be reused in your " "plugin code are documented in :ref:`polish_api`." 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`." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:259 msgid "Adding translations to your plugin" msgstr "Ajout des traductions à votre extension" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:261 msgid "" "You can have all the user interface strings in your plugin translated and " "displayed in whatever language is set for the main calibre user interface." 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." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:264 msgid "" "The first step is to go through your plugin's source code and mark all user " "visible strings as translatable, by surrounding them in _(). For example::" 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::" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:269 msgid "" "Then use some program to generate .po files from your plugin source code. " "There should be one .po file for every language you want to translate into. " "For example: de.po for German, fr.po for French and so on. You can use the " "`Poedit `_ program for this." 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 `_ pour cela." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:274 msgid "" "Send these .po files to your translators. Once you get them back, compile " "them into .mo files. You can again use Poedit for that, or just do::" 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::" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:279 msgid "Put the .mo files into the ``translations`` folder in your plugin." msgstr "Déposez les fichiers .mo dans le répertoire ``translations`` dans votre extension." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:281 msgid "" "The last step is to simply call the function `load_translations()` at the " "top of your plugin's .py files. For performance reasons you should only call" " this function in those .py files that actually have translatable strings. " "So in a typical User Interface plugin you would call it at the top of " "``ui.py`` but not ``__init__.py``." 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``." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:287 msgid "" "You can test the translations of your plugins by changing the user interface" " language in calibre under :guilabel:`Preferences->Interface->Look & feel` " "or by running calibre with the ``CALIBRE_OVERRIDE_LANG`` environment " "variable set. For example::" 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 ::" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:293 msgid "" "Replace ``de`` with the language code of the language you want to test." msgstr "Remplac``de`` avec le code de langue de la langue que vous voulez tester." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:295 msgid "" "For translations with plurals, use the ``ngettext()`` function instead of " "``_()``. For example::" msgstr "Pour les traductions avec des pluriels, utilisez la fonction ``ngettext()`` au lieu de ``_()``. Par exemple ::" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:301 msgid "The plugin API" msgstr "L'API extension" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:303 msgid "" "As you may have noticed above, a plugin in calibre is a class. There are " "different classes for the different types of plugins in calibre. Details on " "each class, including the base class of all plugins can be found in " ":ref:`plugins`." 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`." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:306 msgid "" "Your plugin is almost certainly going to use code from calibre. To learn how" " to find various bits of functionality in the calibre code base, read the " "section on the calibre :ref:`code_layout`." 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." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:311 msgid "Debugging plugins" msgstr "Dépannage des extensions" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:313 msgid "" "The first, most important step is to run calibre in debug mode. You can do " "this from the command line with::" 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::" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:317 msgid "" "Or from within calibre by right-clicking the :guilabel:`Preferences` button " "or using the :kbd:`Ctrl+Shift+R` keyboard shortcut." 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`." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:319 msgid "" "When running from the command line, debug output will be printed to the " "console, when running from within calibre the output will go to a txt file." 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." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:321 msgid "" "You can insert print statements anywhere in your plugin code, they will be " "output in debug mode. Remember, this is Python, you really shouldn't need " "anything more than print statements to debug ;) I developed all of calibre " "using just this debugging technique." 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." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:323 msgid "" "You can quickly test changes to your plugin by using the following command " "line::" msgstr "Vous pouvez rapidement tester les changements de votre extension en utilisant la ligne de commande suivante::" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:328 msgid "" "This will shutdown a running calibre, wait for the shutdown to complete, " "then update your plugin in calibre and relaunch calibre." 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." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:331 msgid "More plugin examples" msgstr "Plus d'exemples d'extensions" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:333 msgid "" "You can find a list of many sophisticated calibre plugins `here " "`_." msgstr "Vous pouvez trouver une liste de nombreuses extensions calibre sophistiquées `ici`_." #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:336 msgid "Sharing your plugins with others" msgstr "Partager vos extensions avec les autres" #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:338 msgid "" "If you would like to share the plugins you have created with other users of " "calibre, post your plugin in a new thread in the `calibre plugins forum " "`_." 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 `_."