# SOME DESCRIPTIVE TITLE. # Copyright (C) Kovid Goyal # This file is distributed under the same license as the calibre package. # # Translators: 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-11-21 02:54+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: French (Canada) (http://app.transifex.com/calibre/calibre/language/fr_CA/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fr_CA\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" #: ../../../__w/calibre/calibre/manual/function_mode.rst:2 msgid "Function mode for Search & replace in the Editor" msgstr "Mode fonction pour Rechercher & remplacer dans l'Éditeur" #: ../../../__w/calibre/calibre/manual/function_mode.rst:4 msgid "" "The :guilabel:`Search & replace` tool in the editor supports a *function " "mode*. In this mode, you can combine regular expressions (see :doc:`regexp`)" " with arbitrarily powerful Python functions to do all sorts of advanced text" " processing." msgstr "" #: ../../../__w/calibre/calibre/manual/function_mode.rst:9 msgid "" "In the standard *regexp* mode for search and replace, you specify both a " "regular expression to search for as well as a template that is used to " "replace all found matches. In function mode, instead of using a fixed " "template, you specify an arbitrary function, in the `Python programming " "language `_. This allows you to do lots of things " "that are not possible with simple templates." msgstr "Dans le mode standard *regexp* pour rechercher et remplacer, vous spécifiez tant une expression régulière à rechercher qu'un modèle qui est utilisé pour remplacer toutes les correspondances trouvées. Dans le mode fonction, à la place d'utiliser un modèle fixe, vous spécifiez une fonction quelconque, dans le `langage de programmation Python `_. Ceci vous permet de faire beaucoup de choses qui ne sont pas possibles avec de simples modèles." #: ../../../__w/calibre/calibre/manual/function_mode.rst:16 msgid "" "Techniques for using function mode and the syntax will be described by means" " of examples, showing you how to create functions to perform progressively " "more complex tasks." msgstr "Les techniques pour utiliser le mode fonction et la syntaxe seront décrites à l'aide d'exemples, vous montrant comment créer des fonctions pour effectuer progressivement des tâches plus complexes." #: ../../../__w/calibre/calibre/manual/function_mode.rst:21 msgid "The Function mode" msgstr "Le mode Fonction" #: ../../../__w/calibre/calibre/manual/function_mode.rst:26 msgid "Automatically fixing the case of headings in the document" msgstr "Réparer automatiquement la casse des titres dans le document" #: ../../../__w/calibre/calibre/manual/function_mode.rst:28 msgid "" "Here, we will leverage one of the builtin functions in the editor to " "automatically change the case of all text inside heading tags to title " "case::" msgstr "Ici , nous utiliserons l'une des fonctions intégrée dans l'éditeur pour changer automatiquement la casse de tous le texte à l'intérieur des balises titre en casse titre ::" #: ../../../__w/calibre/calibre/manual/function_mode.rst:33 msgid "" "For the function, simply choose the :guilabel:`Title-case text (ignore " "tags)` builtin function. This will change titles that look like: ``

some " "titLE

`` to ``

Some Title

``. It will work even if there are " "other HTML tags inside the heading tags." msgstr "" #: ../../../__w/calibre/calibre/manual/function_mode.rst:40 msgid "Your first custom function - smartening hyphens" msgstr "Votre première fonction personnalisée - les traits d'union d'embellissement" #: ../../../__w/calibre/calibre/manual/function_mode.rst:42 msgid "" "The real power of function mode comes from being able to create your own " "functions to process text in arbitrary ways. The Smarten Punctuation tool in" " the editor leaves individual hyphens alone, so you can use this function to" " replace them with em-dashes." msgstr "" #: ../../../__w/calibre/calibre/manual/function_mode.rst:47 msgid "" "To create a new function, simply click the :guilabel:`Create/edit` button to" " create a new function and copy the Python code from below." msgstr "Pour créer une nouvelle fonction, cliquez simplement le bouton :guilabel:`Créer/Éditer` pour créer une nouvelle fonction et copiez le code Python qui se trouve ci-dessous." #: ../../../__w/calibre/calibre/manual/function_mode.rst:55 msgid "" "Every :guilabel:`Search & replace` custom function must have a unique name " "and consist of a Python function named replace, that accepts all the " "arguments shown above. For the moment, we won't worry about all the " "different arguments to ``replace()`` function. Just focus on the ``match`` " "argument. It represents a match when running a search and replace. Its full " "documentation in available `here " "`_. ``match.group()``" " simply returns all the matched text and all we do is replace hyphens in " "that text with em-dashes, first replacing double hyphens and then single " "hyphens." msgstr "Chaque fonction personnalisée :guilabel:`Rechercher & remplacer` doit avoir un nom unique et consister en une fonction Python nommée replace, qui accepte tous les arguments affichés ci-dessus. Pour le moment, nous ne nous inquiéterons pas à propos de tous les différents arguments de la fonction ``replace()``. Focalisons-nous uniquement sur l'argument ``match``. Il représente une correspondance lors de l'exécution d'un rechercher et remplacer. Sa documentation complète est disponible `ici `_. ``match.group()`` renvoie simplement tout le texte correspondant et tout ce que nous faisons est de remplacer les traits d'union dans ce texte par des tirets fins, en remplaçant d'abord les doubles traits d'union et ensuite les traits d'union seuls." #: ../../../__w/calibre/calibre/manual/function_mode.rst:65 msgid "Use this function with the find regular expression::" msgstr "Utilisez cette fonction avec l'expression régulière de recherche ::" #: ../../../__w/calibre/calibre/manual/function_mode.rst:69 msgid "" "And it will replace all hyphens with em-dashes, but only in actual text and " "not inside HTML tag definitions." msgstr "Et il remplacera tous les traits d'union par des tirets fins, mais seulement dans le texte actuel et non dans les définitions de balises HTML." #: ../../../__w/calibre/calibre/manual/function_mode.rst:74 msgid "" "The power of function mode - using a spelling dictionary to fix mis-" "hyphenated words" msgstr "La force du mode fonction - utiliser un dictionnaire orthographique pour réparer les mots aux mauvais traits d'union " #: ../../../__w/calibre/calibre/manual/function_mode.rst:76 msgid "" "Often, e-books created from scans of printed books contain mis-hyphenated " "words -- words that were split at the end of the line on the printed page. " "We will write a simple function to automatically find and fix such words." msgstr "Souvent les livres numériques créés à partir de scans de livres imprimés contiennent des mots avec de mauvais traits d'union -- les mots qui sont divisés à la fin de la ligne de la page imprimée. Nous écrirons une fonction simple pour trouver et réparer automatiquement de tels mots." #: ../../../__w/calibre/calibre/manual/function_mode.rst:101 msgid "Use this function with the same find expression as before, namely::" msgstr "Utilisez cette fonction avec la même expression de recherche que précédemment, à savoir ::" #: ../../../__w/calibre/calibre/manual/function_mode.rst:105 msgid "" "And it will magically fix all mis-hyphenated words in the text of the book. " "The main trick is to use one of the useful extra arguments to the replace " "function, ``dictionaries``. This refers to the dictionaries the editor " "itself uses to spell check text in the book. What this function does is look" " for words separated by a hyphen, remove the hyphen and check if the " "dictionary recognizes the composite word, if it does, the original words are" " replaced by the hyphen free composite word." msgstr "Et il réparera magiquement tous les mots avec de mauvais traits d'union dans le texte du livre. L'astuce principale est d'utiliser l'un des utiles arguments supplémentaires de la fonction de remplacement, ``dictionaries``. Celui-ci se réfère aux dictionnaires que l'éditeur utilise lui-même pour vérifier orthographiquement le texte dans le livre. Ce que fait cette fonction est de regarder aux mots séparés par un trait d'union, supprimer le trait d'union et vérifier si le dictionnaire reconnait le mot composé, s'il le fait, les mots originaux sont remplacés par le mot composé libre du trait d'union." #: ../../../__w/calibre/calibre/manual/function_mode.rst:113 msgid "" "Note that one limitation of this technique is it will only work for mono-" "lingual books, because, by default, ``dictionaries.recognized()`` uses the " "main language of the book." msgstr "Notez qu'une limitation à cette technique est qu'elle ne fonctionnera uniquement qu'avec les livres unilingues, car, par défaut, ``dictionaries.recognized()`` utilise la langue principale du livre." #: ../../../__w/calibre/calibre/manual/function_mode.rst:119 msgid "Auto numbering sections" msgstr "Auto numérotation des sections" #: ../../../__w/calibre/calibre/manual/function_mode.rst:121 msgid "" "Now we will see something a little different. Suppose your HTML file has " "many sections, each with a heading in an :code:`

` tag that looks like " ":code:`

Some text

`. You can create a custom function that will " "automatically number these headings with consecutive section numbers, so " "that they look like :code:`

1. Some text

`." msgstr "Maintenant nous allons voir quelque chose d'un peu différent. Supposons que votre fichier HTML ait beaucoup de sections, chacune avec un titre dans une balise :code:`

` ressemblant à :code:`

Un certain texte

`. Vous pouvez créer une fonction personnalisée qui numérotera automatiquement ces titres avec des numéros de section consécutifs, afin qu'elles ressemblent à :code:`

1. Un certain texte

`." #: ../../../__w/calibre/calibre/manual/function_mode.rst:137 msgid "Use it with the find expression::" msgstr "Utilisez la avec l'expression de recherche ::" #: ../../../__w/calibre/calibre/manual/function_mode.rst:141 msgid "" "Place the cursor at the top of the file and click :guilabel:`Replace all`." msgstr "Placez le curseur en haut du fichier et cliquez :guilabel:`Remplacez tout`" #: ../../../__w/calibre/calibre/manual/function_mode.rst:143 msgid "" "This function uses another of the useful extra arguments to ``replace()``: " "the ``number`` argument. When doing a :guilabel:`Replace All` number is " "automatically incremented for every successive match." msgstr "Cette fonction utilise l'un des utiles arguments supplémentaires pour ``replace()`` l'argument ``number`. Lorsque vous faites un :guilabel:`Remplacer Tout` le nombre est incrémenté automatiquement pour chaque correspondante successive ." #: ../../../__w/calibre/calibre/manual/function_mode.rst:147 msgid "" "Another new feature is the use of ``replace.file_order`` -- setting that to " "``'spine'`` means that if this search is run on multiple HTML files, the " "files are processed in the order in which they appear in the book. See " ":ref:`file_order_replace_all` for details." msgstr "Une autre nouvelle fonctionnalité est l'utilisation de `replace.file_order`` -- régler cela à ``spine`` signifie que si cette recherche est exécutée sur de multiples fichiers HTML, ces fichiers seront traités dans l'ordre dans lequel ils apparaissent dans le livre. Voir :ref:`file_order_replace_all` pour des détails." #: ../../../__w/calibre/calibre/manual/function_mode.rst:154 msgid "Auto create a Table of Contents" msgstr "Auto créer une Table des Matières" #: ../../../__w/calibre/calibre/manual/function_mode.rst:156 msgid "" "Finally, let's try something a little more ambitious. Suppose your book has " "headings in ``h1`` and ``h2`` tags that look like ``

Some " "Text

``. We will auto-generate an HTML Table of Contents based on these " "headings. Create the custom function below:" msgstr "" #: ../../../__w/calibre/calibre/manual/function_mode.rst:199 msgid "And use it with the find expression::" msgstr "Et utilisez là pour trouver l'expression::" #: ../../../__w/calibre/calibre/manual/function_mode.rst:203 msgid "" "Run the search on :guilabel:`All text files` and at the end of the search, a" " window will popup with \"Debug output from your function\" which will have " "the HTML Table of Contents, ready to be pasted into :file:`toc.html`." msgstr "Lancez la recherche sur :guilabel:`Tous les fichiers textes` et à la fin de la recherche, une fenêtre apparaîtra avec \"Résultat de débogage pour votre fonction\" qui contiendra la Table des Matières HTML, prête à être collée dans :file:`toc.html`." #: ../../../__w/calibre/calibre/manual/function_mode.rst:207 msgid "" "The function above is heavily commented, so it should be easy to follow. The" " key new feature is the use of another useful extra argument to the " "``replace()`` function, the ``data`` object. The ``data`` object is a Python" " *dictionary* that persists between all successive invocations of " "``replace()`` during a single :guilabel:`Replace All` operation." msgstr "" #: ../../../__w/calibre/calibre/manual/function_mode.rst:213 msgid "" "Another new feature is the use of ``call_after_last_match`` -- setting that " "to ``True`` on the ``replace()`` function means that the editor will call " "``replace()`` one extra time after all matches have been found. For this " "extra call, the match object will be ``None``." msgstr "Une autre nouvelle fonctionnalité est l'utilisation de ``call_after_last_match`` -- paramétrer cela à ``True`` sur la fonction ``replace()`` signifie que l'éditeur appellera ``replace()`` une fois de plus après que toutes les correspondances aient été trouvées. Pour cet appel supplémentaire, l'objet correspondant sera``None``" #: ../../../__w/calibre/calibre/manual/function_mode.rst:218 msgid "" "This was just a demonstration to show you the power of function mode, if you" " really needed to generate a Table of Contents from headings in your book, " "you would be better off using the dedicated Table of Contents tool in " ":guilabel:`Tools->Table of Contents`." msgstr "Ceci était juste une démonstration pour vous montrer la puissance du mode fonction. Si vous avez réellement besoin de générer une Table des Matières à partir des titres dans votre livre, vous aurez mieux en utilisant l'outil Table des Matières dédié dans :guilabel:`Tools->Table des Matières`." #: ../../../__w/calibre/calibre/manual/function_mode.rst:224 msgid "The API for the function mode" msgstr "L'API pour le mode fonction" #: ../../../__w/calibre/calibre/manual/function_mode.rst:226 msgid "" "All function mode functions must be Python functions named replace, with the" " following signature::" msgstr "Toutes les fonctions du mode fonction doivent être des fonctions Python nommées replace, avec la signature suivante ::" #: ../../../__w/calibre/calibre/manual/function_mode.rst:232 msgid "" "When a find/replace is run, for every match that is found, the ``replace()``" " function will be called, it must return the replacement string for that " "match. If no replacements are to be done, it should return ``match.group()``" " which is the original string. The various arguments to the ``replace()`` " "function are documented below." msgstr "Quand un rechercher/remplacer est exécuté, pour chaque correspondance qui est trouvée, la fonction ``replace()`` sera appelée, elle doit retourner la chaîne de remplacement pour cette correspondance. Si aucuns remplacements ne doivent être effectués, elle devrait retourner ``match.group()`` qui est la chaîne originale. Les divers arguments de la fonction ``replace()`` sont documentées ci-dessous." #: ../../../__w/calibre/calibre/manual/function_mode.rst:239 msgid "The ``match`` argument" msgstr "L'argument ``match``" #: ../../../__w/calibre/calibre/manual/function_mode.rst:241 msgid "" "The ``match`` argument represents the currently found match. It is a `Python" " Match object `_. Its" " most useful method is ``group()`` which can be used to get the matched text" " corresponding to individual capture groups in the search regular " "expression." msgstr "L'argument ``match`` représente la correspondance actuellement trouvée. C'est un `objet Python Match `_. Sa méthode la plus utile est ``group()`` qui peut être utilisée pour récupérer le texte apparié correspondant à la capture de groupes individuels dans l'expression régulière de recherche." #: ../../../__w/calibre/calibre/manual/function_mode.rst:248 msgid "The ``number`` argument" msgstr "L'argument ``number``" #: ../../../__w/calibre/calibre/manual/function_mode.rst:250 msgid "" "The ``number`` argument is the number of the current match. When you run " ":guilabel:`Replace All`, every successive match will cause ``replace()`` to " "be called with an increasing number. The first match has number 1." msgstr "L'argument ``number`` est le nombre de l'actuelle correspondance. Lorsque vous exécutez :guilabel:`Remplacer Tout`, chaque correspondance successive entraînera ``replace()`` à être appelé avec un nombre incrémenté. La première correspondance porte le numéro 1." #: ../../../__w/calibre/calibre/manual/function_mode.rst:255 msgid "The ``file_name`` argument" msgstr "L'argument ``file_name``" #: ../../../__w/calibre/calibre/manual/function_mode.rst:257 msgid "" "This is the filename of the file in which the current match was found. When " "searching inside marked text, the ``file_name`` is empty. The ``file_name`` " "is in canonical form, a path relative to the root of the book, using ``/`` " "as the path separator." msgstr "Ceci est le nom du fichier dans lequel la correspondance actuelle a été trouvée. Lors d'une recherche à l'intérieur d'un texte marqué, le ``file_name`` est vide. Le ``file_name`` est de forme reconnue, une chemin relatif à la racine du livre, utilisant ``/`` comme séparateur de chemin." #: ../../../__w/calibre/calibre/manual/function_mode.rst:263 msgid "The ``metadata`` argument" msgstr "L'argument ``metadata``" #: ../../../__w/calibre/calibre/manual/function_mode.rst:265 msgid "" "This represents the metadata of the current book, such as title, authors, " "language, etc. It is an object of class " ":class:`calibre.ebooks.metadata.book.base.Metadata`. Useful attributes " "include, ``title``, ``authors`` (a list of authors) and ``language`` (the " "language code)." msgstr "Ceci représente les métadonnées du livre actuel, comme le titre, les auteurs, la langue, etc. C'est un objet de la classe :class:`calibre.ebooks.metadata.book.base.Metadata`. Les attributs utiles incluent, ``title``, ``authors`` (une liste d'auteur) et ``language`` (le code de langue)." #: ../../../__w/calibre/calibre/manual/function_mode.rst:271 msgid "The ``dictionaries`` argument" msgstr "L'argument ``dictionaries``" #: ../../../__w/calibre/calibre/manual/function_mode.rst:273 msgid "" "This represents the collection of dictionaries used for spell checking the " "current book. Its most useful method is ``dictionaries.recognized(word)`` " "which will return ``True`` if the passed in word is recognized by the " "dictionary for the current book's language." msgstr "Ceci représente la collection de dictionnaires utilisés pour la vérification orthographique du livre actuel. Sa méthode la plus utile est ``dictionaries.recognized(word)`` qui renverra ``True```si le mot analysé est reconnu par le dictionnaire de la langue actuelle du livre." #: ../../../__w/calibre/calibre/manual/function_mode.rst:279 msgid "The ``data`` argument" msgstr "L'argument ``data``" #: ../../../__w/calibre/calibre/manual/function_mode.rst:281 msgid "" "This a simple Python ``dictionary``. When you run :guilabel:`Replace all`, " "every successive match will cause ``replace()`` to be called with the same " "``dictionary`` as data. You can thus use it to store arbitrary data between " "invocations of ``replace()`` during a :guilabel:`Replace all` operation." msgstr "" #: ../../../__w/calibre/calibre/manual/function_mode.rst:288 msgid "The ``functions`` argument" msgstr "L'argument ``functions``" #: ../../../__w/calibre/calibre/manual/function_mode.rst:290 msgid "" "The ``functions`` argument gives you access to all other user defined " "functions. This is useful for code re-use. You can define utility functions " "in one place and re-use them in all your other functions. For example, " "suppose you create a function named ``My Function`` like this:" msgstr "" #: ../../../__w/calibre/calibre/manual/function_mode.rst:303 msgid "" "Then, in another function, you can access the ``utility()`` function like " "this:" msgstr "Alors, dans une autre fonction, vous pouvez accéder à la fonction ``utility()`` comme ceci :" #: ../../../__w/calibre/calibre/manual/function_mode.rst:311 msgid "" "You can also use the functions object to store persistent data, that can be " "re-used by other functions. For example, you could have one function that " "when run with :guilabel:`Replace All` collects some data and another " "function that uses it when it is run afterwards. Consider the following two " "functions:" msgstr "Vous pouvez aussi utiliser les objets fonctions pour stocker des données persistantes, qui peuvent être ré-utilisées par d'autres fonctions. Par exemple, vous pourriez avoir une fonction qui lorsqu'elle s'exécute avec :guilabel:`Remplacer Tout` collecte des données et une autre fonction qui les utilisera lorsqu'elle sera lancée plus tard. Considérez les deux fonctions suivantes :" #: ../../../__w/calibre/calibre/manual/function_mode.rst:331 msgid "Debugging your functions" msgstr "Dépanner vos fonctions" #: ../../../__w/calibre/calibre/manual/function_mode.rst:333 msgid "" "You can debug the functions you create by using the standard ``print()`` " "function from Python. The output of print will be displayed in a popup " "window after the Find/replace has completed. You saw an example of using " "``print()`` to output an entire table of contents above." msgstr "Vous pouvez dépanner les fonctions que vous créez en utilisant la fonction standard ``print()`` de Python. Le résultat de print sera affiché dans une fenêtre popup après que le Rechercher/remplacer soit terminé. Nous avons vu un exemple de l'utilisation de ``print()`` pour sortir une table des matières entière plus haut." #: ../../../__w/calibre/calibre/manual/function_mode.rst:341 msgid "Choose file order when running on multiple HTML files" msgstr "Choisissez l'ordre de fichier lors de l'exécution sur de multiples fichiers HTML" #: ../../../__w/calibre/calibre/manual/function_mode.rst:343 msgid "" "When you run a :guilabel:`Replace all` on multiple HTML files, the order in " "which the files are processed depends on what files you have open for " "editing. You can force the search to process files in the order in which " "they appear by setting the ``file_order`` attribute on your function, like " "this:" msgstr "" #: ../../../__w/calibre/calibre/manual/function_mode.rst:355 msgid "" "``file_order`` accepts two values, ``spine`` and ``spine-reverse`` which " "cause the search to process multiple files in the order they appear in the " "book, either forwards or backwards, respectively." msgstr "``file_order`` accepte deux valeurs, ``spine`` et ``spine-reverse`` qui entraîne le traitement de multiples fichiers dans l'ordre où ils apparaissent dans le livre, soit descendant soit ascendant, respectivement." #: ../../../__w/calibre/calibre/manual/function_mode.rst:360 msgid "" "Having your function called an extra time after the last match is found" msgstr "Appelle votre fonction une dernière fois après que la dernière correspondance ait été trouvée." #: ../../../__w/calibre/calibre/manual/function_mode.rst:362 msgid "" "Sometimes, as in the auto generate table of contents example above, it is " "useful to have your function called an extra time after the last match is " "found. You can do this by setting the ``call_after_last_match`` attribute on" " your function, like this:" msgstr "Parfois, comme dans l'exemple de la table des matières auto-générée ci-dessus, il est utile que votre fonction soit appelée une nouvelle fois après que la dernière correspondance ait été trouvée. Vous pouvez faire ceci en paramétrant l'attribut ``call_after_last_match`` dans votre fonction, comme ceci :" #: ../../../__w/calibre/calibre/manual/function_mode.rst:376 msgid "Appending the output from the function to marked text" msgstr "Ajouter le résultat de la fonction au texte marqué" #: ../../../__w/calibre/calibre/manual/function_mode.rst:378 msgid "" "When running search and replace on marked text, it is sometimes useful to " "append some text to the end of the marked text. You can do that by setting " "the ``append_final_output_to_marked`` attribute on your function (note that " "you also need to set ``call_after_last_match``), like this:" msgstr "" #: ../../../__w/calibre/calibre/manual/function_mode.rst:393 msgid "Suppressing the result dialog when performing searches on marked text" msgstr "Suppression du dialogue résultant lorsque des recherches sont effectuées sur du texte marqué" #: ../../../__w/calibre/calibre/manual/function_mode.rst:395 msgid "" "You can also suppress the result dialog (which can slow down the repeated " "application of a search/replace on many blocks of text) by setting the " "``suppress_result_dialog`` attribute on your function, like this:" msgstr "Vous pouvez également supprimer le résultat du dialogue (qui peut ralentir l'application répétée d'un rechercher/remplacer sur beaucoup de blocs de texte) en paramétrant l'attribut ``suppress_result_dialog`` sur votre fonction, comme ceci :" #: ../../../__w/calibre/calibre/manual/function_mode.rst:408 msgid "More examples" msgstr "Plus d'exemples" #: ../../../__w/calibre/calibre/manual/function_mode.rst:410 msgid "" "More useful examples, contributed by calibre users, can be found in the " "`calibre E-book editor forum " "`_." msgstr "Plus d'exemples utiles, fournis par des utilisateurs de calibre, peuvent être trouvés dans le `Forum Éditeur de livre numérique de calibre `_."