Debian Codegraph @

translations/manual/ja/develop.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 # akihiko tanae (tanaeakihiko), 2025-2026
7 # Asakura, 2019
8 # dcato <[email protected]>, 2019
9 # EbXpJ6bp <[email protected]>, 2019
10 # Kovid Goyal <[email protected]>, 2022
11 # toshi oota <[email protected]>, 2021
12 # Yuka Kachi, 2022
13 msgid ""
14 msgstr ""
15 "Project-Id-Version: calibre\n"
16 "Report-Msgid-Bugs-To: \n"
17 "POT-Creation-Date: 2026-07-30 18:07+0000\n"
18 "PO-Revision-Date: 2014-06-17 08:34+0000\n"
19 "Last-Translator: akihiko tanae (tanaeakihiko), 2025-2026\n"
20 "Language-Team: Japanese (http://app.transifex.com/calibre/calibre/language/ja/)\n"
21 "MIME-Version: 1.0\n"
22 "Content-Type: text/plain; charset=UTF-8\n"
23 "Content-Transfer-Encoding: 8bit\n"
24 "Language: ja\n"
25 "Plural-Forms: nplurals=1; plural=0;\n"
26
27 #: ../../../__w/calibre/calibre/manual/develop.rst:4
28 msgid "Setting up a calibre development environment"
29 msgstr "calibre 開発環境の構築"
30
31 #: ../../../__w/calibre/calibre/manual/develop.rst:6
32 msgid ""
33 "calibre is completely open source, licensed under the `GNU GPL v3 "
34 "<https://www.gnu.org/licenses/gpl.html>`_. This means that you are free to "
35 "download and modify the program to your heart's content. In this section, "
36 "you will learn how to get a calibre development environment set up on the "
37 "operating system of your choice. calibre is written primarily in `Python "
38 "<https://www.python.org>`_ with some C/C++ code for speed and system "
39 "interfacing. Note that calibre requires at least Python 3.8."
40 msgstr "calibre は完全にオープンソースであり、 `GNU GPL v3 <https://www.gnu.org/licenses/gpl.html>`_ のもとにライセンスされています。これは自由にプログラムをダウンロードして、思う存分変更できることを意味します。この章では、選んだ OS 上で calibre の開発環境を構築するにはどうすればよいかを学べます。calibre は主に `Python <https://www.python.org>`_で書かれており、一部は速度とシステムインタフェースのために C/C++ のコードで書かれています。calibre には Python 3.8 以上が必要です。"
41
42 #: ../../../__w/calibre/calibre/manual/develop.rst:14
43 msgid "Contents"
44 msgstr "目次"
45
46 #: ../../../__w/calibre/calibre/manual/develop.rst:17
47 msgid "Design philosophy"
48 msgstr "設計の哲学"
49
50 #: ../../../__w/calibre/calibre/manual/develop.rst:19
51 msgid ""
52 "calibre has its roots in the Unix world, which means that its design is "
53 "highly modular. The modules interact with each other via well defined "
54 "interfaces. This makes adding new features and fixing bugs in calibre very "
55 "easy, resulting in a frenetic pace of development. Because of its roots, "
56 "calibre has a comprehensive command line interface for all its functions, "
57 "documented in :doc:`generated/en/cli-index`."
58 msgstr "calibre のルーツは UNIX の世界にあります。つまり、その設計は高度にモジュール化されています。モジュールは明確に定義されたインタフェースを介して互いにコミュニケーションをとります。これによって calibre に新しい機能を追加してバグを修正することが容易になり、開発のペースが大きく向上します。このルーツのおかげで、calibre にはすべての機能に対して包括的なコマンドラインが備わっています。コマンドラインについては、:doc:`generated/ja/cli-index` を参照してください。"
59
60 #: ../../../__w/calibre/calibre/manual/develop.rst:24
61 msgid ""
62 "The modular design of calibre is expressed via ``Plugins``. There is a "
63 ":ref:`tutorial <customize>` on writing calibre plugins. For example, adding "
64 "support for a new device to calibre typically involves writing fewer than "
65 "100 lines of code in the form of a device driver plugin. You can browse the "
66 "`built-in drivers "
67 "<https://github.com/kovidgoyal/calibre/tree/master/src/calibre/devices>`_. "
68 "Similarly, adding support for new conversion formats involves writing "
69 "input/output format plugins. Another example of the modular design is the "
70 ":ref:`recipe system <news>` for fetching news. For more examples of plugins "
71 "designed to add features to calibre, see the `Index of plugins "
72 "<https://www.mobileread.com/forums/showthread.php?p=1362767#post1362767>`_."
73 msgstr "calibre のモジュール化された設計は、 ``プラグイン`` の形で表されます。calibre のプラグイン作成に関しては :ref:`チュートリアル<customize>` があります。たとえば calibre に新しいデバイスを追加するためには、通常はデバイスドライバプラグインの形で 100 行未満くらいのコードを書く必要があります。 `ビルトインドライバ` を参照できます。同様に、新しい形式への変換をサポートしたい場合にも、その形式の入力/出力プラグインを書く必要があります。モジュール化された設計のもうひとつの例は、ニュース取得の :ref:`レシピシステム<news>` です。calibre に機能追加するために設計されたプラグインのその他の例については、 `プラグイン目録 <https://www.mobileread.com/forums/showthread.php?p=1362767#post1362767>`_ を参照してください。"
74
75 #: ../../../__w/calibre/calibre/manual/develop.rst:34
76 msgid "Code layout"
77 msgstr "コードレイアウト"
78
79 #: ../../../__w/calibre/calibre/manual/develop.rst:36
80 msgid ""
81 "All the calibre Python code is in the ``calibre`` package. This package "
82 "contains the following main sub-packages"
83 msgstr "calibreのPythonコードはすべて ``calibre`` パッケージに含まれています。このパッケージには、以下の主要なサブパッケージが含まれています。"
84
85 #: ../../../__w/calibre/calibre/manual/develop.rst:38
86 msgid ""
87 "devices - All the device drivers. Just look through some of the built-in "
88 "drivers to get an idea for how they work."
89 msgstr "devices - すべてのデバイスドライバ。ビルトインドライバのいくつかを調べて、どのように機能するかを調べてみてください。"
90
91 #: ../../../__w/calibre/calibre/manual/develop.rst:40
92 msgid ""
93 "For details, see: ``devices.interface`` which defines the interface "
94 "supported by device drivers and ``devices.usbms`` which defines a generic "
95 "driver that connects to a USBMS device. All USBMS based drivers in calibre "
96 "inherit from it."
97 msgstr "詳しくは、デバイスドライバがサポートするインタフェースを定義する ``devices.interface`` および USBMS デバイスに接続する汎用ドライバを定義する ``devices.usbms`` を参照してください。calibre のすべての USBMS ベースのドライバは、これを継承しています。"
98
99 #: ../../../__w/calibre/calibre/manual/develop.rst:43
100 msgid ""
101 "e-books - All the e-book conversion/metadata code. A good starting point is"
102 " ``calibre.ebooks.conversion.cli`` which is the module powering the "
103 ":command:`ebook-convert` command. The conversion process is controlled via "
104 "``conversion.plumber``. The format independent code is all in ``ebooks.oeb``"
105 " and the format dependent code is in ``ebooks.format_name``."
106 msgstr "e-books - すべての電子書籍変換/書誌のコード。:command:`ebook-convert` コマンドを起動するモジュールである ``calibre.ebooks.conversion.cli`` から始めるとよいでしょう。変換処理は ``conversion.plumber`` を介して行われます。形式に依存しないコードはすべて ``ebooks.oeb`` にあり、形式依存のコードは ``ebooks.format_name`` にあります。"
107
108 #: ../../../__w/calibre/calibre/manual/develop.rst:47
109 msgid ""
110 "Metadata reading, writing, and downloading is all in ``ebooks.metadata``"
111 msgstr "書誌の読み書き、およびダウンロードはすべて ``ebooks.metadata`` にあります。"
112
113 #: ../../../__w/calibre/calibre/manual/develop.rst:48
114 msgid ""
115 "Conversion happens in a pipeline, for the structure of the pipeline, see "
116 ":ref:`conversion-introduction`. The pipeline consists of an input plugin, "
117 "various transforms and an output plugin. The code that constructs and drives"
118 " the pipeline is in :file:`plumber.py`. The pipeline works on a "
119 "representation of an e-book that is like an unzipped epub, with manifest, "
120 "spine, toc, guide, html content, etc. The class that manages this "
121 "representation is OEBBook in ``ebooks.oeb.base``. The various "
122 "transformations that are applied to the book during conversions live in "
123 ":file:`oeb/transforms/*.py`. And the input and output plugins live in "
124 ":file:`conversion/plugins/*.py`."
125 msgstr "変換はパイプラインで行われます。パイプラインの構造については :ref:`conversion-introduction` を参照してください。パイプラインは、入力プラグイン、種々の変換、および出力プラグインで構成されています。パイプラインを構築して動かすコードは :file:`plumber.py` にあります。パイプラインは電子書籍の中身に対して機能します。中身とは、たとえばマニフェスト、スパイン、目次、ガイド、HTML コンテンツなどを含む、解凍された EPUB のことです。この中身を管理するクラスは、``ebooks.oeb.base`` にある OEBBook です。変換中に本に対して施される種々の変形は、:file:`oeb/transforms/*.py` にあります。また入力および出力プラグインは :file:`conversion/plugins/*.py` にあります。"
126
127 #: ../../../__w/calibre/calibre/manual/develop.rst:58
128 msgid ""
129 "E-book editing happens using a different container object. It is documented "
130 "in :ref:`polish_api`."
131 msgstr "電子書籍の編集は、別のコンテナオブジェクトを用いて行われます。これは :ref:`polish_api` に記載されています。"
132
133 #: ../../../__w/calibre/calibre/manual/develop.rst:61
134 msgid ""
135 "db - The database back-end. See :ref:`db_api` for the interface to the "
136 "calibre library."
137 msgstr "db - データベースのバックエンド。calibre ライブラリへのインタフェースは :ref:`db_api` を参照してください。"
138
139 #: ../../../__w/calibre/calibre/manual/develop.rst:63
140 msgid "Content server: ``srv`` is the calibre Content server."
141 msgstr "コンテンツサーバ: ``srv`` は calibre コンテンツサーバです。"
142
143 #: ../../../__w/calibre/calibre/manual/develop.rst:65
144 msgid ""
145 "gui2 - The Graphical User Interface. GUI initialization happens in "
146 "``gui2.main`` and ``gui2.ui``. The e-book-viewer is in ``gui2.viewer``. The "
147 "e-book editor is in ``gui2.tweak_book``."
148 msgstr "gui2 - グラフィカルユーザインタフェース。GUI の初期化は ``gui2.main`` と ``gui2.ui`` で行われます。電子書籍ビューアは ``gui2.viewer`` にあります。電子書籍エディタは ``gui2.tweak_book`` にあります。"
149
150 #: ../../../__w/calibre/calibre/manual/develop.rst:67
151 msgid ""
152 "If you want to locate the entry points for all the various calibre "
153 "executables, look at the ``entry_points`` structure in `linux.py "
154 "<https://github.com/kovidgoyal/calibre/blob/master/src/calibre/linux.py>`_."
155 msgstr "calibre のさまざまな実行可能ファイルすべてのエントリポイントを探したい場合は、 `linux.py <https://github.com/kovidgoyal/calibre/blob/master/src/calibre/linux.py>`_ の ``entry_points`` 構造体を確認してください。"
156
157 #: ../../../__w/calibre/calibre/manual/develop.rst:71
158 msgid ""
159 "If you need help understanding the code, post in the `development forum "
160 "<https://www.mobileread.com/forums/forumdisplay.php?f=240>`_ and you will "
161 "most likely get help from one of calibre's many developers."
162 msgstr "コードの理解に手助けが必要な場合には、 `開発フォーラム <https://www.mobileread.com/forums/forumdisplay.php?f=240>`_ に投稿してください。おそらく数多くの calibre 開発者の中から誰かが手を貸してくれるでしょう。"
163
164 #: ../../../__w/calibre/calibre/manual/develop.rst:75
165 msgid "Getting the code"
166 msgstr "コードを入手"
167
168 #: ../../../__w/calibre/calibre/manual/develop.rst:77
169 msgid ""
170 "You can get the calibre source code in two ways, using a version control "
171 "system or directly downloading a :website_base:`tarball <dist/src>`."
172 msgstr "calibre のソースコードを入手する方法は 2 つあります。バージョン管理システムを利用する方法と、直接 :website_base:`tarball <dist/src>` をダウンロードする方法です。"
173
174 #: ../../../__w/calibre/calibre/manual/develop.rst:80
175 msgid ""
176 "calibre uses `Git <https://www.git-scm.com/>`_, a distributed version "
177 "control system. Git is available on all the platforms calibre supports. "
178 "After installing Git, you can get the calibre source code with the command::"
179 msgstr "calibre は分散バージョン管理システムである `Git <https://www.git-scm.com/>`_ を使用しています。Git は calibre がサポートしているすべてのプラットフォーム上で利用可能です。Git をインストールした後、次のコマンドで calibre のソースコードを入手できます::"
180
181 #: ../../../__w/calibre/calibre/manual/develop.rst:86
182 msgid ""
183 "On Windows you will need the complete path name, that will be something like"
184 " :file:`C:\\\\Program Files\\\\Git\\\\git.exe`."
185 msgstr "Windows では :file:`C:\\\\Program Files\\\\Git\\\\git.exe` のような完全なパス名が必要です。"
186
187 #: ../../../__w/calibre/calibre/manual/develop.rst:88
188 msgid ""
189 "calibre is a very large project with a very long source control history, so "
190 "the above can take a while (10 mins to an hour depending on your internet "
191 "speed)."
192 msgstr "calibre は非常に大規模なプロジェクトであり、ソース管理の履歴も長いため、上記には時間がかかる場合があります (インターネットの速度に応じて 10 分から 1 時間)。"
193
194 #: ../../../__w/calibre/calibre/manual/develop.rst:91
195 msgid ""
196 "If you want to get the code faster, the source code for the latest release "
197 "is always available as an :website_base:`archive <dist/src>`."
198 msgstr "コードの入手に時間をかけたくない場合は、最新リリースのソースコードはいつでも :website_base:`archive <dist/src>` で入手可能です。"
199
200 #: ../../../__w/calibre/calibre/manual/develop.rst:94
201 msgid "To update a branch to the latest code, use the command::"
202 msgstr "ブランチを最新のコードに更新するには、次のコマンドを使用します::"
203
204 #: ../../../__w/calibre/calibre/manual/develop.rst:98
205 msgid ""
206 "You can also browse the code at `GitHub "
207 "<https://github.com/kovidgoyal/calibre>`_."
208 msgstr "コードを `GitHub <https://github.com/kovidgoyal/calibre>`_ で参照することもできます。"
209
210 #: ../../../__w/calibre/calibre/manual/develop.rst:101
211 msgid "Submitting your changes to be included"
212 msgstr "変更を取り入れてもらうために投稿"
213
214 #: ../../../__w/calibre/calibre/manual/develop.rst:103
215 msgid ""
216 "If you only plan to make a few small changes, you can make your changes and "
217 "create a \"merge directive\" which you can then attach to a ticket in the "
218 "calibre `bug tracker <https://bugs.launchpad.net/calibre>`_. To do this, "
219 "make your changes, then run::"
220 msgstr "もしいくつかのちょっとした変更を行いたいだけなら、変更を加えてマージディレクティブを作成し、それを calibre の `バグトラッカー <https://bugs.launchpad.net/calibre>`_ のチケットに添付することができます。それを行うには、変更を加えてから、次のように実行します::"
221
222 #: ../../../__w/calibre/calibre/manual/develop.rst:111
223 msgid ""
224 "This will create a :file:`my-changes` file in the current folder, simply "
225 "attach that to a ticket on the calibre `bug tracker "
226 "<https://bugs.launchpad.net/calibre>`_. Note that this will include *all* "
227 "the commits you have made. If you only want to send some commits, you have "
228 "to change ``origin/master`` above. To send only the last commit, use::"
229 msgstr "これは現在のフォルダに :file:`my-changes` ファイルを作成し、calibre `バグトラッカー <https://bugs.launchpad.net/calibre>`_ のチケットにそれを添付します。ただしこれは、コミットしたもの *すべて* を含めます。一部のコミットのみを送信したい場合には、上の ``origin/master`` を変更する必要があります。最後のコミットのみを送信するには、次のようにします::"
230
231 #: ../../../__w/calibre/calibre/manual/develop.rst:119
232 msgid ""
233 "To send the last *n* commits, replace *1* with *n*, for example, for the "
234 "last 3 commits::"
235 msgstr "最後の *n* 個のコミットを送信するには、*1* を *n* に変更します。たとえば最後の 3 コミットの場合には次のようにします::"
236
237 #: ../../../__w/calibre/calibre/manual/develop.rst:124
238 msgid "Be careful to not include merges when using ``HEAD~n``."
239 msgstr "``HEAD~n`` を使用するときにはマージを含めないよう注意してください。"
240
241 #: ../../../__w/calibre/calibre/manual/develop.rst:126
242 msgid ""
243 "If you plan to do a lot of development on calibre, then the best method is "
244 "to create a `GitHub <https://github.com>`__ account. Below is a basic guide "
245 "to setting up your own fork of calibre in a way that will allow you to "
246 "submit pull requests for inclusion into the main calibre repository:"
247 msgstr "calibre で多くの開発を行うつもりであれば、最良の方法は `GitHub <https://github.com>`_ アカウントを作成することです。下に示す基本的なガイドに従ってフォークを作成すれば、メインの calibre リポジトリにプルリクエストを送れるようになります:"
248
249 #: ../../../__w/calibre/calibre/manual/develop.rst:131
250 msgid ""
251 "Setup git on your machine as described in this article: `Setup Git "
252 "<https://help.github.com/articles/set-up-git>`_"
253 msgstr "次の記事に従ってマシン上に Git を準備します: `Setup Git <https://help.github.com/articles/set-up-git>`_"
254
255 #: ../../../__w/calibre/calibre/manual/develop.rst:132
256 msgid ""
257 "Setup ssh keys for authentication to GitHub, as described here: `Generating "
258 "SSH keys <https://help.github.com/articles/generating-ssh-keys>`_"
259 msgstr "GitHub の認証用に SSH の鍵を `Generating SSH keys <https://help.github.com/articles/generating-ssh-keys>`_ の説明に従って用意します"
260
261 #: ../../../__w/calibre/calibre/manual/develop.rst:133
262 msgid ""
263 "Go to https://github.com/kovidgoyal/calibre and click the :guilabel:`Fork` "
264 "button."
265 msgstr "https://github.com/kovidgoyal/calibre へ行き、:guilabel:`Fork` ボタンをクリックします。"
266
267 #: ../../../__w/calibre/calibre/manual/develop.rst:134
268 msgid "In a Terminal do::"
269 msgstr "ターミナルで次を実行します::"
270
271 #: ../../../__w/calibre/calibre/manual/develop.rst:139
272 msgid ""
273 "Replace <username> above with your GitHub username. That will get your fork "
274 "checked out locally."
275 msgstr "上の <username> は GitHub のユーザ名で置き換えてください。これでフォークがローカルにチェックアウトされます。"
276
277 #: ../../../__w/calibre/calibre/manual/develop.rst:140
278 msgid ""
279 "You can make changes and commit them whenever you like. When you are ready "
280 "to have your work merged, do a::"
281 msgstr "いつでも好きなときに変更を加えてコミットできます。作業したものがマージできるようになったら、次のようにします::"
282
283 #: ../../../__w/calibre/calibre/manual/develop.rst:144
284 msgid ""
285 "and go to ``https://github.com/<username>/calibre`` and click the "
286 ":guilabel:`Pull Request` button to generate a pull request that can be "
287 "merged."
288 msgstr "そして ``https://github.com/<username>/calibre`` に行き、:guilabel:`Pull Request` ボタンをクリックしてマージできるようプルリクエストを発行します。"
289
290 #: ../../../__w/calibre/calibre/manual/develop.rst:145
291 msgid ""
292 "You can update your local copy with code from the main repo at any time by "
293 "doing::"
294 msgstr "次の手順を実行することで、メインのリポジトリからのコードでローカルコピーを更新できます::"
295
296 #: ../../../__w/calibre/calibre/manual/develop.rst:150
297 msgid ""
298 "You should also keep an eye on the calibre `development forum "
299 "<https://www.mobileread.com/forums/forumdisplay.php?f=240>`_. Before making "
300 "major changes, you should discuss them in the forum or contact Kovid "
301 "directly (his email address is all over the source code)."
302 msgstr "また、 `開発フォーラム <https://www.mobileread.com/forums/forumdisplay.php?f=240>`_ にも注目しておくべきです。大きな変更を加える前に、フォーラムで話し合うか、または直接 Kovid に連絡してください。 (メールアドレスはソースコードのいたるところに埋めこまれています)"
303
304 #: ../../../__w/calibre/calibre/manual/develop.rst:156
305 msgid "Windows development environment"
306 msgstr "Windows 開発環境"
307
308 #: ../../../__w/calibre/calibre/manual/develop.rst:158
309 #: ../../../__w/calibre/calibre/manual/develop.rst:192
310 #: ../../../__w/calibre/calibre/manual/develop.rst:229
311 msgid ""
312 "You must also get the calibre source code separately as described above."
313 msgstr "上で説明したように calibre のソースコードを別に入手する必要があります。"
314
315 #: ../../../__w/calibre/calibre/manual/develop.rst:160
316 msgid ""
317 "Install calibre normally, using the `Windows installer <https://calibre-"
318 "ebook.com/download_windows>`__. Then open a Command Prompt and change to the"
319 " previously checked out calibre code folder. For example::"
320 msgstr "`Windows インストーラ <https://calibre-ebook.com/download_windows>`__ を使用して通常どおりにインストールします。次にコマンドプロンプトを開き、先にチェックアウトしておいた calibre のコードに移動します。例::"
321
322 #: ../../../__w/calibre/calibre/manual/develop.rst:165
323 #: ../../../__w/calibre/calibre/manual/develop.rst:241
324 msgid "calibre is the folder that contains the src and resources sub-folders."
325 msgstr "calibre は src と resources サブフォルダを含むフォルダです。"
326
327 #: ../../../__w/calibre/calibre/manual/develop.rst:167
328 msgid ""
329 "The next step is to set the environment variable ``CALIBRE_DEVELOP_FROM`` to"
330 " the absolute path of the src folder. So, following the example above, it "
331 "would be ``C:\\Users\\kovid\\work\\calibre\\src``. `Here is a short guide "
332 "<https://docs.python.org/using/windows.html#excursus-setting-environment-"
333 "variables>`_ to setting environment variables on Windows."
334 msgstr "次のステップは、環境変数 ``CALIBRE_DEVELOP_FROM`` に src フォルダの絶対パスを設定することです。上の例では ``C:\\Users\\kovid\\work\\calibre\\src`` になります。Windows 上での環境変数の設定方法は、 `こちらのガイド <https://docs.python.org/using/windows.html#excursus-setting-environment-variables>`_ を参照してください。"
335
336 #: ../../../__w/calibre/calibre/manual/develop.rst:172
337 msgid ""
338 "Once you have set the environment variable, open a new command prompt and "
339 "check that it was correctly set by using the command::"
340 msgstr "環境変数を設定したらコマンドプロンプトを開き、正しく設定されていることを確認するために次のコマンドを実行します::"
341
342 #: ../../../__w/calibre/calibre/manual/develop.rst:177
343 #: ../../../__w/calibre/calibre/manual/develop.rst:260
344 msgid ""
345 "Setting this environment variable means that calibre will now load all its "
346 "Python code from the specified location."
347 msgstr "この環境変数を設定すると、calibre はすべての Python コードを指定された場所からロードするようになります。"
348
349 #: ../../../__w/calibre/calibre/manual/develop.rst:179
350 msgid ""
351 "That's it! You are now ready to start hacking on the calibre code. For "
352 "example, open the file :file:`src\\\\calibre\\\\__init__.py` in your "
353 "favorite editor and add the line::"
354 msgstr "これでおしまいです。calibre コードのハックを開始できるようになりました。たとえば :file:`src\\\\calibre\\\\__init__.py` ファイルを好みのエディタで開き、次の行をファイルの先頭近くに追加します::"
355
356 #: ../../../__w/calibre/calibre/manual/develop.rst:184
357 #: ../../../__w/calibre/calibre/manual/develop.rst:267
358 msgid ""
359 "near the top of the file. Now run the command :command:`calibredb`. The very"
360 " first line of output should be ``Hello, world!``."
361 msgstr "次に :command:`calibredb` コマンドを実行します。最初の行の出力は ``Hello, world!`` となるでしょう。"
362
363 #: ../../../__w/calibre/calibre/manual/develop.rst:186
364 msgid ""
365 "You can also setup a calibre development environment inside the free "
366 "Microsoft Visual Studio, if you like, following the instructions `here "
367 "<https://www.mobileread.com/forums/showthread.php?t=251201>`_."
368 msgstr "必要に応じて calibre 開発環境を無償の Microsoft Visual Studio にセットアップすることも可能です。 `こちら <https://www.mobileread.com/forums/showthread.php?t=251201>`_ の手順に従ってください。"
369
370 #: ../../../__w/calibre/calibre/manual/develop.rst:190
371 msgid "macOS development environment"
372 msgstr "macOS 開発環境"
373
374 #: ../../../__w/calibre/calibre/manual/develop.rst:194
375 msgid ""
376 "Install calibre normally using the `provided .dmg <https://calibre-"
377 "ebook.com/download_osx>`__. Then open a Terminal and change to the "
378 "previously checked out calibre code folder, for example::"
379 msgstr "`提供された .dmg <https://calibre-ebook.com/download_osx>`__ を使用して通常どおりに calibre をインストールします。次にターミナルを開いて、先にチェックアウトしておいた calibre のコードのフォルダに移動します。例::"
380
381 #: ../../../__w/calibre/calibre/manual/develop.rst:199
382 msgid ""
383 "calibre is the folder that contains the src and resources sub-folders. The "
384 "calibre command line tools are found inside the calibre app bundle, in "
385 ":file:`/Applications/calibre.app/Contents/MacOS` you should add this folder "
386 "to your PATH environment variable, if you want to run the command line tools"
387 " easily."
388 msgstr "calibre は src と resources サブフォルダを含むフォルダです。calibre のコマンドラインツールは calibre アプリのバンドルの中の :file:`/Applications/calibre.app/Contents/MacOS` にあります。コマンドラインツールを簡単に実行するには、このフォルダを環境変数 PATH に追加する必要があります。"
389
390 #: ../../../__w/calibre/calibre/manual/develop.rst:205
391 msgid ""
392 "The next step is to create a bash script that will set the environment "
393 "variable ``CALIBRE_DEVELOP_FROM`` to the absolute path of the src folder "
394 "when running calibre in debug mode."
395 msgstr "次のステップは、calibre をデバッグモードで実行するときに環境変数 ``CALIBRE_DEVELOP_FROM`` に src フォルダの絶対パスを設定するための bash スクリプトを作成することです。"
396
397 #: ../../../__w/calibre/calibre/manual/develop.rst:208
398 msgid "Create a plain text file::"
399 msgstr "プレーンテキストファイルを作成します::"
400
401 #: ../../../__w/calibre/calibre/manual/develop.rst:214
402 msgid ""
403 "Save this file as :file:`/usr/local/bin/calibre-develop`, then set its "
404 "permissions so that it can be executed::"
405 msgstr "これを :file:`/usr/local/bin/calibre-develop` という名前のファイルに保存し、実行権を付与します::"
406
407 #: ../../../__w/calibre/calibre/manual/develop.rst:218
408 msgid "Once you have done this, run::"
409 msgstr "それが終わったら、実行します::"
410
411 #: ../../../__w/calibre/calibre/manual/develop.rst:222
412 msgid ""
413 "You should see some diagnostic information in the Terminal window as calibre"
414 " starts up, and you should see an asterisk after the version number in the "
415 "GUI window, indicating that you are running from source."
416 msgstr "calibre が開始されるとターミナルウィンドウに診断情報が表示されます。GUI ウィンドウにはバージョン番号の後ろにアスタリスクが表示され、ソースから実行していることを示します。"
417
418 #: ../../../__w/calibre/calibre/manual/develop.rst:227
419 msgid "Linux development environment"
420 msgstr "Linux 開発環境"
421
422 #: ../../../__w/calibre/calibre/manual/develop.rst:231
423 msgid ""
424 "calibre is primarily developed on Linux. You have two choices in setting up "
425 "the development environment. You can install the calibre binary as normal "
426 "and use that as a runtime environment to do your development. This approach "
427 "is similar to that used in Windows and macOS. Alternatively, you can install"
428 " calibre from source. Instructions for setting up a development environment "
429 "from source are in the INSTALL file in the source tree. Here we will address"
430 " using the binary as a runtime, which is the recommended method."
431 msgstr "calibre は主に Linux 上で開発されています。開発環境の構築には、2 つの選択肢があります。calibre のバイナリを通常どおりインストールして、それを開発用のランタイム環境として使用することができます。この手法は Windows や macOS で使われるものとよく似ています。もうひとつの方法は、calibre をソースからインストールすることです。ソースから開発環境を構築する手順はソースツリーの中の INSTALL ファイルにあります。ここではバイナリをランタイムとして使用する方法を取り上げます。こちらが推奨される方法です。"
432
433 #: ../../../__w/calibre/calibre/manual/develop.rst:237
434 msgid ""
435 "Install calibre using the `binary installer <https://calibre-"
436 "ebook.com/download_linux>`_. Then open a terminal and change to the "
437 "previously checked out calibre code folder, for example::"
438 msgstr "`バイナリインストーラ <https://calibre-ebook.com/download_linux>`_ を使用して calibre を通常どおりにインストールします。次にターミナルを開き、先にチェックアウトしておいた calibre のコードのフォルダに移動します。例::"
439
440 #: ../../../__w/calibre/calibre/manual/develop.rst:243
441 msgid ""
442 "The next step is to set the environment variable ``CALIBRE_DEVELOP_FROM`` to"
443 " the absolute path of the src folder. So, following the example above, it "
444 "would be ``/home/kovid/work/calibre/src``. How to set environment variables "
445 "depends on your Linux distribution and what shell you are using."
446 msgstr "次のステップは、環境変数 ``CALIBRE_DEVELOP_FROM`` に src フォルダの絶対パスを設定することです。上の例では ``/home/kovid/work/calibre/src`` になります。環境変数の設定方法は、Linux のディストリビューションや使用しているシェルによって異なります。"
447
448 #: ../../../__w/calibre/calibre/manual/develop.rst:248
449 msgid ""
450 "It is recommended to use the binary installer provided from upstream. Should"
451 " you insist on using a package provided by your distribution, use the "
452 "``CALIBRE_PYTHON_PATH`` and ``CALIBRE_RESOURCES_PATH`` variables instead. "
453 "You can get these by running ``calibre-debug --paths``. But note that "
454 "distribution calibre packages are often terminally broken and are completely"
455 " unsupported."
456 msgstr "アップストリームから提供されるバイナリインストーラの使用をお勧めします。どうしてもディストリビューションが提供するパッケージを使用したい場合は、代わりに ``CALIBRE_PYTHON_PATH`` および ``CALIBRE_RESOURCES_PATH`` 変数を使用してください。これらの変数は ``calibre-debug --paths`` を実行することで取得できます。ただし、ディストリビューションのcalibreパッケージは多くの場合、長期間メンテされず、完全にサポートされていないことに注意してください。"
457
458 #: ../../../__w/calibre/calibre/manual/develop.rst:255
459 msgid ""
460 "Once you have set the environment variable, open a new terminal and check "
461 "that it was correctly set by using the command::"
462 msgstr "環境変数を設定したらターミナルを開き、正しく設定されていることを確認するために次のコマンドを実行します::"
463
464 #: ../../../__w/calibre/calibre/manual/develop.rst:262
465 msgid ""
466 "That's it! You are now ready to start hacking on the calibre code. For "
467 "example, open the file :file:`src/calibre/__init__.py` in your favorite "
468 "editor and add the line::"
469 msgstr "これでおしまいです。calibre コードのハックを開始できるようになりました。たとえば :file:`src/calibre/__init__.py` ファイルを好みのエディタで開き、次の行をファイルの先頭近くに追加します::"
470
471 #: ../../../__w/calibre/calibre/manual/develop.rst:270
472 msgid ""
473 "Having separate \"normal\" and \"development\" calibre installs on the same "
474 "computer"
475 msgstr "\"通常\" と \"開発用\" の calibre を同じコンピュータ上に別々にインストール"
476
477 #: ../../../__w/calibre/calibre/manual/develop.rst:272
478 msgid ""
479 "The calibre source tree is very stable and rarely breaks, but if you feel "
480 "the need to run from source on a separate test library and run the released "
481 "calibre version with your everyday library, you can achieve this easily "
482 "using .bat files or shell scripts to launch calibre. The example below shows"
483 " how to do this on Windows using .bat files (the instructions for other "
484 "platforms are the same, just use a shell script instead of a .bat file)"
485 msgstr "calibre のソースツリーは非常に安定していて壊れることは滅多にありません。しかしソースから実行したものはテスト用のライブラリに使用し、日常的に使用するライブラリにはリリース版の calibre を使用する必要があると感じる場合には、calibre を起動する .bat ファイルやシェルスクリプトを使うことで簡単に実現できます。下の例では、Windows 上で .bat ファイルを使ってこれを行う手順を紹介します (他のプラットフォームでの手順も同じです。.bat ファイルの代わりにシェルスクリプトを使用してください)"
486
487 #: ../../../__w/calibre/calibre/manual/develop.rst:277
488 msgid "To launch the release version of calibre with your everyday library:"
489 msgstr "日常的に使用するライブラリ用にリリース版の calibre を起動するには次のようにします:"
490
491 #: ../../../__w/calibre/calibre/manual/develop.rst:279
492 msgid "calibre-normal.bat::"
493 msgstr "calibre-normal.bat::"
494
495 #: ../../../__w/calibre/calibre/manual/develop.rst:283
496 msgid "calibre-dev.bat::"
497 msgstr "calibre-dev.bat::"
498
499 #: ../../../__w/calibre/calibre/manual/develop.rst:290
500 msgid "Debugging tips"
501 msgstr "デバッグのコツ"
502
503 #: ../../../__w/calibre/calibre/manual/develop.rst:292
504 msgid ""
505 "Python is a dynamically typed language with excellent facilities for "
506 "introspection. Kovid wrote the core calibre code without once using a "
507 "debugger. There are many strategies to debug calibre code:"
508 msgstr "Python は動的型付けの言語であり、内省のための優れた機能を備えています。Kovid は calibre の中核となるコードを一度もデバッガを使用せずに書き上げました。calibre のコードをデバッグするには多くの戦略があります:"
509
510 #: ../../../__w/calibre/calibre/manual/develop.rst:297
511 msgid "Using print statements"
512 msgstr "print 文を使用"
513
514 #: ../../../__w/calibre/calibre/manual/develop.rst:299
515 msgid ""
516 "This is Kovid's favorite way to debug. Simply insert print statements at "
517 "points of interest and run your program in the terminal. For example, you "
518 "can start the GUI from the terminal as::"
519 msgstr "Kovid のお気に入りのデバッグ方法は、これです。気になる場所に print 文を挿入し、プログラムをターミナルから実行するだけです。たとえば GUI をターミナルから次のように開始します::"
520
521 #: ../../../__w/calibre/calibre/manual/develop.rst:304
522 msgid "Similarly, you can start the E-book viewer as::"
523 msgstr "同様にして、電子書籍ビューアは次にように開始します::"
524
525 #: ../../../__w/calibre/calibre/manual/develop.rst:308
526 msgid "The e-book editor can be started as::"
527 msgstr "電子書籍の編集は次のように開始できます:"
528
529 #: ../../../__w/calibre/calibre/manual/develop.rst:313
530 msgid "Using an interactive Python interpreter"
531 msgstr "インタラクティブな Python インタプリタの利用"
532
533 #: ../../../__w/calibre/calibre/manual/develop.rst:315
534 msgid ""
535 "You can insert the following two lines of code to start an interactive "
536 "Python session at that point::"
537 msgstr "次に示す 2 行のコードを挿入すると、その場所でインタラクティブな Python セッションを開始できます::"
538
539 #: ../../../__w/calibre/calibre/manual/develop.rst:320
540 msgid ""
541 "When running from the command line, this will start an interactive Python "
542 "interpreter with access to all locally defined variables (variables in the "
543 "local scope). The interactive prompt even has :kbd:`Tab` completion for "
544 "object properties and you can use the various Python facilities for "
545 "introspection, such as :func:`dir`, :func:`type`, :func:`repr`, etc."
546 msgstr "コマンドラインから実行すると、これはローカルに定義された変数 (ローカルスコープ内の変数) にアクセスできるインタラクティブな Python インタプリタを開始します。インタラクティブプロンプトはオブジェクトプロパティの :kbd:`タブ` 補完機能も備えており、さまざまな Python 機能を :func:`dir`, :func:`type`, :func:`repr` などの内省に使用できます。"
547
548 #: ../../../__w/calibre/calibre/manual/develop.rst:326
549 msgid "Using the Python debugger as a remote debugger"
550 msgstr "Python デバッガをリモートデバッガとして使用"
551
552 #: ../../../__w/calibre/calibre/manual/develop.rst:328
553 msgid ""
554 "You can use the builtin Python debugger (pdb) as a remote debugger from the "
555 "command line. First, start the remote debugger at the point in the calibre "
556 "code you are interested in, like this::"
557 msgstr "ビルトインの Python デバッガ (pdb) をリモートデバッガとしてコマンドラインから使用することができます。まず、次のように calibre コードの中の気になる場所でリモートデバッガを開始します::"
558
559 #: ../../../__w/calibre/calibre/manual/develop.rst:335
560 msgid ""
561 "Then run calibre, either as normal, or using one of the calibre-debug "
562 "commands described in the previous section. Once the above point in the code"
563 " is reached, calibre will freeze, waiting for the debugger to connect."
564 msgstr "次に calibre を実行します。通常どおりに実行しても、または前の章で説明したようにcalibre-debug コマンドのひとつを使用してもかまいません。コード内の上記の場所に到達したら、calibre はフリーズしてデバッガの接続を待ちます。"
565
566 #: ../../../__w/calibre/calibre/manual/develop.rst:339
567 msgid ""
568 "Now open a terminal or command prompt and use the following command to start"
569 " the debugging session::"
570 msgstr "次にターミナルまたはコマンドプロンプトを開き、デバッグセッションを開始するために次のコマンドを使用します::"
571
572 #: ../../../__w/calibre/calibre/manual/develop.rst:344
573 msgid ""
574 "You can read about how to use the Python debugger in the `Python stdlib docs"
575 " for the pdb module <https://docs.python.org/library/pdb.html#debugger-"
576 "commands>`_."
577 msgstr "Python デバッガの使い方は `Python stdlib docs for the pdb module <https://docs.python.org/library/pdb.html#debugger-commands>`_ を読んでください。"
578
579 #: ../../../__w/calibre/calibre/manual/develop.rst:348
580 msgid ""
581 "By default, the remote debugger will try to connect on port 4444. You can "
582 "change it, by passing the port parameter to both the set_trace() and the "
583 "cli() functions above, like this: ``set_trace(port=1234)`` and "
584 "``cli(port=1234)``."
585 msgstr "デフォルトではリモートデバッガはポート 4444 に接続しようとします。ポート番号をパラメータとして set_trace() および cli() 関数の両方に渡してやると、使用するポートを変更できます。``set_trace(port=1234)`` や ``cli(port=1234)`` のように指定します。"
586
587 #: ../../../__w/calibre/calibre/manual/develop.rst:354
588 msgid ""
589 "The Python debugger cannot handle multiple threads, so you have to call "
590 "set_trace once per thread, each time with a different port number."
591 msgstr "Python デバッガは複数スレッドを処理できないため、スレッドごとに set_trace を呼び出してそれぞれ別のポート番号を指定してやる必要があります。"
592
593 #: ../../../__w/calibre/calibre/manual/develop.rst:358
594 msgid "Using the debugger in your favorite Python IDE"
595 msgstr "好みの Python IDE でデバッガを使用"
596
597 #: ../../../__w/calibre/calibre/manual/develop.rst:360
598 msgid ""
599 "It is possible to use the builtin debugger in your favorite Python IDE, if "
600 "it supports remote debugging. The first step is to add the calibre src "
601 "checkout to the ``PYTHONPATH`` in your IDE. In other words, the folder you "
602 "set as ``CALIBRE_DEVELOP_FROM`` above, must also be in the ``PYTHONPATH`` of"
603 " your IDE."
604 msgstr "リモートデバッグをサポートしていれば、お気に入りの IDE でビルトインデバッガを使用することも可能です。最初のステップは、calibre の src を IDE の ``PYTHONPATH`` にチェックアウトすることです。別の言葉で言うと、上で ``CALIBRE_DEVELOP_FROM`` に設定したフォルダを、IDE の ``PYTHONPATH`` にする必要があります。"
605
606 #: ../../../__w/calibre/calibre/manual/develop.rst:365
607 msgid ""
608 "Then place the IDE's remote debugger module into the :file:`src` sub-folder "
609 "of the calibre source code checkout. Add whatever code is needed to launch "
610 "the remote debugger to calibre at the point of interest, for example in the "
611 "main function. Then run calibre as normal. Your IDE should now be able to "
612 "connect to the remote debugger running inside calibre."
613 msgstr "次に IDE のリモートデバッガモジュールを、チェックアウトした calibre ソースコードの :file:`src` サブフォルダに配置します。calibre の気になる場所、たとえば main 関数でリモートデバッガを起動するのに必要なコードを追加します。通常の方法で calibre を実行します。これで IDE は calibre の内部で実行されているリモートデバッガに接続できるようになるはずです。"
614
615 #: ../../../__w/calibre/calibre/manual/develop.rst:372
616 msgid "Executing arbitrary scripts in the calibre Python environment"
617 msgstr "calibre の Python 環境で任意のスクリプトを実行"
618
619 #: ../../../__w/calibre/calibre/manual/develop.rst:374
620 msgid ""
621 "The :command:`calibre-debug` command provides a couple of handy switches to "
622 "execute your own code, with access to the calibre modules::"
623 msgstr ":command:`calibre-debug` コマンドには calibre のモジュールにアクセスしてコードを実行するための便利なスイッチがいくつかあります::"
624
625 #: ../../../__w/calibre/calibre/manual/develop.rst:379
626 msgid ""
627 "is great for testing a little snippet of code on the command line. It works "
628 "in the same way as the -c switch to the Python interpreter::"
629 msgstr "これはコマンドラインでちょっとしたスニペットをテストするのに最適です。Python インタプリタの -c スイッチと同じように機能します::"
630
631 #: ../../../__w/calibre/calibre/manual/develop.rst:383
632 msgid ""
633 "can be used to execute your own Python script. It works in the same way as "
634 "passing the script to the Python interpreter, except that the calibre "
635 "environment is fully initialized, so you can use all the calibre code in "
636 "your script. To use command line arguments with your script, use the form::"
637 msgstr "これは Python スクリプトを実行するのに使用できます。スクリプトを Python インタプリタに渡すのと同じように機能しますが、calibre 環境が完全に初期化され、スクリプト内で calibre のすべてのコードを利用できる点が異なります。スクリプトでコマンドライン引数を利用するには、次の形式を使います::"
638
639 #: ../../../__w/calibre/calibre/manual/develop.rst:388
640 msgid ""
641 "The ``--`` causes all subsequent arguments to be passed to your script."
642 msgstr "``--`` を指定すると、後続のすべての引数がスクリプトに渡されます。"
643
644 #: ../../../__w/calibre/calibre/manual/develop.rst:392
645 msgid "Running the calibre test suite"
646 msgstr "calibreテストスイート実行中"
647
648 #: ../../../__w/calibre/calibre/manual/develop.rst:394
649 msgid "The calibre test suite can be run by::"
650 msgstr "calibreテストスイートが実行可能::"
651
652 #: ../../../__w/calibre/calibre/manual/develop.rst:400
653 msgid "Using calibre in your projects"
654 msgstr "プロジェクトで calibre を使用"
655
656 #: ../../../__w/calibre/calibre/manual/develop.rst:402
657 msgid ""
658 "It is possible to directly use calibre functions/code in your Python "
659 "project. Two ways exist to do this:"
660 msgstr "Python のプロジェクトで calibre 関数/コードを直接利用することが可能です。それには 2 つの方法があります:"
661
662 #: ../../../__w/calibre/calibre/manual/develop.rst:405
663 msgid "Binary install of calibre"
664 msgstr "calibre のバイナリインストール"
665
666 #: ../../../__w/calibre/calibre/manual/develop.rst:407
667 msgid ""
668 "If you have a binary install of calibre, you can use the Python interpreter "
669 "bundled with calibre, like this::"
670 msgstr "calibre のバイナリインストールがある場合には、calibre に付属している Python インタプリタを次のようjにして使用できます::"
671
672 #: ../../../__w/calibre/calibre/manual/develop.rst:412
673 msgid "Source install on Linux"
674 msgstr "Linux 上のソースインストール"
675
676 #: ../../../__w/calibre/calibre/manual/develop.rst:414
677 msgid ""
678 "In addition to using the above technique, if you do a source install on "
679 "Linux, you can also directly import calibre, as follows::"
680 msgstr "上記の手法に加えて、Linux 上にソースインストールを行う場合は、次のようにして直接 calibre をインポートすることができます::"
681
682 #: ../../../__w/calibre/calibre/manual/develop.rst:422
683 msgid ""
684 "It is essential that you import the init_calibre module before any other "
685 "calibre modules/packages as it sets up the interpreter to run calibre code."
686 msgstr "重要なのは、他の calibre モジュール/パッケージの前に init_calibre をインポートすることです。インタプリタを calibre コードとして実行するようセットアップするためです。"
687
688 #: ../../../__w/calibre/calibre/manual/develop.rst:426
689 msgid "API documentation for various parts of calibre"
690 msgstr "calibre のパーツの API 説明書"