Debian Codegraph @

translations/manual/es_MX/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 msgid ""
7 msgstr ""
8 "Project-Id-Version: calibre\n"
9 "Report-Msgid-Bugs-To: \n"
10 "POT-Creation-Date: 2026-02-17 16:44+0000\n"
11 "PO-Revision-Date: 2014-06-17 08:35+0000\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Language-Team: Spanish (Mexico) (http://app.transifex.com/calibre/calibre/language/es_MX/)\n"
14 "MIME-Version: 1.0\n"
15 "Content-Type: text/plain; charset=UTF-8\n"
16 "Content-Transfer-Encoding: 8bit\n"
17 "Language: es_MX\n"
18 "Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n"
19
20 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:4
21 msgid "Writing your own plugins to extend calibre's functionality"
22 msgstr "Escribir sus propios complementos para extender la funcionalidad de calibre"
23
24 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:6
25 msgid ""
26 "calibre has a very modular design. Almost all functionality in calibre comes"
27 " in the form of plugins. Plugins are used for conversion, for downloading "
28 "news (though these are called recipes), for various components of the user "
29 "interface, to connect to different devices, to process files when adding "
30 "them to calibre and so on. You can get a complete list of all the built-in "
31 "plugins in calibre by going to :guilabel:`Preferences->Advanced->Plugins`."
32 msgstr "calibre tiene un diseño muy modular. Casi todas las funciones de calibre vienen en forma de complementos. Los complementos se utilizan para la conversión, para la descarga de noticias (aunque éstos se llaman fórmulas), para diversos componentes de la interfaz de usuario, para conectarse a diferentes dispositivos, para procesar archivos cuando se añaden a calibre, etcétera. Puede obtener una lista completa de todos los complementos integrados en calibre en :guilabel:`Preferencias > Avanzado > Complementos`."
33
34 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:8
35 msgid ""
36 "Here, we will teach you how to create your own plugins to add new features "
37 "to calibre."
38 msgstr "Aquí le enseñaremos como crear sus propios complementos para agregar funciones a calibre."
39
40 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:13
41 msgid "Contents"
42 msgstr "Contenido"
43
44 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:15
45 msgid "This only applies to calibre releases >= 0.8.60"
46 msgstr ""
47
48 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:18
49 msgid "Anatomy of a calibre plugin"
50 msgstr "Anatomía de un complemento de calibre"
51
52 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:20
53 msgid ""
54 "A calibre plugin is very simple, it's just a ZIP file that contains some "
55 "Python code and any other resources like image files needed by the plugin. "
56 "Without further ado, let's see a basic example."
57 msgstr "Un complemento de calibre es muy sencillo, no es más que un archivo ZIP que contiene algo de código Python y otros recursos, como archivos de imagen, que necesite el complemento. Sin más preámbulos, vamos a ver un ejemplo básico."
58
59 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:24
60 msgid ""
61 "Suppose you have an installation of calibre that you are using to self "
62 "publish various e-documents in EPUB and MOBI formats. You would like all "
63 "files generated by calibre to have their publisher set as \"Hello world\", "
64 "here's how to do it. Create a file named :file:`__init__.py` (this is a "
65 "special name and must always be used for the main file of your plugin) and "
66 "enter the following Python code into it:"
67 msgstr "Supongamos que está usando una instalación de calibre publicar sus propios documentos electrónicos en formatos EPUB y MOBI. Le gustaría que todos los archivos generados por calibre establecieran la editorial como «Hello World», he aquí cómo hacerlo. Cree un archivo llamado :file:`__init __.py` (éste es un nombre especial y siempre debe ser el del archivo principal del complemento) e introduzca el siguiente código Python en él:"
68
69 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:32
70 msgid ""
71 "That's all. To add this code to calibre as a plugin, simply run the "
72 "following in the folder in which you created :file:`__init__.py`::"
73 msgstr "Eso es todo. Para agregar este código a calibre como un complemento, simplemente ejecute lo siguiente en la carpeta donde reside el archivo :file:`__init__.py`::"
74
75 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:38
76 msgid ""
77 "On macOS, the command line tools are inside the calibre bundle, for example,"
78 " if you installed calibre in :file:`/Applications` the command line tools "
79 "are in :file:`/Applications/calibre.app/Contents/MacOS/`."
80 msgstr "En macOS, las herramientas de línea de órdenes están dentro del paquete calibre, por ejemplo, si ha instalado calibre en :file:`/Aplicaciones` las herramientas de línea de órdenes están en :file:/Aplicaciones/calibre.app/Contents/MacOS/`."
81
82 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:42
83 msgid ""
84 "You can download the Hello World plugin from "
85 ":download_file:`helloworld_plugin.zip`."
86 msgstr "Puede descargar el complemento Hello World de :download_file:`helloworld_plugin.zip`."
87
88 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:45
89 msgid ""
90 "Every time you use calibre to convert a book, the plugin's :meth:`run` "
91 "method will be called and the converted book will have its publisher set to "
92 "\"Hello World\". This is a trivial plugin, let's move on to a more complex "
93 "example that actually adds a component to the user interface."
94 msgstr ""
95
96 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:50
97 msgid "A User Interface plugin"
98 msgstr ""
99
100 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:52
101 msgid ""
102 "This plugin will be spread over a few files (to keep the code clean). It "
103 "will show you how to get resources (images or data files) from the plugin "
104 "ZIP file, allow users to configure your plugin, how to create elements in "
105 "the calibre user interface and how to access and query the books database in"
106 " calibre."
107 msgstr "Este complemento ocupará unos pocos archivos (para mantener el código más limpio). Le mostrará cómo obtener recursos (imágenes o archivos de datos) desde el archivo ZIP del complemento, cómo permitir a los usuarios configurar el complemento, cómo crear elementos en la interfaz de usuario de calibre y cómo acceder y consultar la base de datos de libros de calibre."
108
109 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:57
110 msgid ""
111 "You can download this plugin from :download_file:`interface_demo_plugin.zip`"
112 msgstr "Puede descargar este complemento de :download_file:`interface_demo_plugin.zip`."
113
114 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:61
115 msgid ""
116 "The first thing to note is that this ZIP file has a lot more files in it, "
117 "explained below, pay particular attention to ``plugin-import-name-"
118 "interface_demo.txt``."
119 msgstr "Lo primero que hay que tener en cuenta es que este archivo ZIP tiene muchos más archivos en su interior, explicados a continuación, preste especial atención a ``plugin-import-name-interface_demo.txt``."
120
121 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:64
122 msgid "**plugin-import-name-interface_demo.txt**"
123 msgstr ""
124
125 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:65
126 msgid ""
127 "An empty text file used to enable the multi-file plugin magic. This file "
128 "must be present in all plugins that use more than one .py file. It should be"
129 " empty and its filename must be of the form: ``plugin-import-"
130 "name-**some_name**.txt``. The presence of this file allows you to import "
131 "code from the .py files present inside the ZIP file, using a statement "
132 "like::"
133 msgstr "Un archivo de texto vacío utilizado para activar la gestión de múltiples archivos en el complemento. Este archivo debe estar presente en todos los complementos que utilicen más de un archivo .py. Debe quedar vacío y su nombre debe ser de la forma: ``plugin-import-name-**some_name**.txt``. La presencia de este archivo le permite importar código de los archivos .py presentes dentro del archivo ZIP, usando una sentencia como ésta::"
134
135 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:71
136 msgid ""
137 "The prefix ``calibre_plugins`` must always be present. ``some_name`` comes "
138 "from the filename of the empty text file. ``some_module`` refers to "
139 ":file:`some_module.py` file inside the ZIP file. Note that this importing is"
140 " just as powerful as regular Python imports. You can create packages and "
141 "subpackages of .py modules inside the ZIP file, just like you would normally"
142 " (by defining __init__.py in each sub-folder), and everything should \"just "
143 "work\"."
144 msgstr ""
145
146 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:76
147 msgid ""
148 "The name you use for ``some_name`` enters a global namespace shared by all "
149 "plugins, **so make it as unique as possible**. But remember that it must be "
150 "a valid Python identifier (only alphabets, numbers and the underscore)."
151 msgstr "El nombre que utilice para ``some_name`` entra en un espacio global de nombres compartido por todos los complementos, **así que hágalo tan único como sea posible**. Pero recuerde que debe ser un identificador Python válido (sólo letras, números y guión bajo)."
152
153 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:79
154 msgid "**__init__.py**"
155 msgstr ""
156
157 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:80
158 msgid "As before, the file that defines the plugin class"
159 msgstr "Como antes, el archivo que define la clase del complemento"
160
161 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:82
162 msgid "**main.py**"
163 msgstr ""
164
165 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:83
166 msgid "This file contains the actual code that does something useful"
167 msgstr "Este archivo contiene el código real que realiza alguna operación útil"
168
169 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:85
170 msgid "**ui.py**"
171 msgstr ""
172
173 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:86
174 msgid "This file defines the interface part of the plugin"
175 msgstr "Este archivo define la interfaz del complemento"
176
177 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:88
178 msgid "**images/icon.png**"
179 msgstr "**images/icon.png**"
180
181 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:89
182 msgid "The icon for this plugin"
183 msgstr "El icono para este complemento"
184
185 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:91
186 msgid "**about.txt**"
187 msgstr "**about.txt**"
188
189 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:92
190 msgid "A text file with information about the plugin"
191 msgstr "Un archivo de texto con información acerca de este complemento"
192
193 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:94
194 msgid "**translations**"
195 msgstr "**translations**"
196
197 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:95
198 msgid ""
199 "A folder containing .mo files with the translations of the user interface of"
200 " your plugin into different languages. See below for details."
201 msgstr "Una carpeta que contiene archivos .mo con las traducciones de la interfaz de usuario del complemento a diferentes idiomas. Ver más adelante para más detalles."
202
203 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:99
204 msgid "Now let's look at the code."
205 msgstr "Ahora veamos el código."
206
207 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:102
208 msgid "__init__.py"
209 msgstr ""
210
211 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:104
212 msgid "First, the obligatory ``__init__.py`` to define the plugin metadata:"
213 msgstr "Primero, el ``__init__.py`` obligatorio para definir los metadatos del complemento:"
214
215 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:109
216 msgid ""
217 "The only noteworthy feature is the field :attr:`actual_plugin`. Since "
218 "calibre has both command line and GUI interfaces, GUI plugins like this one "
219 "should not load any GUI libraries in __init__.py. The actual_plugin field "
220 "does this for you, by telling calibre that the actual plugin is to be found "
221 "in another file inside your ZIP archive, which will only be loaded in a GUI "
222 "context."
223 msgstr "La única característica notable es el campo :attr:`actual_plugin`. Puesto que calibre posee tanto una interfaz gráfica como de línea de órdenes, los complementos con interfaz gráfica como éste no cargan ninguna biblioteca gráfica en __init__.py. El campo actual_plugin se encargad de esto, informando a calibre de que el complemento real se encuentra en otro archivo dentro del archivo ZIP, que sólo se cargará en un contexto de interfaz gráfica."
224
225 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:114
226 msgid ""
227 "Remember that for this to work, you must have a plugin-import-name-"
228 "some_name.txt file in your plugin ZIP file, as discussed above."
229 msgstr "Recuerde que para que esto funcione, debe tener un archivo plugin-import-name-some_name.txt en el archivo ZIP del complemento, como se discutió anteriormente."
230
231 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:117
232 msgid ""
233 "Also there are a couple of methods for enabling user configuration of the "
234 "plugin. These are discussed below."
235 msgstr "También hay un par de métodos para permitir la configuración por parte del usuario del complemento. Éstos se discuten más adelante."
236
237 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:120
238 msgid "ui.py"
239 msgstr ""
240
241 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:122
242 msgid ""
243 "Now let's look at ui.py which defines the actual GUI plugin. The source code"
244 " is heavily commented and should be self explanatory:"
245 msgstr "Veamos ahora ui.py, que define la interfaz gráfica del complemento. El código fuente está explícitamente comentado y se explica por sí mismo:"
246
247 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:128
248 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:220
249 msgid "main.py"
250 msgstr ""
251
252 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:130
253 msgid "The actual logic to implement the Interface Plugin Demo dialog."
254 msgstr "El código que implementa el cuadro de diálogo «Interface Plugin Demo»."
255
256 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:136
257 msgid "Getting resources from the plugin ZIP file"
258 msgstr "Obtener recursos del archivo ZIP del complemento"
259
260 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:138
261 msgid ""
262 "calibre's plugin loading system defines a couple of built-in functions that "
263 "allow you to conveniently get files from the plugin ZIP file."
264 msgstr "El sistema de carga de complementos de calibre tiene predefinidas un par de funciones que permiten obtener archivos desde el archivo ZIP del complemento de manera práctica. "
265
266 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:140
267 msgid "**get_resources(name_or_list_of_names)**"
268 msgstr "**get_resources(nombre_o_lista_de_nombres)**"
269
270 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:141
271 msgid ""
272 "This function should be called with a list of paths to files inside the ZIP "
273 "file. For example to access the file :file:`icon.png` in the folder images "
274 "in the ZIP file, you would use: ``images/icon.png``. Always use a forward "
275 "slash as the path separator, even on Windows. When you pass in a single "
276 "name, the function will return the raw bytes of that file or None if the "
277 "name was not found in the ZIP file. If you pass in more than one name then "
278 "it returns a dictionary mapping the names to bytes. If a name is not found,"
279 " it will not be present in the returned dictionary."
280 msgstr ""
281
282 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:150
283 msgid "**get_icons(name_or_list_of_names, plugin_name='')**"
284 msgstr ""
285
286 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:151
287 msgid ""
288 "A wrapper for get_resources() that creates QIcon objects from the raw bytes "
289 "returned by get_resources. If a name is not found in the ZIP file the "
290 "corresponding QIcon will be null. In order to support icon theme-ing, pass "
291 "in the human friendly name of your plugin as ``plugin_name``. If the user is"
292 " using an icon theme with icons for your plugin, they will be loaded "
293 "preferentially."
294 msgstr ""
295
296 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:160
297 msgid "Enabling user configuration of your plugin"
298 msgstr "Habilitar la configuración de usuario para el complemento"
299
300 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:162
301 msgid ""
302 "To allow users to configure your plugin, you must define three methods in "
303 "your base plugin class, **is_customizable**, **config_widget** and "
304 "**save_settings** as shown below:"
305 msgstr "Para permitir a los usuarios configurar el complemento, debe definir tres métodos en la clase base del complemento, **is_customizable**, **config_widget** y **save_settings** como se muestra a continuación:"
306
307 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:173
308 msgid ""
309 "calibre has many different ways to store configuration data (a legacy of its"
310 " long history). The recommended way is to use the **JSONConfig** class, "
311 "which stores your configuration information in a .json file."
312 msgstr "calibre tiene muchas maneras diferentes de almacenar los datos de configuración (un legado de su larga historia). El método recomendado es usar la clase **JSONConfig**, que almacena la información de configuración en un archivo .json."
313
314 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:175
315 msgid ""
316 "The code to manage configuration data in the demo plugin is in config.py:"
317 msgstr "El código para gestionar los datos de configuración en el complemento de demostración está en config.py:"
318
319 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:180
320 msgid ""
321 "The ``prefs`` object is now available throughout the plugin code by a "
322 "simple::"
323 msgstr "El objeto ``prefs`` está ahora disponible en todo el código del complemento simplemente con::"
324
325 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:185
326 msgid "You can see the ``prefs`` object being used in main.py:"
327 msgstr "Puede observar que el objeto ``prefs`` se usa en main.py:"
328
329 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:192
330 msgid "Edit book plugins"
331 msgstr "Complementos para modificar libros"
332
333 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:194
334 msgid ""
335 "Now let's change gears for a bit and look at creating a plugin to add tools "
336 "to the calibre book editor. The plugin is available here: "
337 ":download_file:`editor_demo_plugin.zip`."
338 msgstr "Vamos a cambiar de tercio y enfocarnos en la creación de un complemento para añadir herramientas al editor de libros de calibre. El complemento está disponible aquí: :download_file:`editor_demo_plugin.zip`."
339
340 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:198
341 msgid ""
342 "The first step, as for all plugins is to create the import name empty txt "
343 "file, as described :ref:`above <import_name_txt>`. We shall name the file "
344 "``plugin-import-name-editor_plugin_demo.txt``."
345 msgstr "El primer paso, como para todos los complementos es crear el archivo vacío con el nombre de importación descrito :ref:`anteriormente <import_name_txt>`. Vamos a nombrar el archivo ``plugin-import-name-editor_plugin_demo.txt``."
346
347 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:202
348 msgid ""
349 "Now we create the mandatory ``__init__.py`` file that contains metadata "
350 "about the plugin -- its name, author, version, etc."
351 msgstr "Ahora creamos el archivo obligatorio ``__init__.py`` que contiene los metadatos del complemento: nombre, autor, versión, etc."
352
353 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:208
354 msgid ""
355 "A single editor plugin can provide multiple tools each tool corresponds to a"
356 " single button in the toolbar and entry in the :guilabel:`Plugins` menu in "
357 "the editor. These can have sub-menus in case the tool has multiple related "
358 "actions."
359 msgstr "Un solo complemento del editor puede proporcionar múltiples herramientas; cada herramienta corresponde a un único botón en la barra de herramientas y entrada en el menú :guilabel:`Complementos` del editor. Éstos pueden tener submenús en el caso de que la herramienta posea múltiples acciones relacionadas."
360
361 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:212
362 msgid ""
363 "The tools must all be defined in the file ``main.py`` in your plugin. Every "
364 "tool is a class that inherits from the "
365 ":class:`calibre.gui2.tweak_book.plugin.Tool` class. Let's look at "
366 "``main.py`` from the demo plugin, the source code is heavily commented and "
367 "should be self-explanatory. Read the API documents of the "
368 ":class:`calibre.gui2.tweak_book.plugin.Tool` class for more details."
369 msgstr "Todas las herramientas deben estar definidas en el archivo ``main.py`` del complemento. Cada herramienta es una clase que hereda de la clase :class:`calibre.gui2.tweak_book.plugin.Tool`. Echemos un vistazo al ``main.py`` del complemento de demostración; el código fuente está profusamente comentado y se explica por sí mismo. Lea la documentación de la API de la clase :clase:`calibre.gui2.tweak_book.plugin.Tool` para más detalles."
370
371 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:222
372 msgid ""
373 "Here we will see the definition of a single tool that will multiply all font"
374 " sizes in the book by a number provided by the user. This tool demonstrates "
375 "various important concepts that you will need in developing your own "
376 "plugins, so you should read the (heavily commented) source code carefully."
377 msgstr "Aquí veremos la definición de una herramienta que multiplicará todos los tamaños de letra en el libro por un número proporcionado por el usuario. Esta herramienta demuestra varios conceptos importantes que se necesitarán para desarrollar otros complementos, por lo que debe leer el código fuente (muy comentado) cuidadosamente."
378
379 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:230
380 msgid ""
381 "Let's break down ``main.py``. We see that it defines a single tool, named "
382 "*Magnify fonts*. This tool will ask the user for a number and multiply all "
383 "font sizes in the book by that number."
384 msgstr "Vamos a analizar ``main.py``. Vemos que define una única herramienta, llamada *Magnify fonts*. Esta herramienta le pediráá al usuario un número y multiplicará todos los tamaños de letra en el libro por dicho número."
385
386 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:234
387 msgid ""
388 "The first important thing is the tool name which you must set to some "
389 "relatively unique string as it will be used as the key for this tool."
390 msgstr "La primera cosa importante es el nombre de la herramienta que debe establecer a algún texto relativamente único, ya que se utilizará como clave para esta herramienta."
391
392 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:237
393 msgid ""
394 "The next important entry point is the "
395 ":meth:`calibre.gui2.tweak_book.plugin.Tool.create_action`. This method "
396 "creates the QAction objects that appear in the plugins toolbar and plugin "
397 "menu. It also, optionally, assigns a keyboard shortcut that the user can "
398 "customize. The triggered signal from the QAction is connected to the "
399 "ask_user() method that asks the user for the font size multiplier, and then "
400 "runs the magnification code."
401 msgstr "El siguiente punto de entrada importante es :meth:`calibre.gui2.tweak_book.plugin.Tool.create_action`. Este método crea los objetos QAction que aparecen en la barra de herramientas y en el menú de complementos. También, opcionalmente, asigna un atajo de teclado que el usuario puede personalizar. La señal que se genera en el objeto QAction está conectada con el método ask_user() que pide al usuario el multiplicador del tamaño de letra, y luego ejecuta el código de ampliación."
402
403 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:245
404 msgid ""
405 "The magnification code is well commented and fairly simple. The main things "
406 "to note are that you get a reference to the editor window as ``self.gui`` "
407 "and the editor *Boss* as ``self.boss``. The *Boss* is the object that "
408 "controls the editor user interface. It has many useful methods, that are "
409 "documented in the :class:`calibre.gui2.tweak_book.boss.Boss` class."
410 msgstr "El código de aumento está bien comentado y es bastante simple. Lo principal que hay que destacar es que se obtiene una referencia a la ventana del editor como ``self.gui`` y al *Boss* del editor como ``self.boss``. El *Boss* es el objeto que controla la interfaz de usuario del editor. Tiene muchos métodos útiles, que se documentan en la clase :class:`calibre.gui2.tweak_book.boss.Boss`."
411
412 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:251
413 msgid ""
414 "Finally, there is ``self.current_container`` which is a reference to the "
415 "book being edited as a "
416 ":class:`calibre.ebooks.oeb.polish.container.Container` object. This "
417 "represents the book as a collection of its constituent HTML/CSS/image files "
418 "and has convenience methods for doing many useful things. The container "
419 "object and various useful utility functions that can be reused in your "
420 "plugin code are documented in :ref:`polish_api`."
421 msgstr "Finalmente está ``self.current_container``, que es una referencia al libro que se está editando como un objeto :class:`calibre.ebooks.oeb.polish.container.Container`. Éste representa el libro como una colección de archivos HTML, CSS e imágenes y posee diversos métodos prácticos para hacer varias cosas útiles. El objeto contenedor y varias funciones utilitarias que se pueden reutilizar en el código de los complementos están documentados en :ref:`polish_api`. "
422
423 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:259
424 msgid "Adding translations to your plugin"
425 msgstr "Añadir traducciones al complemento"
426
427 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:261
428 msgid ""
429 "You can have all the user interface strings in your plugin translated and "
430 "displayed in whatever language is set for the main calibre user interface."
431 msgstr "Puede traducir todos los textos de la interfaz de usuario del complemento y mostrarlos en el idioma en que está configurada la interfaz principal de calibre."
432
433 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:264
434 msgid ""
435 "The first step is to go through your plugin's source code and mark all user "
436 "visible strings as translatable, by surrounding them in _(). For example::"
437 msgstr "El primer paso es ir al código fuente del complemento y marcar todos los textos visibles por el usuario como traducibles, encerrándolos con _(). Por ejemplo::"
438
439 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:269
440 msgid ""
441 "Then use some program to generate .po files from your plugin source code. "
442 "There should be one .po file for every language you want to translate into. "
443 "For example: de.po for German, fr.po for French and so on. You can use the "
444 "`Poedit <https://poedit.net/>`_ program for this."
445 msgstr "Después utilice algún programa para generar archivos .po para el código fuente del complemento. Debe haber un archivo .po para cada idioma al que lo quiera traducir. Por ejemplo: de.po para el alemán, fr.po para el francés, etc. Puede utilizar el programa `Poedit <https://poedit.net/>`_ para esto."
446
447 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:274
448 msgid ""
449 "Send these .po files to your translators. Once you get them back, compile "
450 "them into .mo files. You can again use Poedit for that, or just do::"
451 msgstr "Envíe estos archivos .po a los traductores. Cuando reciba los archivos traducidos, compílelos en archivos .mo. Puede utilizar nuevamente Poedit para ello, o simplemente ejecutar::"
452
453 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:279
454 msgid "Put the .mo files into the ``translations`` folder in your plugin."
455 msgstr "Ponga los archivos .mo en la carpeta ``translations`` del complemento."
456
457 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:281
458 msgid ""
459 "The last step is to simply call the function `load_translations()` at the "
460 "top of your plugin's .py files. For performance reasons you should only call"
461 " this function in those .py files that actually have translatable strings. "
462 "So in a typical User Interface plugin you would call it at the top of "
463 "``ui.py`` but not ``__init__.py``."
464 msgstr "El último paso es simplemente ejecutar la función `load_translations()` al principio de los archivos .py del complemento. Por motivos de rendimiento, sólo debe llamar a esta función en aquellos archivos .py que realmente poseen textos traducibles. Así que en un complemento de interfaz de usuario típico, la ejecutaría en ``ui.py`` pero no en ``__init__.py``."
465
466 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:287
467 msgid ""
468 "You can test the translations of your plugins by changing the user interface"
469 " language in calibre under :guilabel:`Preferences->Interface->Look & feel` "
470 "or by running calibre with the ``CALIBRE_OVERRIDE_LANG`` environment "
471 "variable set. For example::"
472 msgstr ""
473
474 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:293
475 msgid ""
476 "Replace ``de`` with the language code of the language you want to test."
477 msgstr "Sustituya ``de`` por el código del idioma que desea probar."
478
479 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:295
480 msgid ""
481 "For translations with plurals, use the ``ngettext()`` function instead of "
482 "``_()``. For example::"
483 msgstr ""
484
485 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:301
486 msgid "The plugin API"
487 msgstr ""
488
489 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:303
490 msgid ""
491 "As you may have noticed above, a plugin in calibre is a class. There are "
492 "different classes for the different types of plugins in calibre. Details on "
493 "each class, including the base class of all plugins can be found in "
494 ":ref:`plugins`."
495 msgstr "Como ya se habrá dado cuenta, un complemento en calibre es una clase. Hay diferentes clases para los diferentes tipos de complementos en calibre. Los detalles de cada clase, incluyendo la clase base de todos los complementos, se pueden encontrar en :ref:`plugins`."
496
497 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:306
498 msgid ""
499 "Your plugin is almost certainly going to use code from calibre. To learn how"
500 " to find various bits of functionality in the calibre code base, read the "
501 "section on the calibre :ref:`code_layout`."
502 msgstr "Es casi seguro que el complemento va a usar el código de calibre. Para saber cómo encontrar los distintos elementos de funcionalidad en el código base de calibre, lea la sección :ref:`code_layout`."
503
504 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:311
505 msgid "Debugging plugins"
506 msgstr "Depurar complementos"
507
508 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:313
509 msgid ""
510 "The first, most important step is to run calibre in debug mode. You can do "
511 "this from the command line with::"
512 msgstr "El primer paso, el más importante, es ejecutar calibre en modo de depuración. Puede hacer esto desde la línea de órdenes con::"
513
514 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:317
515 msgid ""
516 "Or from within calibre by right-clicking the :guilabel:`Preferences` button "
517 "or using the :kbd:`Ctrl+Shift+R` keyboard shortcut."
518 msgstr "O desde el mismo calibre, pulsando con el botón derecho en :guilabel:`Preferencias` o usando el atajo de teclado :kbd:`Ctrl+Mayús+R`."
519
520 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:319
521 msgid ""
522 "When running from the command line, debug output will be printed to the "
523 "console, when running from within calibre the output will go to a txt file."
524 msgstr "Cuando se ejecuta desde la línea de órdenes, la salida de depuración se enviará a la consola, si se ejecuta dentro de calibre, la salida irá a un archivo txt."
525
526 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:321
527 msgid ""
528 "You can insert print statements anywhere in your plugin code, they will be "
529 "output in debug mode. Remember, this is Python, you really shouldn't need "
530 "anything more than print statements to debug ;) I developed all of calibre "
531 "using just this debugging technique."
532 msgstr "Puede insertar sentencias de impresión en cualquier lugar en el código fuente del complemento, tendrán efecto en el modo de depuración. Recuerde, esto es Python, no debe necesitar más que sentencias de impresión para depurar ;) He desarrollado todo calibre usando sólo esta técnica de depuración."
533
534 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:323
535 msgid ""
536 "You can quickly test changes to your plugin by using the following command "
537 "line::"
538 msgstr "Puede probar rápidamente los cambios en el complemento con la siguiente orden::"
539
540 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:328
541 msgid ""
542 "This will shutdown a running calibre, wait for the shutdown to complete, "
543 "then update your plugin in calibre and relaunch calibre."
544 msgstr "Esto cerrará calibre, esperará hasta que se cierre completamente, después actualiza el complemento en calibre y vuelve a iniciar calibre."
545
546 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:331
547 msgid "More plugin examples"
548 msgstr ""
549
550 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:333
551 msgid ""
552 "You can find a list of many sophisticated calibre plugins `here "
553 "<https://www.mobileread.com/forums/showthread.php?t=118764>`_."
554 msgstr "Puede encontrar una lista de muchos complementos de calibre más complejos `aqui <https://www.mobileread.com/forums/showthread.php?t=118764>`_."
555
556 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:336
557 msgid "Sharing your plugins with others"
558 msgstr "Compartir sus complementos con otros"
559
560 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:338
561 msgid ""
562 "If you would like to share the plugins you have created with other users of "
563 "calibre, post your plugin in a new thread in the `calibre plugins forum "
564 "<https://www.mobileread.com/forums/forumdisplay.php?f=237>`_."
565 msgstr "Si desea compartir los complementos que ha creado con otros usuarios de calibre, inicie un nuevo hilo adjuntando el complemento en el `foros de complementos de calibre <https://www.mobileread.com/forums/forumdisplay.php?f=237>`_ (en inglés)."