Debian Codegraph @

translations/manual/pt_BR/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 # Artur de Carvalho Alves <[email protected]>, 2015
7 # Claudio Rogerio Carvalho Filho <[email protected]>, 2020
8 # JOÃO PEDRO SLONGO, 2020
9 # Paulo_Neto <[email protected]>, 2014
10 # Marcello Oliveira <[email protected]>, 2024
11 # Maria Luz, 2024
12 # Patricia de Albuquerque Garcia Redondo <[email protected]>, 2015
13 # Victor M. Palma, 2024
14 msgid ""
15 msgstr ""
16 "Project-Id-Version: calibre\n"
17 "Report-Msgid-Bugs-To: \n"
18 "POT-Creation-Date: 2026-02-17 16:44+0000\n"
19 "PO-Revision-Date: 2014-06-17 08:35+0000\n"
20 "Last-Translator: Maria Luz, 2024\n"
21 "Language-Team: Portuguese (Brazil) (http://app.transifex.com/calibre/calibre/language/pt_BR/)\n"
22 "MIME-Version: 1.0\n"
23 "Content-Type: text/plain; charset=UTF-8\n"
24 "Content-Transfer-Encoding: 8bit\n"
25 "Language: pt_BR\n"
26 "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n"
27
28 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:4
29 msgid "Writing your own plugins to extend calibre's functionality"
30 msgstr "Crie seus próprios plugins para aumentar as funcionalidades do Calibre"
31
32 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:6
33 msgid ""
34 "calibre has a very modular design. Almost all functionality in calibre comes"
35 " in the form of plugins. Plugins are used for conversion, for downloading "
36 "news (though these are called recipes), for various components of the user "
37 "interface, to connect to different devices, to process files when adding "
38 "them to calibre and so on. You can get a complete list of all the built-in "
39 "plugins in calibre by going to :guilabel:`Preferences->Advanced->Plugins`."
40 msgstr "O calibre possui um design muito modular. Quase todas as funcionalidades do calibre vêm na forma de plugins. Os plug-ins são usados para conversão, para baixar notícias (embora sejam chamadas de receitas), para vários componentes da interface do usuário, para conectar-se a dispositivos diferentes, para processar arquivos ao adicioná-los ao calibre e assim por diante. Você pode obter uma lista completa de todos os plugins integrados no calibre, visitando: guilabel: `Preferências-> Avançado-> Plugins`."
41
42 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:8
43 msgid ""
44 "Here, we will teach you how to create your own plugins to add new features "
45 "to calibre."
46 msgstr "Aqui vamos mostrar a você como criar seus próprios plugins e adicionar novos atributos para o calibre"
47
48 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:13
49 msgid "Contents"
50 msgstr "Conteúdo"
51
52 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:15
53 msgid "This only applies to calibre releases >= 0.8.60"
54 msgstr "Somente se aplica as versões do calibre >= 0.8.60"
55
56 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:18
57 msgid "Anatomy of a calibre plugin"
58 msgstr "Anatomia de um plugin do calibre"
59
60 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:20
61 msgid ""
62 "A calibre plugin is very simple, it's just a ZIP file that contains some "
63 "Python code and any other resources like image files needed by the plugin. "
64 "Without further ado, let's see a basic example."
65 msgstr "Um plugin de calibre é muito simples, é apenas um arquivo ZIP que contém algum código Python e outros recursos, como arquivos de imagem necessários ao plugin. Sem mais delongas, vamos ver um exemplo básico."
66
67 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:24
68 msgid ""
69 "Suppose you have an installation of calibre that you are using to self "
70 "publish various e-documents in EPUB and MOBI formats. You would like all "
71 "files generated by calibre to have their publisher set as \"Hello world\", "
72 "here's how to do it. Create a file named :file:`__init__.py` (this is a "
73 "special name and must always be used for the main file of your plugin) and "
74 "enter the following Python code into it:"
75 msgstr "Suponha que você tenha uma instalação de calibre que esteja usando para publicar automaticamente vários documentos eletrônicos nos formatos EPUB e MOBI. Você deseja que todos os arquivos gerados pelo calibre tenham o editor definido como \"Olá, mundo\", veja como fazê-lo. Crie um arquivo chamado: file: `__init __. Py` (este é um nome especial e sempre deve ser usado para o arquivo principal do seu plugin) e insira o seguinte código Python nele:"
76
77 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:32
78 msgid ""
79 "That's all. To add this code to calibre as a plugin, simply run the "
80 "following in the folder in which you created :file:`__init__.py`::"
81 msgstr "Isso é tudo. Para adicionar este código ao Calibre como um plugin, apenas execute o seguinte na pasta na qual foi criado :file:`__init__.py`::"
82
83 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:38
84 msgid ""
85 "On macOS, the command line tools are inside the calibre bundle, for example,"
86 " if you installed calibre in :file:`/Applications` the command line tools "
87 "are in :file:`/Applications/calibre.app/Contents/MacOS/`."
88 msgstr "No macOS, as ferramentas de linha de comando estão dentro do pacote do calibre. Por exemplo, se você instalou o calibre em :file:`/Applications` , as ferramentas de linha de comando estão em :file:`/Applications/calibre.app/Contents/MacOS/`."
89
90 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:42
91 msgid ""
92 "You can download the Hello World plugin from "
93 ":download_file:`helloworld_plugin.zip`."
94 msgstr "Baixe o plugin Hello World em :download_file:`helloworld_plugin.zip`."
95
96 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:45
97 msgid ""
98 "Every time you use calibre to convert a book, the plugin's :meth:`run` "
99 "method will be called and the converted book will have its publisher set to "
100 "\"Hello World\". This is a trivial plugin, let's move on to a more complex "
101 "example that actually adds a component to the user interface."
102 msgstr ""
103
104 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:50
105 msgid "A User Interface plugin"
106 msgstr "Um plugin de Interface de Usuário"
107
108 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:52
109 msgid ""
110 "This plugin will be spread over a few files (to keep the code clean). It "
111 "will show you how to get resources (images or data files) from the plugin "
112 "ZIP file, allow users to configure your plugin, how to create elements in "
113 "the calibre user interface and how to access and query the books database in"
114 " calibre."
115 msgstr "Este plugin será espalhado por alguns arquivos (para manter o código limpo). Ele mostrará como obter recursos (imagens ou arquivos de dados) do arquivo ZIP do plug-in, permitir que os usuários configurem seu plug-in, como criar elementos na interface do usuário do calibre e como acessar e consultar o banco de dados de livros no calibre."
116
117 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:57
118 msgid ""
119 "You can download this plugin from :download_file:`interface_demo_plugin.zip`"
120 msgstr ""
121
122 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:61
123 msgid ""
124 "The first thing to note is that this ZIP file has a lot more files in it, "
125 "explained below, pay particular attention to ``plugin-import-name-"
126 "interface_demo.txt``."
127 msgstr "A primeira coisa a observar é que esse arquivo ZIP contém muito mais arquivos, explicados abaixo, e preste atenção ``plugin-import-name-interface_demo.txt``."
128
129 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:64
130 msgid "**plugin-import-name-interface_demo.txt**"
131 msgstr "plugin-import-name-interface_demo.tx"
132
133 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:65
134 msgid ""
135 "An empty text file used to enable the multi-file plugin magic. This file "
136 "must be present in all plugins that use more than one .py file. It should be"
137 " empty and its filename must be of the form: ``plugin-import-"
138 "name-**some_name**.txt``. The presence of this file allows you to import "
139 "code from the .py files present inside the ZIP file, using a statement "
140 "like::"
141 msgstr "Um arquivo de texto vazio usado para ativar a mágica do plug-in com vários arquivos. Este arquivo deve estar presente em todos os plugins que usam mais de um arquivo .py. Ele deve estar vazio e seu nome de arquivo deve estar no formato: plugin-import-name-**some_name**.txt``. A presença desse arquivo permite importar código dos arquivos .py presentes dentro do arquivo ZIP, usando uma instrução como:"
142
143 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:71
144 msgid ""
145 "The prefix ``calibre_plugins`` must always be present. ``some_name`` comes "
146 "from the filename of the empty text file. ``some_module`` refers to "
147 ":file:`some_module.py` file inside the ZIP file. Note that this importing is"
148 " just as powerful as regular Python imports. You can create packages and "
149 "subpackages of .py modules inside the ZIP file, just like you would normally"
150 " (by defining __init__.py in each sub-folder), and everything should \"just "
151 "work\"."
152 msgstr ""
153
154 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:76
155 msgid ""
156 "The name you use for ``some_name`` enters a global namespace shared by all "
157 "plugins, **so make it as unique as possible**. But remember that it must be "
158 "a valid Python identifier (only alphabets, numbers and the underscore)."
159 msgstr "O nome que você usa para `` some_name`` entra em um namespace global compartilhado por todos os plugins, ** para torná-lo o mais exclusivo possível **. Mas lembre-se de que deve ser um identificador Python válido (apenas alfabetos, números e sublinhado)"
160
161 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:79
162 msgid "**__init__.py**"
163 msgstr "__init__.py"
164
165 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:80
166 msgid "As before, the file that defines the plugin class"
167 msgstr "Como antes, o arquivo que define a classe de plug-in"
168
169 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:82
170 msgid "**main.py**"
171 msgstr "**main.py**"
172
173 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:83
174 msgid "This file contains the actual code that does something useful"
175 msgstr "Este arquivo contém o código real que faz algo útil"
176
177 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:85
178 msgid "**ui.py**"
179 msgstr "**ui.py**"
180
181 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:86
182 msgid "This file defines the interface part of the plugin"
183 msgstr "Esse arquivo define a parte de interface do plugin"
184
185 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:88
186 msgid "**images/icon.png**"
187 msgstr "**images/icon.png**"
188
189 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:89
190 msgid "The icon for this plugin"
191 msgstr "O ícone deste plugin"
192
193 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:91
194 msgid "**about.txt**"
195 msgstr "**about.txt**"
196
197 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:92
198 msgid "A text file with information about the plugin"
199 msgstr "Um arquivo de texto com informações sobre o plugin"
200
201 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:94
202 msgid "**translations**"
203 msgstr "**translations**"
204
205 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:95
206 msgid ""
207 "A folder containing .mo files with the translations of the user interface of"
208 " your plugin into different languages. See below for details."
209 msgstr "Uma pasta contendo arquivos ``.mo`` com as traduções da interface do usuário do seu plugin para diferentes idiomas. Veja abaixo os detalhes."
210
211 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:99
212 msgid "Now let's look at the code."
213 msgstr "Agora vamos ver o código"
214
215 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:102
216 msgid "__init__.py"
217 msgstr "__init__.py"
218
219 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:104
220 msgid "First, the obligatory ``__init__.py`` to define the plugin metadata:"
221 msgstr "Primeiro, o obrigatório ``__init__.py`` para definir os metadados do plugin:"
222
223 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:109
224 msgid ""
225 "The only noteworthy feature is the field :attr:`actual_plugin`. Since "
226 "calibre has both command line and GUI interfaces, GUI plugins like this one "
227 "should not load any GUI libraries in __init__.py. The actual_plugin field "
228 "does this for you, by telling calibre that the actual plugin is to be found "
229 "in another file inside your ZIP archive, which will only be loaded in a GUI "
230 "context."
231 msgstr "O único recurso digno de nota é o campo :attr:`actual_plugin`. Como o *Calibre* tem linha de comando e interfaces *GUI*, plug-ins *GUI* como este não devem carregar nenhuma biblioteca *GUI* em ``__init__.py``. O campo ``actual_plugin`` faz isso para você, informando ao *Calibre* que o plugin real deve ser encontrado em outro arquivo dentro do seu arquivo ZIP, que só será carregado em um contexto GUI."
232
233 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:114
234 msgid ""
235 "Remember that for this to work, you must have a plugin-import-name-"
236 "some_name.txt file in your plugin ZIP file, as discussed above."
237 msgstr "Lembre-se de que, para que isso funcione, você deve ter um arquivo ``plugin-import-name-some_name.txt`` no arquivo ZIP do plugin, conforme discutido acima."
238
239 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:117
240 msgid ""
241 "Also there are a couple of methods for enabling user configuration of the "
242 "plugin. These are discussed below."
243 msgstr "Também existem alguns métodos para habilitar a configuração do plugin pelo usuário. Eles são discutidos abaixo."
244
245 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:120
246 msgid "ui.py"
247 msgstr "ui.py"
248
249 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:122
250 msgid ""
251 "Now let's look at ui.py which defines the actual GUI plugin. The source code"
252 " is heavily commented and should be self explanatory:"
253 msgstr "Agora vamos dar uma olhada em ``ui.py`` que define o plugin GUI real. O código-fonte é muito comentado e deve ser autoexplicativo:"
254
255 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:128
256 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:220
257 msgid "main.py"
258 msgstr "main.py"
259
260 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:130
261 msgid "The actual logic to implement the Interface Plugin Demo dialog."
262 msgstr "A lógica real para implementar a caixa de diálogo das *Interface Plugin Demo*."
263
264 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:136
265 msgid "Getting resources from the plugin ZIP file"
266 msgstr "Obtendo recursos do arquivo *ZIP* do plugin"
267
268 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:138
269 msgid ""
270 "calibre's plugin loading system defines a couple of built-in functions that "
271 "allow you to conveniently get files from the plugin ZIP file."
272 msgstr "o sistema de carregamento do plugin do calibre define algumas funções built-in que permitem obter convenientemente os arquivos do arquivo ZIP do plugin."
273
274 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:140
275 msgid "**get_resources(name_or_list_of_names)**"
276 msgstr "**get_resources(name_or_list_of_names)**"
277
278 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:141
279 msgid ""
280 "This function should be called with a list of paths to files inside the ZIP "
281 "file. For example to access the file :file:`icon.png` in the folder images "
282 "in the ZIP file, you would use: ``images/icon.png``. Always use a forward "
283 "slash as the path separator, even on Windows. When you pass in a single "
284 "name, the function will return the raw bytes of that file or None if the "
285 "name was not found in the ZIP file. If you pass in more than one name then "
286 "it returns a dictionary mapping the names to bytes. If a name is not found,"
287 " it will not be present in the returned dictionary."
288 msgstr ""
289
290 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:150
291 msgid "**get_icons(name_or_list_of_names, plugin_name='')**"
292 msgstr ""
293
294 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:151
295 msgid ""
296 "A wrapper for get_resources() that creates QIcon objects from the raw bytes "
297 "returned by get_resources. If a name is not found in the ZIP file the "
298 "corresponding QIcon will be null. In order to support icon theme-ing, pass "
299 "in the human friendly name of your plugin as ``plugin_name``. If the user is"
300 " using an icon theme with icons for your plugin, they will be loaded "
301 "preferentially."
302 msgstr ""
303
304 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:160
305 msgid "Enabling user configuration of your plugin"
306 msgstr "Habilitando configuração de usuário do seu plugin"
307
308 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:162
309 msgid ""
310 "To allow users to configure your plugin, you must define three methods in "
311 "your base plugin class, **is_customizable**, **config_widget** and "
312 "**save_settings** as shown below:"
313 msgstr "Para permitir que os usuários configurem seu plug-in, você deve definir três métodos em sua classe base de plug-in, **is_customizable()**, **config_widget()** e **save_settings()** conforme mostrado abaixo:"
314
315 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:173
316 msgid ""
317 "calibre has many different ways to store configuration data (a legacy of its"
318 " long history). The recommended way is to use the **JSONConfig** class, "
319 "which stores your configuration information in a .json file."
320 msgstr "calibre tem muitas maneiras diferentes de armazenar dados de configuração (um legado de sua longa história). A maneira recomendada é usar a classe **JSONConfig**, que armazena suas informações de configuração em um arquivo ``.json``."
321
322 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:175
323 msgid ""
324 "The code to manage configuration data in the demo plugin is in config.py:"
325 msgstr "O código para gerenciar os dados de configuração no plug-in demo está em ``config.py``:"
326
327 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:180
328 msgid ""
329 "The ``prefs`` object is now available throughout the plugin code by a "
330 "simple::"
331 msgstr "O objeto ``prefs`` agora está disponível em todo o código do plugin por um simples::"
332
333 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:185
334 msgid "You can see the ``prefs`` object being used in main.py:"
335 msgstr "É possível ver o objeto ``prefs`` sendo usado em ``main.py``:"
336
337 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:192
338 msgid "Edit book plugins"
339 msgstr "Editar plug-ins de livros"
340
341 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:194
342 msgid ""
343 "Now let's change gears for a bit and look at creating a plugin to add tools "
344 "to the calibre book editor. The plugin is available here: "
345 ":download_file:`editor_demo_plugin.zip`."
346 msgstr ""
347
348 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:198
349 msgid ""
350 "The first step, as for all plugins is to create the import name empty txt "
351 "file, as described :ref:`above <import_name_txt>`. We shall name the file "
352 "``plugin-import-name-editor_plugin_demo.txt``."
353 msgstr ""
354
355 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:202
356 msgid ""
357 "Now we create the mandatory ``__init__.py`` file that contains metadata "
358 "about the plugin -- its name, author, version, etc."
359 msgstr ""
360
361 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:208
362 msgid ""
363 "A single editor plugin can provide multiple tools each tool corresponds to a"
364 " single button in the toolbar and entry in the :guilabel:`Plugins` menu in "
365 "the editor. These can have sub-menus in case the tool has multiple related "
366 "actions."
367 msgstr ""
368
369 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:212
370 msgid ""
371 "The tools must all be defined in the file ``main.py`` in your plugin. Every "
372 "tool is a class that inherits from the "
373 ":class:`calibre.gui2.tweak_book.plugin.Tool` class. Let's look at "
374 "``main.py`` from the demo plugin, the source code is heavily commented and "
375 "should be self-explanatory. Read the API documents of the "
376 ":class:`calibre.gui2.tweak_book.plugin.Tool` class for more details."
377 msgstr ""
378
379 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:222
380 msgid ""
381 "Here we will see the definition of a single tool that will multiply all font"
382 " sizes in the book by a number provided by the user. This tool demonstrates "
383 "various important concepts that you will need in developing your own "
384 "plugins, so you should read the (heavily commented) source code carefully."
385 msgstr ""
386
387 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:230
388 msgid ""
389 "Let's break down ``main.py``. We see that it defines a single tool, named "
390 "*Magnify fonts*. This tool will ask the user for a number and multiply all "
391 "font sizes in the book by that number."
392 msgstr ""
393
394 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:234
395 msgid ""
396 "The first important thing is the tool name which you must set to some "
397 "relatively unique string as it will be used as the key for this tool."
398 msgstr ""
399
400 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:237
401 msgid ""
402 "The next important entry point is the "
403 ":meth:`calibre.gui2.tweak_book.plugin.Tool.create_action`. This method "
404 "creates the QAction objects that appear in the plugins toolbar and plugin "
405 "menu. It also, optionally, assigns a keyboard shortcut that the user can "
406 "customize. The triggered signal from the QAction is connected to the "
407 "ask_user() method that asks the user for the font size multiplier, and then "
408 "runs the magnification code."
409 msgstr ""
410
411 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:245
412 msgid ""
413 "The magnification code is well commented and fairly simple. The main things "
414 "to note are that you get a reference to the editor window as ``self.gui`` "
415 "and the editor *Boss* as ``self.boss``. The *Boss* is the object that "
416 "controls the editor user interface. It has many useful methods, that are "
417 "documented in the :class:`calibre.gui2.tweak_book.boss.Boss` class."
418 msgstr ""
419
420 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:251
421 msgid ""
422 "Finally, there is ``self.current_container`` which is a reference to the "
423 "book being edited as a "
424 ":class:`calibre.ebooks.oeb.polish.container.Container` object. This "
425 "represents the book as a collection of its constituent HTML/CSS/image files "
426 "and has convenience methods for doing many useful things. The container "
427 "object and various useful utility functions that can be reused in your "
428 "plugin code are documented in :ref:`polish_api`."
429 msgstr ""
430
431 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:259
432 msgid "Adding translations to your plugin"
433 msgstr "Adicionando traduções para o seu plugin"
434
435 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:261
436 msgid ""
437 "You can have all the user interface strings in your plugin translated and "
438 "displayed in whatever language is set for the main calibre user interface."
439 msgstr ""
440
441 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:264
442 msgid ""
443 "The first step is to go through your plugin's source code and mark all user "
444 "visible strings as translatable, by surrounding them in _(). For example::"
445 msgstr ""
446
447 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:269
448 msgid ""
449 "Then use some program to generate .po files from your plugin source code. "
450 "There should be one .po file for every language you want to translate into. "
451 "For example: de.po for German, fr.po for French and so on. You can use the "
452 "`Poedit <https://poedit.net/>`_ program for this."
453 msgstr ""
454
455 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:274
456 msgid ""
457 "Send these .po files to your translators. Once you get them back, compile "
458 "them into .mo files. You can again use Poedit for that, or just do::"
459 msgstr ""
460
461 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:279
462 msgid "Put the .mo files into the ``translations`` folder in your plugin."
463 msgstr ""
464
465 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:281
466 msgid ""
467 "The last step is to simply call the function `load_translations()` at the "
468 "top of your plugin's .py files. For performance reasons you should only call"
469 " this function in those .py files that actually have translatable strings. "
470 "So in a typical User Interface plugin you would call it at the top of "
471 "``ui.py`` but not ``__init__.py``."
472 msgstr ""
473
474 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:287
475 msgid ""
476 "You can test the translations of your plugins by changing the user interface"
477 " language in calibre under :guilabel:`Preferences->Interface->Look & feel` "
478 "or by running calibre with the ``CALIBRE_OVERRIDE_LANG`` environment "
479 "variable set. For example::"
480 msgstr ""
481
482 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:293
483 msgid ""
484 "Replace ``de`` with the language code of the language you want to test."
485 msgstr ""
486
487 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:295
488 msgid ""
489 "For translations with plurals, use the ``ngettext()`` function instead of "
490 "``_()``. For example::"
491 msgstr ""
492
493 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:301
494 msgid "The plugin API"
495 msgstr "A API do plugin"
496
497 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:303
498 msgid ""
499 "As you may have noticed above, a plugin in calibre is a class. There are "
500 "different classes for the different types of plugins in calibre. Details on "
501 "each class, including the base class of all plugins can be found in "
502 ":ref:`plugins`."
503 msgstr ""
504
505 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:306
506 msgid ""
507 "Your plugin is almost certainly going to use code from calibre. To learn how"
508 " to find various bits of functionality in the calibre code base, read the "
509 "section on the calibre :ref:`code_layout`."
510 msgstr ""
511
512 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:311
513 msgid "Debugging plugins"
514 msgstr "Depurando plugins"
515
516 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:313
517 msgid ""
518 "The first, most important step is to run calibre in debug mode. You can do "
519 "this from the command line with::"
520 msgstr "A primeira e mais importante etapa é executar o calibre no modo de depuração. Você pode fazer isso na linha de comando com::"
521
522 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:317
523 msgid ""
524 "Or from within calibre by right-clicking the :guilabel:`Preferences` button "
525 "or using the :kbd:`Ctrl+Shift+R` keyboard shortcut."
526 msgstr ""
527
528 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:319
529 msgid ""
530 "When running from the command line, debug output will be printed to the "
531 "console, when running from within calibre the output will go to a txt file."
532 msgstr "Ao executar a partir da linha de comando, a saída de depuração será impressa no console; ao executar a partir do *Calibre*, a saída irá para um arquivo ``.txt``."
533
534 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:321
535 msgid ""
536 "You can insert print statements anywhere in your plugin code, they will be "
537 "output in debug mode. Remember, this is Python, you really shouldn't need "
538 "anything more than print statements to debug ;) I developed all of calibre "
539 "using just this debugging technique."
540 msgstr "É possível inserir declarações ``print()`` em qualquer lugar do código do plugin, elas serão geradas no modo de depuração. Lembre-se, isso é *Python*, você realmente não precisa de nada além de declarações ``print()`` para depurar ;) Desenvolvi todo o *Calibre* usando apenas esta técnica de depuração."
541
542 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:323
543 msgid ""
544 "You can quickly test changes to your plugin by using the following command "
545 "line::"
546 msgstr "Você pode testar rapidamente as alterações em seu plug-in usando a seguinte linha de comando::"
547
548 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:328
549 msgid ""
550 "This will shutdown a running calibre, wait for the shutdown to complete, "
551 "then update your plugin in calibre and relaunch calibre."
552 msgstr "Isso desligará o calibre em execução, esperará até que o desligamento seja concluído e, em seguida, atualizará o calibre do plug-in e o reiniciará."
553
554 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:331
555 msgid "More plugin examples"
556 msgstr "Mais exemplos de plugins"
557
558 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:333
559 msgid ""
560 "You can find a list of many sophisticated calibre plugins `here "
561 "<https://www.mobileread.com/forums/showthread.php?t=118764>`_."
562 msgstr ""
563
564 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:336
565 msgid "Sharing your plugins with others"
566 msgstr "Compartilhando seus plugins com os outros"
567
568 #: ../../../__w/calibre/calibre/manual/creating_plugins.rst:338
569 msgid ""
570 "If you would like to share the plugins you have created with other users of "
571 "calibre, post your plugin in a new thread in the `calibre plugins forum "
572 "<https://www.mobileread.com/forums/forumdisplay.php?f=237>`_."
573 msgstr "Se você gostaria de compartilhar os plug-ins que criou com outros usuários do calibre, poste seu plug-in em um novo tópico no `fórum de plug-ins do calibre <https://www.mobileread.com/forums/forumdisplay.php?f=237>`_."