# SOME DESCRIPTIVE TITLE. # Copyright (C) Kovid Goyal # This file is distributed under the same license as the calibre package. # # Translators: # akihiko tanae (tanaeakihiko), 2025-2026 # toshi oota , 2021 msgid "" msgstr "" "Project-Id-Version: calibre\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-02-25 10:21+0000\n" "PO-Revision-Date: 2014-06-17 08:34+0000\n" "Last-Translator: akihiko tanae (tanaeakihiko), 2025-2026\n" "Language-Team: Japanese (http://app.transifex.com/calibre/calibre/language/ja/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../../__w/calibre/calibre/manual/template_lang.rst:4 msgid "The calibre template language" msgstr "calibre テンプレート言語" #: ../../../__w/calibre/calibre/manual/template_lang.rst:6 msgid "" "The calibre template language is a calibre-specific language used throughout" " calibre for tasks such as specifying file paths, formatting values, and " "computing the value for user-specified columns. Examples:" msgstr "calibre テンプレート言語は、ファイルパスの指定、値の整形、ユーザ指定の列の値の計算などのタスクのために calibre 全体で使用される calibre 固有の言語です。例を挙げると:" #: ../../../__w/calibre/calibre/manual/template_lang.rst:8 msgid "" "Specify the folder structure and file names when saving files from the " "calibre library to the disk or e-book reader." msgstr "calibre ライブラリからディスクまたは電子書籍リーダにファイルを保存するときに、フォルダ構造とファイル名を指定します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:9 msgid "Define rules for adding icons and colors to the calibre book list." msgstr "calibre の本のリストにアイコンと色を追加するためのルールを定義します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:10 msgid "Define `virtual columns` that contain data from other columns." msgstr "他の列からのデータを含む `仮想列` を定義します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:11 msgid "Advanced library searching." msgstr "高度なライブラリ検索。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:12 msgid "Advanced metadata search and replace." msgstr "高度なメタデータの検索と置換。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:14 msgid "" "The language is built around the notion of a `template`, which specifies " "which book metadata to use, computations on that metadata, and how it is to " "be formatted." msgstr "この言語は、使用する本の書誌、その書誌の計算、およびそのフォーマット方法を指定する `テンプレート` の概念に基づいて構築されています。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:17 msgid "Basic templates" msgstr "基本テンプレート" #: ../../../__w/calibre/calibre/manual/template_lang.rst:19 msgid "" "A basic template consists of one or more ``template expressions``. A " "``template expression`` consists of text and names in curly brackets " "(``{}``) that is replaced by the corresponding metadata from the book being " "processed. For example, the default template in calibre used for saving " "books to device has 4 ``template expressions``::" msgstr "基本テンプレートは、1つ以上の ``テンプレート式`` で構成されます。 ``テンプレート式`` は、中括弧( ``{}`` )で囲まれたテキストと名前で構成され、処理対象の本の対応する書誌データに置き換えられます。例えば、本をデバイスに保存するために使用されるcalibreのデフォルトテンプレートには、4つの ``テンプレート式`` があります::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:23 msgid "For the book \"The Foundation\" by \"Isaac Asimov\" the template will become::" msgstr "著者 \"Isaac Asimov” の タイトル \"The Foundation\" という本の場合、テンプレートは以下のようになります:" #: ../../../__w/calibre/calibre/manual/template_lang.rst:27 msgid "" "The slashes are not ``template expressions`` because they are not in between" " ``{}``. Such text is left where it appears. For example, if the template " "is::" msgstr "中括弧 ``{}`` の中に入っていませんので、スラッシュは ``テンプレート表現`` ではありません。この文字は残って表示されます。例えば、テンプレートが以下だとすると::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:31 msgid "then for \"The Foundation\" the template produces::" msgstr "本\"The Foundation\" ではテンプレートは次のように生成します::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:35 msgid "" "A ``template expression`` can access all the metadata available in calibre, " "including custom columns (columns you create yourself), by using a column's " "``lookup name``. To find the lookup name for a `column` (sometimes called " "`fields`), hover your mouse over the column header in calibre's book list. " "Lookup names for custom columns always begin with ``#``. For series type " "columns there is an additional field named ``#lookup name_index`` that is " "the series index for that book in the series. For example, if you have a " "custom series column named ``#myseries``, there will also be a column named " "``#myseries_index``. The standard series column's index is named " "``series_index``." msgstr "``テンプレート表現`` は、列の ``ルックアップ名`` を使用して、カスタム列 (自分で作成した列) を含む、calibre で使用可能なすべての書誌にアクセスできます。`列` (`フィールド` と呼ばれることもあります) のルックアップ名を見つけるには、マウスを calibre の本リストの列ヘッダに合わせます。カスタム列のルックアップ名は常に ``#`` で始まります。シリーズタイプの列の場合、シリーズ内のその本のシリーズインデックスである ``#ルックアップ名_index`` という名前の追加フィールドがあります。たとえば、``#myseries`` という名前のカスタムシリーズ列がある場合、``#myseries_index`` という名前の列もあります。標準のシリーズ列のインデックスの名前は ``series_index`` です。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:37 msgid "In addition to the standard column based fields, you also can use:" msgstr "標準の列ベースのフィールドに加えて、次のものも使用できます:" #: ../../../__w/calibre/calibre/manual/template_lang.rst:39 msgid "" "``{formats}`` - A list of formats available in the calibre library for a " "book" msgstr "``{formats}`` - calibre ライブラリで利用可能な本の形式のリスト" #: ../../../__w/calibre/calibre/manual/template_lang.rst:40 msgid "``{identifiers:select(isbn)}`` - The ISBN of the book" msgstr "``{identifiers:select(isbn)}`` - 本の ISBN" #: ../../../__w/calibre/calibre/manual/template_lang.rst:42 msgid "" "If the metadata for the field for a given book is not defined then the field" " in the template is replaced by the empty string (``''``). For example, " "consider the following template::" msgstr "特定の本のフィールドの書誌が定義されていない場合、テンプレートのフィールドは空の文字列 (``''``) に置き換えられます。たとえば、次のテンプレートについて考えてみましょう::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:46 msgid "" "If Asimov's book \"Second Foundation\" is in the series \"Foundation\" then " "the template produces::" msgstr "Asimov の本 \"Second Foundation\" がシリーズ \"Foundation\" に含まれている場合、テンプレートは次のように生成します::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:50 msgid "" "If a series has not been entered for the book then the template produces::" msgstr "本のシリーズが入力されていない場合、テンプレートは次のように生成します::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:54 msgid "" "The template processor automatically removes multiple slashes and leading or" " trailing spaces." msgstr "テンプレートプロセッサは、複数のスラッシュと先頭または末尾のスペースを自動的に削除します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:57 msgid "Advanced formatting" msgstr "高度な整形" #: ../../../__w/calibre/calibre/manual/template_lang.rst:59 msgid "" "In addition to metadata substitution, templates can conditionally include " "additional text and control how substituted data is formatted." msgstr "書誌の置換に加えて、テンプレートには条件付きで追加のテキストを含め、置換されたデータの整形方法を制御できます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:61 msgid "**Conditionally including text**" msgstr "**条件つきでテキストを含める**" #: ../../../__w/calibre/calibre/manual/template_lang.rst:63 msgid "" "Sometimes you want text to appear in the output only if a field is not " "empty. A common case is ``series`` and ``series_index`` where you want " "either nothing or the two values separated by a hyphen. calibre handles this" " case using a special ``template expression`` syntax." msgstr "フィールドが空でない場合にのみ、出力にテキストを表示したいというような場合があります。よくあるケースは ``series`` と ``series_index`` に対し、何も表示しないか、ハイフンで区切られた 2 つの値を連結して表示するかの切替です。 calibre は、特殊な ``テンプレート表現`` の構文を使用してこのケースを処理します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:65 msgid "" "For example and using the above Foundation example, assume you want the " "template to produce `Foundation - 3 - Second Foundation`. This template " "produces that output:" msgstr "たとえば、上記の Foundation の例を使用して、テンプレートで `Foundation - 3 - Second Foundation` を生成するとします。このテンプレートはその出力を生成します:" #: ../../../__w/calibre/calibre/manual/template_lang.rst:67 msgid "``{series} - {series_index} - {title}``" msgstr "``{series} - {series_index} - {title}``" #: ../../../__w/calibre/calibre/manual/template_lang.rst:69 msgid "" "However, if a book has no series the template will produce `- - the title`, " "which is probably not what you want. Generally, people want the result be " "the title without the extraneous hyphens. You can accomplish this using the " "following template syntax:" msgstr "ただし本にシリーズがない場合、テンプレートは `- - タイトル` を生成することになりますが、これはおそらくあなたが望むものではないでしょう。一般的に人々は、無意味なハイフンの無いただのタイトルとなることを望むものです。これは、次のテンプレート構文を使用すれば達成できます:" #: ../../../__w/calibre/calibre/manual/template_lang.rst:71 msgid "``{field:|prefix_text|suffix_text}``" msgstr "``{field:|prefix_text|suffix_text}``" #: ../../../__w/calibre/calibre/manual/template_lang.rst:73 msgid "" "This ``template expression`` says that if ``field`` has the value `XXXX` " "then the result will be `prefix_textXXXXXsuffix_text`. If ``field`` is empty" " (has no value) then the result will be the empty string (nothing) because " "the prefix and suffix are ignored. The prefix and suffix can contain blanks." msgstr "この ``テンプレート表現`` は ``field`` の値が `XXXX` の場合、結果は `prefix_textXXXXXsuffix_text` になることを示しています。``field`` が空 (値がない) 場合、プレフィックスとサフィックスが無視されるため、結果は空の文字列 (なし) となります。プレフィックスとサフィックスには空白を含めることができます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:75 msgid "" "**Do not use subtemplates (`{ ... }`) or functions (see below) in the prefix" " or the suffix.**" msgstr "**プレフィックスとサフィックスには、サブテンプレート ( `{ ... }` ) や関数 (下を参照) を使用しないでください。**" #: ../../../__w/calibre/calibre/manual/template_lang.rst:77 msgid "" "Using this syntax, we can solve the above no-series problem with the " "template::" msgstr "この構文を使用すると、テンプレートで上記のシリーズなしの問題を解決できます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:81 msgid "" "The hyphens will be included only if the book has a series index, which it " "has only if it has a series. Continuing the Foundation example again, the " "template will produce `Foundation - 1 - Second Foundation`." msgstr "ハイフンは、本にシリーズインデックスがある場合にのみ含まれます。シリーズインデックスはシリーズがある場合にのみ含まれます。 Foundationの例を再び続けると、テンプレートは `Foundation - 1 - Second Foundation` を生成します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:83 #: ../../../__w/calibre/calibre/manual/template_lang.rst:293 #: ../../../__w/calibre/calibre/manual/template_lang.rst:469 msgid "Notes:" msgstr "メモ:" #: ../../../__w/calibre/calibre/manual/template_lang.rst:85 msgid "" "You must include the colon after the ``lookup name`` if you are using a " "prefix or a suffix." msgstr "プレフィックスやサフィックスを使用している場合は、 ``ルックアップ名`` の後にコロンを含める必要があります。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:86 msgid "" "You must use either no or both ``|`` characters. Using one, as in ``{field:|" " - }``, is not allowed." msgstr "``|`` 文字は使用しないか、両方使用する必要があります。 ``{field:| - }`` のように片方だけ使用することは許可されていません。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:87 msgid "" "It is OK to provide no text for either the prefix or the suffix, such as in " "``{series:|| - }``. The template ``{title:||}`` is the same as ``{title}``." msgstr "プレフィックスやサフィックスにテキストを指定せず、 ``{series:|| - }`` にしてもかまいません。テンプレート ``{title:||}`` は ``{title}`` と同じです。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:89 msgid "**Formatting**" msgstr "**書式設定**" #: ../../../__w/calibre/calibre/manual/template_lang.rst:91 msgid "" "Suppose you want the ``series_index`` to be formatted as three digits with " "leading zeros. This does the trick:" msgstr "``series_index`` を先行ゼロ付きの 3 桁に整形したいとします。次のようにすればそうできます:" #: ../../../__w/calibre/calibre/manual/template_lang.rst:93 msgid "``{series_index:0>3s}`` - Three digits with leading zeros" msgstr "``{series_index:0>3s}`` - 先行ゼロ付きの 3 桁" #: ../../../__w/calibre/calibre/manual/template_lang.rst:95 msgid "For trailing zeros, use:" msgstr "後置ゼロには、次を使います:" #: ../../../__w/calibre/calibre/manual/template_lang.rst:97 msgid "``{series_index:0<3s}`` - Three digits with trailing zeros" msgstr "``{series_index:0<3s}`` - 後置ゼロ付きの 3 桁" #: ../../../__w/calibre/calibre/manual/template_lang.rst:99 msgid "" "If you use series indices with fractional values, e.g., 1.1, you might want " "the decimal points to line up. For example, you might want the indices 1 and" " 2.5 to appear as 01.00 and 02.50 so that they will sort correctly on a " "device that does lexical sorting. To do this, use:" msgstr "1.1 などの小数値のシリーズインデックスを使用する場合は、小数点の位置を揃えたい場合があります。たとえば、インデックス 1 と 2.5 を 01.00 と 02.50 として表示して、辞書順に並べ替えを行うデバイスで正しく並べ替えられるようにすることができます。これを行うには、次を使用します:" #: ../../../__w/calibre/calibre/manual/template_lang.rst:101 msgid "" "``{series_index:0>5.2f}`` - Five characters consisting of two digits with " "leading zeros, a decimal point, then 2 digits after the decimal point." msgstr "``{series_index:0>5.2f}`` - 先行ゼロ付きの 2 桁、小数点、および小数点以下 2 桁で構成される 5 文字。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:103 msgid "If you want only the first two letters of the data, use:" msgstr "データの最初の 2 文字だけが必要な場合は、次を使用します:" #: ../../../__w/calibre/calibre/manual/template_lang.rst:105 msgid "" "``{author_sort:.2}`` - Only the first two letters of the author sort name" msgstr "``{author_sort:.2}`` - 著者読みの最初の 2 文字のみ" #: ../../../__w/calibre/calibre/manual/template_lang.rst:107 msgid "" "Much of the calibre template language formatting comes from Python. For more" " details on the syntax of these advanced formatting operations see the " "`Python documentation " "`_." msgstr "calibre テンプレート言語のフォーマットの多くは Python のものです。これらの高度なフォーマット操作の構文の詳細については、 `Python documentation `_ を参照してください。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:111 msgid "Using templates to define custom columns" msgstr "テンプレートを使用してカスタム列を定義する" #: ../../../__w/calibre/calibre/manual/template_lang.rst:113 msgid "" "Templates can be used to display information that isn't in calibre metadata," " or to display metadata differently from calibre's normal format. For " "example, you might want to show the ``ISBN``, a field that calibre does not " "display. You can accomplish this creating a custom column with the type " "`Column built from other columns` (hereafter called `composite columns`) and" " providing a template to generate the displayed text. The column will " "display the result of evaluating the template. For example, to display the " "ISBN, create the column and enter ``{identifiers:select(isbn)}`` in the " "template box. To display a column containing the values of two series custom" " columns, separated by a comma, use ``{#series1:||,}{#series2}``." msgstr "テンプレートを使用すると、calibre の書誌にない情報を表示したり、calibre の通常の形式とは異なる方法で書誌を表示したりできます。たとえば、calibre が表示しないフィールドである ISBN を表示したいことがあるかもしれません。これは、`他の列から構築された列` タイプ (以降、複合列と呼びます) を使用してカスタム列を作成し、表示されるテキストを生成するためのテンプレートを提供することで実現できます。この列には、テンプレートの評価結果が表示されます。たとえば、ISBN を表示するには、列を作成し、テンプレートボックスに ``{identifiers:select(isbn)}`` と入力します。 2 つのシリーズカスタム列の値をカンマで区切って含む列を表示するには、``{#series1:||,}{#series2}`` を使用します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:115 msgid "Composite columns can use any template option, including formatting." msgstr "複合列は、書式設定を含む任意のテンプレートオプションを使用できます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:117 msgid "" "Note: You cannot edit the data displayed in a composite column. Instead you " "edit the source columns. If you edit a composite column, for example by " "double-clicking it, calibre will open the template for editing, not the " "underlying data." msgstr "注: 複合列に表示されているデータを編集することはできません。代わりに、ソース列を編集します。複合列を編集する場合、たとえばダブルクリックした場合、calibreは、基になるデータではなく、編集用のテンプレートを開きます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:121 msgid "Templates and plugboards" msgstr "テンプレートとプラグボード" #: ../../../__w/calibre/calibre/manual/template_lang.rst:123 msgid "" "Plugboards are used for changing the metadata written into books during " "send-to-device and save-to-disk operations. A plugboard permits you to " "specify a template to provide the data to write into the book's metadata. " "You can use plugboards to modify the following fields: authors, author_sort," " language, publisher, tags, title, title_sort. This feature helps people who" " want to use different metadata in books on devices to solve sorting or " "display issues." msgstr "プラグボードは、デバイスへの送信およびディスクへの保存操作中に本に書き込まれる書誌を変更するために使用されます。プラグボードを使用すると、本の書誌に書き込むデータを提供するテンプレートを指定できます。プラグボードを使用すると authors, author_sort, language, publisher, tags, title, title_sort のフィールドを変更できます。この機能は、デバイス上の本で別の書誌を使用して、並べ替えや表示の問題を解決したい人に役立ちます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:125 msgid "" "When you create a plugboard, you specify the format and device for which the" " plugboard is to be used. A special device is provided, ``save_to_disk``, " "that is used when saving formats (as opposed to sending them to a device). " "Once you have chosen the format and device, you choose the metadata fields " "to change, providing templates to supply the new values. These templates are" " `connected` to their destination fields, hence the name `plugboards`. You " "can of course use composite columns in these templates." msgstr "プラグボードを作成するときは、プラグボードを使用する形式とデバイスを指定します。形式を保存するときに使用される特別なデバイス ``save_to_disk`` が提供されます (デバイスに送信するのではありません)。形式とデバイスを選択したら、変更する書誌フィールドを選択し、新しい値を提供するためのテンプレートを提供します。これらのテンプレートは宛先フィールドに `接続` されているため、プラグボードという名前が付けられています。これらのテンプレートでは、もちろん複合列を使用できます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:127 msgid "" "Plugboards are quite flexible and can be written in Single Function Mode, " "Template Program Mode, General Program Mode, or Python Template mode." msgstr "プラグボードは非常に柔軟性が高く、単関数モード、テンプレートプログラム モード、一般プログラム モード、または Python テンプレートモードでも記述できます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:129 msgid "" "When a plugboard might apply (Content server, save to disk, or send to " "device), calibre searches the defined plugboards to choose the correct one " "for the given format and device. For example, to find the appropriate " "plugboard for an EPUB book being sent to an ANDROID device, calibre searches" " the plugboards using the following search order:" msgstr "プラグボードが適用される可能性がある場合 (コンテンツサーバ、ディスクに保存、またはデバイスに送信)、calibre は定義されたプラグボードを検索して、指定された形式とデバイスに適したプラグボードを選択します。たとえば、ANDROID デバイスに送信される EPUB ブックに適切なプラグボードを見つけるために、calibre は次の検索順でプラグボードを検索します:" #: ../../../__w/calibre/calibre/manual/template_lang.rst:133 msgid "" "a plugboard with an exact match on format and device, e.g., ``EPUB`` and " "``ANDROID``" msgstr "形式とデバイスが完全に一致するプラグボード。例: ``EPUB`` かつ ``ANDROID``" #: ../../../__w/calibre/calibre/manual/template_lang.rst:134 msgid "" "a plugboard with an exact match on format and the special ``any device`` " "choice, e.g., ``EPUB`` and ``any device``" msgstr "形式が完全に一致し、特別な ``任意のデバイス`` を選択できるプラグボード。例: ``EPUB`` かつ ``任意のデバイス``" #: ../../../__w/calibre/calibre/manual/template_lang.rst:135 msgid "" "a plugboard with the special ``any format`` choice and an exact match on " "device, e.g., ``any format`` and ``ANDROID``" msgstr "特別な ``任意のフォーマット`` を選択し、デバイス上で完全に一致するプラグボード。例: ``任意のフォーマット`` かつ ``ANDROID``" #: ../../../__w/calibre/calibre/manual/template_lang.rst:136 msgid "a plugboard with ``any format`` and ``any device``" msgstr "``任意のフォーマット`` と ``任意のデバイス`` を備えたプラグボード" #: ../../../__w/calibre/calibre/manual/template_lang.rst:138 msgid "" "The tags and authors fields have special treatment, because both of these " "fields can hold more than one item. A book can have many tags and many " "authors. When you specify that one of these two fields is to be changed, the" " template's result is examined to see if more than one item is there. For " "tags, the result is cut apart wherever calibre finds a comma. For example, " "if the template produces the value ``Thriller, Horror``, then the result " "will be two tags, ``Thriller`` and ``Horror``. There is no way to put a " "comma in the middle of a tag." msgstr "タグフィールドと著者フィールドはどちらも複数のアイテムを保持できるため、特殊な扱いとなります。本にはいくつものタグと何人もの著者を含めることができます。これら 2 つのフィールドのいずれかを変更するように指定すると、テンプレートの結果に複数の項目がないか確認されます。タグの場合、calibre はカンマを見つけるたびに結果を分割します。たとえばテンプレートが値 ``Thriller, Horror`` を生成すると、結果は2つのタグ、``Thriller`` と ``Horror`` になります。タグの途中にカンマを入れる方法はありません。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:141 msgid "" "The same thing happens for authors, but using a different character for the " "cut, a `&` (ampersand) instead of a comma. For example, if the template " "produces the value ``Blogs, Joe&Posts, Susan``, then the book will end up " "with two authors, ``Blogs, Joe`` and ``Posts, Susan``. If the template " "produces the value ``Blogs, Joe;Posts, Susan``, then the book will have one " "author with a rather strange name." msgstr "著者にも同じことが起こりますが、分割に別の文字、カンマの代わりに `&` (アンパサンド) を使用します。たとえばテンプレートが値 ``Blogs, Joe&Posts, Susan`` を生成すると、本の著者は ``Blogs, Joe`` と ``Posts, Susan`` の 2 人になります。テンプレートが ``Blogs, Joe;Posts, Susan`` という値を生成すると、その本の著者はかなり変わった名前の 1 人となります。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:143 msgid "" "Plugboards affect the metadata written into the book when it is saved to " "disk or written to the device. Plugboards do not affect the metadata used by" " ``save to disk`` and ``send to device`` to create the file names. Instead, " "file names are constructed using the templates entered on the appropriate " "preferences window." msgstr "プラグボードは、本がディスクに保存されるとき、またはデバイスに書き込まれるときに、本に書き込まれる書誌に影響を与えます。プラグボードは、ファイル名を作成するための ``ディスクに保存`` や ``デバイスに送信`` によって使われる書誌には影響しません。代わりに、ファイル名は、適切な設定ウィンドウに入力されたテンプレートを使用して作成されます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:148 msgid "Using functions in templates - Single Function Mode" msgstr "テンプレートでの関数の使用 - 単関数モード" #: ../../../__w/calibre/calibre/manual/template_lang.rst:150 msgid "" "Suppose you want to display the value of a field in upper case when that " "field is normally in title case. You can do this using `template functions`." " For example, to display the title in upper case use the ``uppercase`` " "function, as in ``{title:uppercase()}``. To display it in title case, use " "``{title:titlecase()}``." msgstr "あるフィールドが通常はタイトルケースで、その値を大文字で表示したいと仮定します。`テンプレート関数` を使用すれば、それが可能です。たとえば、タイトルを大文字で表示するには ``uppercase`` 関数を使用して、 ``{title:uppercase()}`` とします。タイトルケースで表示するには ``{title:titlecase()}`` を使用します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:152 msgid "" "Functions go into the format part of the template, after the ``:`` and " "before the first ``|`` or the closing ``}`` if no prefix/suffix is used. If " "you have both a format and a function reference, the function comes after a " "second ``:``. Functions return the value of the column specified in the " "template, suitably modified." msgstr "関数は、テンプレートのフォーマット部分に入ります。それは ``:`` の後、かつ最初の ``|`` またはプレフィックス/サフィックスが使われていれば閉じ括弧 ``}`` の前です。フォーマットと関数参照の両方がある場合、関数は 2 個目の ``:`` の後に来ます。関数は、テンプレートで指定された列の値を適切に変更して返します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:154 msgid "The syntax for using functions is one of::" msgstr "関数を使用するための構文は、次のいずれかです::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:161 msgid "" "Function names must always be followed by opening and closing parentheses. " "Some functions require extra values (arguments), and these go inside the " "parentheses. Arguments are separated by commas. Literal commas (commas as " "text, not argument separators) must be preceded by a backslash (``\\``) . " "The last (or only) argument cannot contain a textual closing parenthesis." msgstr "関数名の後には、必ず開き括弧と閉じ括弧を付ける必要があります。一部の関数は追加の値 (引数) を必要とし、これらは括弧内に入ります。引数はカンマで区切ります。リテラルコンマ (引数の区切り文字ではなくテキストとしてのカンマ) の前には、バックスラッシュ (``\\``) を付ける必要があります。最後の (または唯一の) 引数には、テキストの閉じ括弧を含めることはできません。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:163 msgid "" "Functions are evaluated before format specifications and the prefix/suffix. " "See further down for an example of using both a format and a function." msgstr "関数は、フォーマット指定とプレフィックス/サフィックスの前に評価されます。フォーマットと関数の両方を使用する例については、さらに下を参照してください。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:165 msgid "" "**Important**: If you have programming experience, please note that the " "syntax in `Single Function Mode` is not what you expect. Strings are not " "quoted and spaces are significant. All arguments are considered to be " "constants; there are no expressions." msgstr "**重要**: プログラミングの経験がある場合は、`単関数モード` の構文が思ったものと違うことに注意してください。文字列は引用符で囲まれておらず、スペースは重要です。すべての引数は定数と見なされます。式はありません。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:167 msgid "" "**Do not use subtemplates (`{ ... }`) as function arguments.** Instead, use " ":ref:`Template Program Mode ` and :ref:`General Program Mode " "`." msgstr "**サブテンプレート ( `{ ... }` ) を関数の引数として使用しないでください。** 代わりに :ref:`テンプレートプログラムモード ` および :ref:`一般プログラムモード ` を使用してください。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:169 msgid "Notes on calling functions in Single Function Mode:" msgstr "単関数モードでの関数の呼び出しに関する注意:" #: ../../../__w/calibre/calibre/manual/template_lang.rst:171 msgid "" "When functions are used in Single Function Mode, the first parameter, " "``value``, is automatically replaced by the content of the field specified " "in the template. For example, when the template ``{title:capitalize()}`` is " "processed, the content of the ``title`` field is passed as the parameter " "``value`` to the capitalize function." msgstr "関数を単関数モードで使用する場合、最初のパラメータである ``value`` は、テンプレートで指定されたフィールドの内容に自動的に置き換えられます。例えば、テンプレート ``{title:capitalize()}`` が処理される場合、 ``title`` フィールドの内容がパラメータ ``value`` としてcapitalize関数に渡されます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:172 msgid "" "In the function documentation, the notation ``[something]*`` means that " "``something`` can be repeated zero or more times. The notation " "``[something]+`` means that the ``something`` is repeated one or more times " "(must exist at least one time)." msgstr "関数ドキュメントにおいて、 ``[something]*`` という表記は、 ``something`` が0回以上繰り返されることを意味します。 ``[something]+`` という表記は、 ``something`` が1回以上繰り返されること(少なくとも1回は存在する必要があること)を意味します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:173 msgid "" "Some functions use regular expressions. In the template language regular " "expression matching is case-insensitive." msgstr "一部の関数は正規表現を使用します。テンプレート言語における正規表現の一致判定では、大文字と小文字を区別しません。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:175 msgid "" "Functions are documented in :ref:`template_functions_reference`. The " "documentation tells you what arguments the functions require and what the " "functions do. For example, here is the documentation of the " ":ref:`ff_ifempty` function." msgstr "関数については、 :ref:`template_functions_reference` に記載されています。このドキュメントには、各関数が必要とする引数と、その関数の機能が説明されています。例えば、以下は :ref:`ff_ifempty` 関数のドキュメントです。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:179 msgid "" "You see that the function requires two arguments, ``value`` and " "``text_if_empty``. However, because we are using Single Function Mode, we " "omit the ``value`` argument, passing only ``text_if_empty``. For example, " "this template::" msgstr "この関数には ``value`` と ``text_if_empty`` という2つの引数が必要です。ただし、今回は単関数モードを使用しているため、``value`` 引数を省略し、``text_if_empty`` のみを渡します。例えば、このテンプレートは次のようになります:" #: ../../../__w/calibre/calibre/manual/template_lang.rst:183 msgid "" "shows the tags for a book, if any. If it has no tags then it shows `No tags " "on this book`." msgstr "本にタグがある場合は表示します。タグがない場合は、 `この本にはタグがありません` と表示されます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:185 msgid "" "The following functions are usable in Single Function Mode because their " "first parameter is ``value``." msgstr "以下の関数は、最初のパラメータが ``value`` であるため、単関数モードで使用可能です。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:227 msgid "**Using functions and formatting in the same template**" msgstr "**同じテンプレートで関数と書式を使用する**" #: ../../../__w/calibre/calibre/manual/template_lang.rst:229 msgid "" "Suppose you have an integer custom column ``#myint`` that you want displayed" " with leading zeros, as in ``003``. One way to do this is to use a format of" " ``0>3s``. However, by default if a number (integer or float) equals zero " "then the value is displayed as the empty string so zero values will produce " "the empty string, not ``000``. If you want to see ``000`` values then you " "use both the format string and the ``ifempty`` function to change the empty " "value back to a zero. The template would be::" msgstr "整数のカスタム列 ``#myint`` を ``003`` のように先行ゼロ付きで表示したいと仮定します。これを実現する方法のひとつは ``0>3s`` という書式を使用することです。ただしデフォルトでは数値 (整数または浮動小数点) がゼロに等しい場合には、その値は空の文字列として表示されるため、値ゼロは ``000`` ではなく空の文字列となります。値を ``000`` と表示したいのであれば、書式文字列と ``ifempty`` 関数を両方使用して空の値をゼロに戻してやります。そのテンプレートは次のようになるでしょう::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:233 msgid "" "Note that you can use the prefix and suffix as well. If you want the number " "to appear as ``[003]`` or ``[000]``, then use the template::" msgstr "プレフィックスとサフィックスも使用できます。もし数字を ``[003]`` や ``[000]`` のように表示したいのであれば、次のテンプレートを使用します::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:240 msgid "General Program Mode" msgstr "一般プログラムモード" #: ../../../__w/calibre/calibre/manual/template_lang.rst:242 msgid "" "`General Program Mode` (`GPM`) replaces `template expressions` with a " "program written in the `template language`. The syntax of the language is " "defined by the following grammar::" msgstr "`一般プログラムモード` (`GPM`) は `テンプレート表現` を `テンプレート言語` で記述したプログラムに置き換えます。言語の構文は、次の文法で定義されます::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:295 msgid "" "a ``top_expression`` always has a value. The value of an ``expression_list``" " is the value of the last ``top_expression`` in the list. For example, the " "value of the expression list ``1;2;'foobar';3`` is ``3``." msgstr "``top_expression`` には常に値があります。``expression_list`` の値は、リストの最後の ``top_expression`` の値です。たとえば、式リストの値 ``1;2;'foobar';3`` は ``3`` です。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:296 msgid "In a logical context, any non-empty value is ``True``" msgstr "論理的なコンテキストでは、空でない値はすべて ``True``" #: ../../../__w/calibre/calibre/manual/template_lang.rst:297 msgid "In a logical context, the empty value is ``False``" msgstr "論理的なコンテキストでは、空の値はすべて ``False``" #: ../../../__w/calibre/calibre/manual/template_lang.rst:298 msgid "" "Strings and numbers can be used interchangeably. For example, ``10`` and " "``'10'`` are the same thing." msgstr "文字列と数字は同じ意味で使用できます。たとえば ``10`` と ``'10'`` は同じものです。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:299 msgid "" "Comments are lines starting with a '#' character, possibly preceded by " "blanks or tabs." msgstr "コメントは、 '#' 文字で始まる複数行で、その前に空白またはタブが入っていても構いません。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:301 msgid "**Operator precedence**" msgstr "**演算子の優先順位**" #: ../../../__w/calibre/calibre/manual/template_lang.rst:303 msgid "" "The operator precedence (order of evaluation) from highest (evaluated first)" " to lowest (evaluated last) is:" msgstr "演算子の優先順位 (評価する順) の最高 (最初に評価) から最低 (最後に評価) までは、次のとおりです:" #: ../../../__w/calibre/calibre/manual/template_lang.rst:305 msgid "" "Function calls, constants, parenthesized expressions, statement expressions," " assignment expressions, field references." msgstr "関数呼び出し、定数、括弧で囲まれた式、比較演算式、代入式、フィールド参照。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:306 msgid "" "Unary plus (``+``) and minus (``-``). These operators evaluate right to " "left." msgstr "単項プラス (``+``) およびマイナス (``-``)。これらの演算子は右から左に評価します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:308 msgid "" "These and all the other arithmetic operators return integers if the " "expression results in a fractional part equal to zero. For example, if an " "expression returns ``3.0`` it is changed to ``3``." msgstr "これらおよび他のすべての算術演算子は、式の小数部がゼロならば整数を返します。たとえば式が ``3.0`` を返す場合、それは ``3`` に変更されます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:309 msgid "" "Multiply (``*``) and divide (``/``). These operators are associative and " "evaluate left to right. Use parentheses if you want to change the order of " "evaluation." msgstr "乗算 (``*``) と除算 (``/``)。これらの演算子は結合性があり、左から右に評価します。評価の順序を変更する場合は、括弧を使用してください。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:310 msgid "" "Add (``+``) and subtract (``-``). These operators are associative and " "evaluate left to right." msgstr "加算 (``+``) と減算 (``-``)。これらの演算子は結合性があり、左から右に評価します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:311 msgid "" "Numeric and string comparisons. These operators return ``'1'`` if the " "comparison succeeds, otherwise the empty string (``''``). Comparisons are " "not associative: ``a < b < c`` is a syntax error." msgstr "数値と文字列の比較。これらの演算子は、比較が成功した場合は ``'1'`` を返し、それ以外の場合は空の文字列 (``''``)を返します。比較は結合的ではありません。 ``a < b < c`` は構文エラーです。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:312 msgid "" "String concatenation (``&``). The ``&`` operator returns a string formed by " "concatenating the left-hand and right-hand expressions. Example: ``'aaa' & " "'bbb'`` returns ``'aaabbb'``. The operator is associative and evaluates left" " to right." msgstr "文字列の連結 (``&``)。``&`` 演算子は、左辺と右辺の式を連結して形成された文字列を返します。例: ``'aaa' & 'bbb'`` は ``'aaabbb'`` を返します。演算子は結合性があり、左から右に評価します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:313 msgid "" "Unary logical not (``!``). This operator returns ``'1'`` if the expression " "is False (evaluates to the empty string), otherwise ``''``." msgstr "単項論理否定 (``!``)。この演算子は、式が False (空の文字列に評価される) なら ``'1'`` を返し、そうでなければ ``''`` を返します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:314 msgid "" "Logical and (``&&``). This operator returns '1' if both the left-hand and " "right-hand expressions are True, or the empty string ``''`` if either is " "False. It is associative, evaluates left to right, and does `short-" "circuiting `_." msgstr "論理積 (``&&``)。この演算子は、左辺と右辺の両方の式が True のときに '1' を返し、どちらかが False なら空の文字列 ``''`` を返します。これは結合的で、左から右に評価し、 `短絡評価 `_ を行います。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:315 msgid "" "Logical or (``||``). This operator returns ``'1'`` if either the left-hand " "or right-hand expression is True, or ``''`` if both are False. It is " "associative, evaluates left to right, and does `short-circuiting " "`_. It is an " "`inclusive or`, returning ``'1'`` if both the left- and right-hand " "expressions are True." msgstr "論理和 (``||``)。この演算子は、左辺または右辺の式のいずれかが True であれば ``'1'`` を返し、両方とも False なら ``''`` を返します。これは結合的で、左から右に評価し、 `短絡評価 `_ を行います。 これは `包含的論理和` で、左辺または右辺の式の両方が True のときに ``'1'`` を返します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:317 msgid "**Field references**" msgstr "**フィールド参照**" #: ../../../__w/calibre/calibre/manual/template_lang.rst:319 msgid "" "A ``field_reference`` evaluates to the value of the metadata field named by " "lookup name that follows the ``$`` or ``$$``. Using ``$`` is equivalent to " "using the :ref:`ff_field` function. Using ``$$`` is equivalent to using the " ":ref:`ff_raw_field` function. Examples::" msgstr "``field_reference`` は、 ``$`` または ``$$`` に続くルックアップ名で指定された書誌データフィールドの値を評価します。 ``$`` を使用することは、 :ref:`ff_field` 関数を使用することと同等です。 ``$$`` を使用することは、 :ref:`ff_raw_field` 関数を使用することと同等です。例:" #: ../../../__w/calibre/calibre/manual/template_lang.rst:326 msgid "**If expressions**" msgstr "**if 文**" #: ../../../__w/calibre/calibre/manual/template_lang.rst:328 msgid "" "``If`` expressions first evaluate the ``condition``. If the ``condition`` is" " True (a non-empty value) then the ``expression_list`` in the ``then`` " "clause is evaluated. If it is False then if present the ``expression_list`` " "in the ``elif`` or ``else`` clause is evaluated. The ``elif`` and ``else`` " "parts are optional. The words ``if``, ``then``, ``elif``, ``else``, and " "``fi`` are reserved; you cannot use them as identifier names. You can put " "newlines and white space wherever they make sense. The ``condition`` is a " "``top_expression`` not an ``expression_list``; semicolons are not allowed. " "The ``expression_lists`` are semicolon-separated sequences of " "``top_expressions``. An ``if`` expression returns the result of the last " "``top_expression`` in the evaluated ``expression_list``, or the empty string" " if no expression list was evaluated." msgstr "``If`` 文は最初に ``condition`` を評価します。``condition`` が True (空でない値) であれば、``then`` 句の中にある ``expression_list`` が評価されます。False なら ``elif`` または ``else`` 句の中に ``expression_list`` があればそれが評価されます。``elif`` と ``else`` の部分はオプションです。``if``, ``then``, ``elif``, ``else``, および ``fi`` は予約語です。識別子の名前として使用することはできません。 意味のあるところならどこにでも改行と空白を置くことができます。``condition`` は ``top_expression`` であって ``expression_list`` ではありません。セミコロンは使用できません。``expression_lists`` は ``top_expressions`` のセミコロン区切りのシーケンスです。``if`` 文は評価した ``expression_list`` の中で最後の ``top_expression`` を返し、評価したものがなければ空の文字列を返します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:330 msgid "Examples::" msgstr "例::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:343 msgid "Nested ``if`` example::" msgstr "入れ子になった ``if`` の例::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:356 msgid "" "As said above, an ``if`` produces a value. This means that all the following" " are equivalent::" msgstr "上で説明したように ``if`` は値を生成します。これは、次のすべてが同等であることを意味します::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:362 msgid "" "For example, this program returns the value of the ``series`` column if the " "book has a series, otherwise the value of the ``title`` column::" msgstr "たとえば、このプログラムは、本にシリーズがある場合は ``series`` 列の値を返し、そうでない場合は ``title`` 列の値を返します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:366 msgid "**For expressions**" msgstr "**for 文**" #: ../../../__w/calibre/calibre/manual/template_lang.rst:368 msgid "" "The ``for`` expression iterates over a list of values, processing them one " "at a time. The ``list_expression`` must evaluate either to a metadata field " "``lookup name`` e.g., ``tags`` or ``#genre``, or to a list of values. The " ":ref:`ff_range` generates a list of numbers. If the result is a valid " "``lookup name`` then the field's value is fetched and the separator " "specified for that field type is used. If the result isn't a valid lookup " "name then it is assumed to be a list of values. The list is assumed to be " "separated by commas unless the optional keyword ``separator`` is supplied, " "in which case the list values must be separated by the result of evaluating " "the ``separator_expr``. A separator cannot be used if the list is generated " "by ``range()``. Each value in the list is assigned to the specified variable" " then the ``expression_list`` is evaluated. You can use ``break`` to jump " "out of the loop, and ``continue`` to jump to the beginning of the loop for " "the next iteration." msgstr "``for`` 式は値のリストを順番に繰り返し、値を1個づつ処理します。 ``list_expression`` は、書誌データフィールドの「ルックアップ名」(例: ``tags`` や ``#genre`` )または値のリストのいずれかを評価する必要があります。 :ref:`ff_range` は数値のリストを生成します。結果が有効な ``ルックアップ名`` である場合、そのフィールドの値が取得され、そのフィールドタイプに指定された区切り文字が使用されます。結果が有効なルックアップ名でない場合は、値のリストとみなされます。リストは、オプションのキーワード ``separator`` が指定されていない限り、カンマで区切られているとみなされます。指定されている場合は、 ``separator_expr`` を評価した結果でリストの値が区切られている必要があります。 ``range()`` によって生成されたリストには、区切り文字を使用できません。リスト内の各値は指定された変数に代入され、その後 ``expression_list`` が評価されます。 ``break`` を使用してループから抜け出すことができ、 ``continue`` を使用して次の反復処理のためにループの先頭に戻ることができます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:370 msgid "" "Example: This template removes the first hierarchical name for each value in" " Genre (``#genre``), constructing a list with the new names::" msgstr "例: このテンプレートは、ジャンル (``#genre``) の各値の最初の階層名を削除し、新しい名前でリストを作成します::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:380 msgid "" "If the original Genre is `History.Military, Science Fiction.Alternate " "History, ReadMe` then the template returns `Military, Alternate History, " "ReadMe`. You could use this template in calibre's :guilabel:`Edit metadata " "in bulk -> Search & replace` with :guilabel:`Search for` set to ``template``" " to strip off the first level of the hierarchy and assign the resulting " "value to Genre." msgstr "元のジャンルが `History.Military, Science Fiction.Alternate History, ReadMe` の場合、テンプレートは `Military, Alternate History, ReadMe` を返します。このテンプレートを calibre の :guilabel:`書誌を一括編集 -> 検索と置換` で :guilabel:`検索` に ``template`` を設定して階層の最初のレベルを取り除き、結果の値をジャンルに割り当てます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:383 msgid "" "Note: the last line in the template, ``new_tags``, isn't strictly necessary " "in this case because ``for`` returns the value of the last top_expression in" " the expression list. The value of an assignment is the value of its " "expression, so the value of the ``for`` statement is what was assigned to " "``new_tags``." msgstr "注: この場合、テンプレートの最後の行である ``new_tags`` は必ずしも必要ではありません。これは、``for`` が式リストの最後の top_expression の値を返すためです。割り当ての値はその式の値であるため、``for`` 文の値は ``new_tags`` に割り当てられたものです。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:385 msgid "**with expressions**" msgstr "**with式**" #: ../../../__w/calibre/calibre/manual/template_lang.rst:387 msgid "The ``with`` expression:" msgstr "``with`` 式:" #: ../../../__w/calibre/calibre/manual/template_lang.rst:389 msgid "" "changes the current book to the book with calibre book id (an integer) " "produced by evaluating the ``top_expression``." msgstr "現在の本を ``top_expression`` を評価することによって生成された calibre ブックID (整数) を持つ本に変更します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:390 msgid "runs the ``expression_list``." msgstr "``expression_list`` を実行" #: ../../../__w/calibre/calibre/manual/template_lang.rst:391 msgid "then resets the current book back to what it was." msgstr "その後、カレントの本を元に戻します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:393 msgid "" "The ``with`` expression returns the result of the last ``top_expression`` in" " the evaluated ``expression_list``, or the empty string if no expression " "list was evaluated." msgstr "``with`` 式は、評価された ``expression_list`` 内の最後の ``top_expression`` の結果を返します。式リストが評価されなかった場合は空の文字列を返します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:396 msgid "" "For example, this template returns a list of the titles of each book " "selected in the GUI::" msgstr "たとえば、このテンプレートは GUI で選択された複数の本のタイトルのリストを返します:" #: ../../../__w/calibre/calibre/manual/template_lang.rst:408 msgid "**Return stmt**" msgstr "**Return 文**" #: ../../../__w/calibre/calibre/manual/template_lang.rst:410 msgid "" "Return the value of the ``expression``. If executed in a function then it " "returns the value of the expression to the caller. If executed in the " "outermost context (the template) then it sets the value of the template to " "the value of the expression and exits the template." msgstr "``式`` の値を返します。関数内で実行された場合は、式の値を呼び出し元に返します。最上位のコンテキスト(テンプレート)で実行された場合は、テンプレートの値が式の値に設定され、テンプレートの実行が終了します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:412 msgid "**Function definition**" msgstr "**関数の定義**" #: ../../../__w/calibre/calibre/manual/template_lang.rst:414 msgid "" "If you have repeated code in a template then you can put that code into a " "local function. The ``def`` keyword starts the definition. It is followed by" " the function name, the argument list, then the code in the function. The " "function definition ends with the ``fed`` keyword." msgstr "テンプレート内に繰り返し出現するコードを、ローカル関数にまとめることもできます。関数の定義は ``def`` キーワードで始まり、その後に関数名、引数リスト、そして関数内のコードが続きます。関数の定義は ``fed`` キーワードで終了します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:416 msgid "" "Arguments are positional. When a function is called the supplied arguments " "are matched left to right against the defined parameters, with the value of " "the argument assigned to the parameter. It is an error to provide more " "arguments than defined parameters. Parameters can have default values, such " "as ``a = 25``. If an argument is not supplied for that parameter then the " "default value is used, otherwise the parameter is set to the empty string." msgstr "引数はキーワード引数です。関数が呼び出されると、指定された引数が定義されたパラメータに対して左から右に照合され、引数の値がパラメータに割り当てられます。定義されたパラメータよりも多くの引数を指定するとエラーになります。パラメータには、``a = 25`` などのデフォルト値を設定できます。そのパラメータに引数が指定されていない場合はデフォルト値が使用され、それ以外の場合はパラメータが空の文字列に設定されます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:418 msgid "The ``return`` statement can be used in a local function." msgstr "``return`` 文はローカル関数の中で使用できます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:420 msgid "A function must be defined before it can be used." msgstr "関数は、使用する前に定義する必要があります。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:422 msgid "" "Example: This template computes an approximate duration in years, months, " "and days from a number of days. The function ``to_plural()`` formats the " "computed values. Note that the example also uses the ``&`` operator::" msgstr "例: このテンプレートは、日数から年、月、日でおおよその期間を計算します。関数 `to_plural()`` は、計算された値を整形します。ただしこの例では ``&`` 演算子も使用しています::eo" #: ../../../__w/calibre/calibre/manual/template_lang.rst:437 msgid "**Relational operators**" msgstr "**関係演算子**" #: ../../../__w/calibre/calibre/manual/template_lang.rst:439 msgid "" "Relational operators return ``'1'`` if the comparison is true, otherwise the" " empty string (``''``)." msgstr "関係演算子は、比較が真の場合は ``'1'`` を返し、それ以外の場合は空文字列( ``''`` )を返します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:441 msgid "" "There are two forms of relational operators: string comparisons and numeric " "comparisons." msgstr "関係演算子は 2 種類あり、それは文字列比較と数値比較です。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:443 msgid "" "String comparisons do case-insensitive string comparison using lexical " "order. The supported string comparison operators are ``==``, ``!=``, ``<``, " "``<=``, ``>``, ``>=``, ``in``, ``inlist``, and ``inlist_field``. For the " "``in``, ``inlist``, and ``inlist_field`` operators, the result of the left " "hand expression is interpreted as a regular expression pattern. They are " "true if the value of left-hand regular expression matches the value of the " "right hand expression. The regular expressions are case-insensitive." msgstr "文字列比較は、辞書順に基づいた大文字小文字を区別しない比較を行います。サポートされている文字列比較演算子は、 ``==`` 、 ``!=`` 、 ``<`` 、 ``<=`` 、 ``>`` 、 ``>=`` 、 ``in`` 、 ``inlist`` 、および ``inlist_field`` です。 ``in`` 、 ``inlist`` 、および ``inlist_field`` 演算子の場合、左辺の式の評価結果は正規表現パターンとして解釈されます。これらの演算子は、左辺の正規表現が右辺の値に一致する場合に真となります。正規表現は、大文字小文字を区別しません。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:446 msgid "" "The ``inlist`` operator is true if the left hand regular expression matches " "any one of the items in the right hand list where the items in the list are " "separated by commas. The ``inlist_field`` operator is true if the left hand " "regular expression matches any of the items in the field (column) named by " "the right hand expression, using the separator defined for the field. NB: " "the ``inlist_field`` operator requires the right hand expression to evaluate" " to a field name, while the ``inlist`` operator requires the right hand " "expression to evaluate to a string containing a comma-separated list. " "Because of this difference, ``inlist_field`` is substantially faster than " "``inlist`` because no string conversions or list constructions are done." msgstr "``inlist`` 演算子は、左側の正規表現が右側のカンマ区切りリスト内のいずれかの項目に一致する場合に真となります。 ``inlist_field`` 演算子は、左側の正規表現が右側の式で指定されたフィールド(列)内のいずれかの項目に一致する場合に真となります。この場合、フィールドに定義された区切り文字が使用されます。注: ``inlist_field`` 演算子は、右側の式がフィールド名に評価されることを必要としますが、 ``inlist`` 演算子は、右側の式がカンマ区切りリストを含む文字列に評価されることを必要とします。この違いにより、 ``inlist_field`` は文字列変換やリスト構築が行われないため、``inlist`` よりも大幅に高速です。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:448 msgid "" "The numeric comparison operators are ``==#``, ``!=#``, ``<#``, ``<=#``, " "``>#``, ``>=#``. The left and right expressions must evaluate to numeric " "values with two exceptions: both the string value \"None\" (undefined field)" " and the empty string evaluate to the value zero." msgstr "数値比較演算子は、``==#``, ``!=#``, ``<#``, ``<=#``, ``>#``, ``>=#`` です。左と右の式は、2 つの例外を除いて数値に評価される必要があります。文字列値 \"None\" (未定義のフィールド) と空の文字列の両方が値ゼロに評価されます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:450 msgid "Examples:" msgstr "例:" #: ../../../__w/calibre/calibre/manual/template_lang.rst:452 msgid "" "``program: field('series') == 'foo'`` returns ``'1'`` if the book's series " "is `foo`, otherwise ``''``." msgstr "``program: field('series') == 'foo'`` は、本のシリーズが `foo` であれば ``'1'`` を返し、そうでなければ ``''`` を返します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:453 msgid "" "``program: 'f.o' in field('series')`` returns ``'1'`` if the book's series " "matches the regular expression ``f.o`` (e.g., `foo`, `Off Onyx`, etc.), " "otherwise ``''``." msgstr "``program: 'f.o' in field('series')`` は、本のシリーズが正規表現 ``f.o`` (例: `foo`, `Off Onyx`, など) とマッチすれば ``'1'`` を返し、そうでなければ ``''`` を返します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:454 msgid "" "``program: 'science' inlist $#genre`` returns ``'1'`` if any of the values " "retrieved from the book's genres match the regular expression ``science``, " "e.g., `Science`, `History of Science`, `Science Fiction` etc., otherwise " "``''``." msgstr "``program: 'science' inlist $#genre`` は、本のジャンルから取得された値のいずれかが正規表現  ``science`` に一致する場合(例: `Science` 、 `History of Science` 、 `Science Fiction` など)は ``1`` を返し、そうでない場合は ``''`` を返します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:455 msgid "" "``program: '^science$' inlist $#genre`` returns ``'1'`` if any of the book's" " genres exactly match the regular expression ``^science$``, e.g., `Science`," " otherwise ``''``. The genres `History of Science` and `Science Fiction` " "don't match." msgstr "``program: '^science$' inlist $#genre`` は、本のジャンルのいずれかが正規表現 `^science$` に完全に一致する場合(例: `Science` )は ``'1'`` を返し、そうでない場合は ``''`` を返します。 ジャンルが `History of Science` や `Science Fiction` は一致しません。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:456 msgid "" "``program: 'asimov' inlist $authors`` returns ``'1'`` if any author matches " "the regular expression ``asimov``, e.g., `Asimov, Isaac` or `Isaac Asimov`, " "otherwise ``''``." msgstr "``program: 'asimov' inlist $authors`` は、いずれかの著者が正規表現 `asimov` に一致する場合(例: `Asimov, Isaac` や `Isaac Asimov` )、``'1'`` を返し、そうでない場合は ``''`` を返します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:457 msgid "" "``program: 'asimov' inlist_field 'authors'`` returns ``'1'`` if any author " "matches the regular expression ``asimov``, e.g., `Asimov, Isaac` or `Isaac " "Asimov`, otherwise ``''``." msgstr "``program: 'asimov' inlist_field 'authors'`` は、いずれかの著者が正規表現 ``asimov`` に一致する場合(例:`Asimov, Isaac` や `Isaac Asimov` )、``'1'`` を返し、そうでない場合は ``''`` を返します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:458 msgid "" "``program: 'asimov$' inlist_field 'authors'`` returns ``'1'`` if any author " "matches the regular expression ``asimov$``, e.g., `Isaac Asimov`, otherwise " "``''``. It doesn't match `Asimov, Isaac` because of the ``$`` anchor in the " "regular expression." msgstr "``program: 'asimov$' inlist_field 'authors'`` は、いずれかの著者が正規表現 ``asimov$`` に一致する場合(例: `Isaac Asimov` )は ``'1'`` を返し、そうでない場合は ``''`` を返します。正規表現に ``$`` アンカーが含まれているため、`Asimov, Isaac` には一致しません。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:459 msgid "" "``program: if field('series') != 'foo' then 'bar' else 'mumble' fi`` returns" " ``'bar'`` if the book's series is not `foo`. Otherwise it returns " "``'mumble'``." msgstr "``program: if field('series') != 'foo' then 'bar' else 'mumble' fi`` は 本のシリーズが `foo` と等しくない場合は ``'bar'`` を返し、そうでない場合は ``'mumble'`` を返します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:460 msgid "" "``program: if field('series') == 'foo' || field('series') == '1632' then " "'yes' else 'no' fi`` returns ``'yes'`` if series is either `foo` or `1632`, " "otherwise ``'no'``." msgstr "``program: if field('series') == 'foo' || field('series') == '1632' then 'yes' else 'no' fi`` は 本のシリーズが `foo` か、`1632` と等しい場合は ``'yes'`` を返し、そうでない場合は ``'no'`` を返します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:461 msgid "" "``program: if '^(foo|1632)$' in field('series') then 'yes' else 'no' fi`` " "returns ``'yes'`` if series is either `foo` or `1632`, otherwise ``'no'``." msgstr "``program: if '^(foo|1632)$' in field('series') then 'yes' else 'no' fi`` は 本のシリーズが `foo` か、`1632` と等しい場合は ``'yes'`` を返し、そうでない場合は ``'no'`` を返します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:462 msgid "" "``program: if 11 > 2 then 'yes' else 'no' fi`` returns ``'no'`` because the " "``>`` operator does a lexical comparison." msgstr "``program: if 11 > 2 then 'yes' else 'no' fi`` は ``'no'`` を返します。なぜなら ``>`` 演算子が辞書比較を行うからです。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:463 msgid "" "``program: if 11 ># 2 then 'yes' else 'no' fi`` returns ``'yes'`` because " "the ``>#`` operator does a numeric comparison." msgstr "``program: if 11 ># 2 then 'yes' else 'no' fi`` は ``'yes'`` を返します。なぜなら ``>#`` 演算子は数値比較を行うからです。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:465 msgid "**Functions in General Program Mode**" msgstr "**一般プログラムモードの関数**" #: ../../../__w/calibre/calibre/manual/template_lang.rst:467 msgid "" "See :ref:`template_functions_reference` for the list of functions built into" " the template language." msgstr "テンプレート言語に組み込まれている関数の一覧については、:ref:`template_functions_reference` を参照してください。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:471 msgid "" "As opposed to :ref:`Single Function Mode `, in General Program " "Mode you must specify the first parameter ``value``." msgstr "単関数モードとは異なり、一般プログラムモードでは、最初のパラメータである ``value`` を指定する必要があります。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:472 msgid "All parameters are expression_lists (see the grammar above)." msgstr "すべてのパラメータは式リストです(上記の文法を参照)。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:477 msgid "More complex programs in template expressions - Template Program Mode" msgstr "より複雑なテンプレート表現のプログラム - テンプレートプログラムモード" #: ../../../__w/calibre/calibre/manual/template_lang.rst:479 msgid "" "`Template Program Mode` (`TPM`) is a blend of :ref:`General Program Mode " "` and :ref:`Single Function Mode `. `TPM` differs" " from Single Function Mode in that it permits writing template expressions " "that refer to other metadata fields, use nested functions, modify variables," " and do arithmetic. It differs from `General Program Mode` in that the " "template is contained between ``{`` and ``}`` characters and doesn't begin " "with the word ``program:``. The program portion of the template is a General" " Program Mode expression list." msgstr "`テンプレートプログラムモード` (`TPM`) は、 :ref:`一般プログラムモード ` and :ref:`単関数モード ` を組み合わせたものです。 `TPM` は、他の書誌フィールドを参照し、ネストされた関数を使用し、変数を変更し、算術演算を実行するテンプレート式を記述できるという点で、単関数モードとは異なります。このテンプレートが ``{`` と ``}`` 文字の間に置かれ、``program:`` という部分で始まらないという点で、`一般プログラムモード` とは異なります。テンプレートのプログラム部分は、一般プログラムモードの式リストです。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:482 msgid "" "Example: assume you want a template to show the series for a book if it has " "one, otherwise show the value of a custom field #genre. You cannot do this " "in the :ref:`Single Function Mode ` because you cannot make " "reference to another metadata field within a template expression. In `TPM` " "you can, as the following expression demonstrates::" msgstr "例: テンプレートで、ある本がシリーズものならシリーズを表示し、そうでなければカスタムフィールド #genre の値を表示したいと仮定します。:ref:`単関数モード ` ではテンプレートの式の中からは別の書誌フィールドを参照できないため、この処理は実現できません。 `TPM` でなら可能です。次の式のようにします::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:487 msgid "The example shows several things:" msgstr "例からはいくつかのことがわかります:" #: ../../../__w/calibre/calibre/manual/template_lang.rst:489 msgid "" "`TPM` is used if the expression begins with ``:'`` and ends with ``'}``. " "Anything else is assumed to be in :ref:`Single Function Mode `." msgstr "式が ``:'`` で始まり ``'}`` で終わる場合は `TPM` が使用されます。それ以外の場合は、:ref:`単関数モード`であるとみなされます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:491 msgid "" "If the template contains a prefix and suffix, the expression ends with " "``'|`` where the ``|`` is the delimiter for the prefix. Example::" msgstr "テンプレートにプレフィックスとサフィックスが含まれている場合、式は ``'|`` で終わります。ここで ``|`` はプレフィックスの区切り文字です。例::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:495 msgid "" "Functions must be given all their arguments. For example, the standard " "built-in functions must be given the initial parameter ``value``." msgstr "関数にはすべての引数を指定する必要があります。例えば、標準の組み込み関数には、最初のパラメータである ``value`` を指定する必要があります。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:496 msgid "" "The variable ``$`` is usable as the ``value`` argument and stands for the " "value of the field named in the template, ``series`` in this case." msgstr "変数 ``$`` は ``value`` 引数として使用され、テンプレートで指定されたフィールド(この場合は ``series`` )の値を示します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:497 msgid "white space is ignored and can be used anywhere within the expression." msgstr "空白は無視され、式の中のどこでも使用できます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:498 msgid "" "constant strings are enclosed in matching quotes, either ``'`` or ``\"``." msgstr "定数文字列は対になる引用符、``'`` または ``\"`` のいずれかで囲まれます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:500 msgid "" "In `TPM`, using ``{`` and ``}`` characters in string literals can lead to " "errors or unexpected results because they confuse the template processor. It" " tries to treat them as template expression boundaries, not characters. In " "some but not all cases you can replace a ``{`` with ``[[`` and a ``}`` with " "`]]`. Advice: if your program contains ``{`` and ``}`` characters then you " "should use `General Program Mode`." msgstr "`TPM` では、文字列リテラル内で ``{`` と ``}`` の文字を使用すると、テンプレートプロセッサがこれらの文字をテンプレート式の区切り文字として認識してしまうため、エラーや予期せぬ結果が発生する可能性があります。場合によっては、 ``{`` を `` [[`` に、 ``}`` を ``]]`` に置き換えることで対応できます。アドバイス:プログラムに ``{`` と ``}`` の文字が含まれている場合は、 `一般プログラムモード` を使用してください。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:505 msgid "Python Template Mode" msgstr "Python テンプレートモード" #: ../../../__w/calibre/calibre/manual/template_lang.rst:507 msgid "" "Python Template Mode (PTM) lets you write templates using native Python and " "the `calibre API `_. The database API will be of " "most use; further discussion is beyond the scope of this manual. PTM " "templates are faster and can do more complicated operations but you must " "know how to write code in Python using the calibre API." msgstr "Pythonテンプレートモード(PTM)を使用すると、ネイティブPythonと `calibre API `_ を使ってテンプレートを作成できます。データベースAPIがもっともよく使われますが、詳細については、このマニュアルの範囲外です。PTMテンプレートは高速で、より複雑な処理を実行できますが、calibre APIを使用してPythonでコードを書く方法を知っている必要があります。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:509 msgid "A PTM template begins with:" msgstr "PTM テンプレートは次で始まります:" #: ../../../__w/calibre/calibre/manual/template_lang.rst:527 msgid "" "You can add the above text to your template using the context menu, usually " "accessed with a right click. The comments are not significant and can be " "removed. You must use python indenting." msgstr "上記のテキストは、通常右クリックで表示されるコンテキストメニューを使用してテンプレートに追加できます。コメントは本質的ではないため、削除しても構いません。Pythonのインデント規則に従う必要があります。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:529 msgid "" "The context object supports ``str(context)`` that returns a string of the " "context's contents, and ``context.attributes`` that returns a list of the " "attribute names in the context." msgstr "コンテキストオブジェクトは、コンテキストの内容を文字列として返す ``str(context)`` と、コンテキスト内の属性名のリストを返す ``context.attributes`` をサポートしています。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:531 msgid "" "The ``context.funcs`` attribute allows calling Built-in and User template " "functions, and Stored GPM/Python templates, so that you can execute them " "directly in your code. The functions are retrieved using their names. If the" " name conflicts with a Python keyword, add an underscore to the end of the " "name. Examples:" msgstr "``context.funcs`` 属性を使用すると、組み込みテンプレート関数、ユーザー定義テンプレート関数、および保存済みのGPM/Pythonテンプレートを呼び出すことができ、コード内で直接実行できます。関数は名前を使用して取得されます。名前がPythonのキーワードと競合する場合は、名前の末尾にアンダースコアを追加してください。例:" #: ../../../__w/calibre/calibre/manual/template_lang.rst:538 msgid "" "Here is an example of a PTM template that produces a list of all the authors" " for a series. The list is stored in a `Column built from other columns, " "behaves like tags`. It shows in :guilabel:`Book details` and has the " ":guilabel:`on separate lines` checked (in :guilabel:`Preferences->Look & " "feel->Book details`). That option requires the list to be comma-separated. " "To satisfy that requirement the template converts commas in author names to " "semicolons then builds a comma-separated list of authors. The authors are " "then sorted, which is why the template uses author_sort." msgstr "これは、シリーズのすべての著者のリストを作成するPTMテンプレートの例です。このリストは、`他の列から構築された列(タグのように動作する)`に保存されます。これは :guilabel:`本の詳細` セクションに表示され、:guilabel:`個別の行に表示` オプションがオンになっています( :guilabel:`環境設定 -> 外観 -> 本の詳細` )。このオプションでは、リストがカンマ区切りである必要があります。この要件を満たすために、テンプレートは著者名に含まれるカンマをセミコロンに変換してから、カンマ区切りの著者リストを作成します。その後、著者はソートされるため、テンプレートでは author_sort を使用しています。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:559 msgid "The output in :guilabel:`Book details` looks like this:" msgstr ":guilabel:`本の詳細` の出力はこのようです:" #: ../../../__w/calibre/calibre/manual/template_lang.rst:561 msgid "E-book conversion dialog" msgstr "電子書籍変換ダイアログ" #: ../../../__w/calibre/calibre/manual/template_lang.rst:569 msgid "Templates and URLs" msgstr "テンプレートとURL" #: ../../../__w/calibre/calibre/manual/template_lang.rst:571 msgid "You can use templates to construct URLs. Two cases are described here:" msgstr "テンプレートを使用してURLを構築することができます。ここでは2つのケースについて説明します:" #: ../../../__w/calibre/calibre/manual/template_lang.rst:573 msgid "Custom column :guilabel:`Book details` search URLs" msgstr "カスタム列 :guilabel:`書籍詳細` 検索URL" #: ../../../__w/calibre/calibre/manual/template_lang.rst:574 msgid "The calibre URL scheme" msgstr "calibre URLスキーム" #: ../../../__w/calibre/calibre/manual/template_lang.rst:576 msgid "**Custom column book details search URLs**" msgstr "**カスタム列書籍詳細検索URL**" #: ../../../__w/calibre/calibre/manual/template_lang.rst:578 msgid "" "When you create a custom column you can provide a URL to be used in " ":guilabel:`Book details` using a template. For example, if you have a custom" " column for `Translators` you can define a URL to take you to a site for " "translators. Book details search URLs can be provided for `Text`, " "`Enumerated`, `Series`, and `Column built from other column` column types." msgstr "カスタム列を作成する際、テンプレートを使用して :guilabel:`書籍詳細` で使用するURLを指定できます。たとえば、``翻訳者`` 用のカスタム列を作成する場合、翻訳者向けのウェブサイトにアクセスできるURLを定義できます。書籍詳細検索用URLは、``テキスト`` 、 ``列挙型`` 、 ``シリーズ`` 、 ``他の列から構築された列`` の各列タイプで指定可能です。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:580 msgid "" "When an item with a `search template` is clicked in :guilabel:`Book details`" " the template is evaluated. It is provided the normal book metadata. It is " "also provided three additional fields:" msgstr ":guilabel:`書籍詳細` に `検索テンプレート` が設定された項目をクリックすると、そのテンプレートが評価されます。テンプレートには通常の本の書誌データに加え、以下の3つの追加フィールドが提供されます:" #: ../../../__w/calibre/calibre/manual/template_lang.rst:582 msgid "``item_value``: the value of the clicked item." msgstr "``item_value``: クリックされた項目の値" #: ../../../__w/calibre/calibre/manual/template_lang.rst:583 msgid "" "``item_value_quoted``: the value of clicked item, URL-encoded. Special " "characters are escaped to make them valid in URLs and spaces are replaced by" " ``'+'`` (plus) signs." msgstr "``item_value_quoted``: クリックされたアイテムの値。URLエンコードされています。特殊文字はURLで有効になるようにエスケープされ、スペースは ``'+'`` (プラス) 記号に置き換えられます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:584 msgid "" "``item_value_no_plus``: the value of clicked item, URL-encoded. Special " "characters are escaped to make them valid in URLs and spaces are replaced by" " the ``%20``, not plus." msgstr "``item_value_no_plus``: クリックされたアイテムの値。URLエンコード済み。特殊文字はURLで有効になるようにエスケープされ、スペースはプラス記号ではなく``%20`` に置き換えられます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:586 msgid "" "There are several ways to construct the URL. The following use Wikipedia as " "an example." msgstr "URLを構築する方法はいくつかあります。以下ではWikipediaを例として説明します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:588 msgid "The simplest is a basic template::" msgstr "一番単純なのは基本テンプレートです::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:592 msgid "" "In some cases you might want to do more processing. There are four template " "functions you can use, depending on the complexity of the processing." msgstr "場合によっては、さらに高度な処理が必要になることがあります。処理の複雑さに応じて、4種類のテンプレート関数を使用できます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:599 msgid "" "For example, assume you have a custom column `Translators` " "(``#translators``) where the names are `Last name, First name`. You might " "need to convert the name to `First name Last name` when creating the URL. " "You can use the :ref:`ff_make_url` function to do this::" msgstr "例えば、カスタム列 `Translators` (``#translators``) があり、名前が `Last name, First name` になっているとします。URLを作成する際に、名前を `First name Last name` に変換する必要があるかもしれません。:ref:`ff_make_url` 関数を使用すると、この変換が可能です。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:603 msgid "" "If we assume that the translator's name is `Boy-Żeleński, Tadeusz` then the " "above template produces the link::" msgstr "翻訳者の名前が `Boy-Żeleński, Tadeusz` であると仮定すると、上記のテンプレートは次のリンクを生成します::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:607 msgid "" "Note that the person's first name is now first, the space is now a plus, and" " that the non-English characters in the last name are URL-encoded." msgstr "なお、名前の順番が姓から名に変わり、スペースがプラス記号に置き換えられ、姓に含まれる英語以外の文字はURLエンコードされていることに注意してください。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:609 msgid "" "The functions :ref:`ff_make_url_extended`, :ref:`ff_query_string`, and " ":ref:`ff_encode_for_url` might be useful depending upon any additional " "processing complexity." msgstr "追加の処理の複雑さに応じて、:ref:`ff_make_url_extended` 、 :ref:`ff_query_string` 、および :ref:`ff_encode_for_url` といった関数が役立つ場合があります。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:611 msgid "**The calibre URL scheme**" msgstr "**calibre URLスキーム**" #: ../../../__w/calibre/calibre/manual/template_lang.rst:613 msgid "" "Calibre supports several different URLs to navigate your calibre libraries. " "This section shows how to use templates to construct some of the URLs. See " ":doc:`url_scheme` for details on the URLs available." msgstr "calibreは、calibreライブラリを操作するための様々なURLをサポートしています。このセクションでは、テンプレートを使用してこれらのURLを構築する方法を説明します。利用可能なURLの詳細については、:doc:`url_scheme` を参照してください。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:616 msgid "Switch to a specific library. The syntax of this URL is::" msgstr "指定したライブラリに切り替えます。URLの構文は次のとおりです::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:620 msgid "" "``Library_Name`` must be replaced with the name of the calibre library you " "wish to open. The library name is shown in the title bar of the window. It " "is a simple name, not the file path to the library. You must spell it as " "shown in the title bar, including letter case. The character ``_`` " "(underscore) stands for the current library. If the name contains any spaces" " or special characters then it must be hex encoded using the " ":ref:`ff_to_hex` function, as in the following example::" msgstr "``Library_Name`` は、開きたいcalibreライブラリの名前に置き換える必要があります。ライブラリ名はウィンドウのタイトルバーに表示されます。これはファイルパスではなく、単純な名前です。タイトルバーに表示されているとおりに、大文字と小文字を含めて正確に入力してください。``_`` (アンダースコア)は現在のライブラリを表します。名前の中にスペースや特殊文字が含まれている場合は、次の例のように、:ref:`ff_to_hex` 関数を使用して16進数エンコードする必要があります。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:628 msgid "The template generates the URL::" msgstr "テンプレートは URL を生成します::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:632 msgid "" "You can replace the ``current_library_name()`` function with the actual name" " of the library, as in::" msgstr " ``current_library_name()`` 関数を、次のように実際のライブラリ名に置き換えることができます::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:636 msgid "" "Links to show books. These links select a book in the calibre library. The " "syntax for this URL is::" msgstr "本を表示するためのリンクです。これらのリンクをクリックすると、calibreライブラリ内の本が選択されます。このURLの構文は以下のとおりです::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:640 msgid "" "The ``book id`` is the numeric calibre id for the book, available to " "templates as ``$id``. As above, the library name might need to be hex " "encoded. Here is an example::" msgstr "``book id`` は、本の calibre ID の数値で、テンプレートでは ``$id`` として使用できます。上記と同様に、ライブラリ名は 16 進数でエンコードする必要がある場合があります。以下に例を示します::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:645 msgid "It produces the URL::" msgstr "次の URL が生成されます::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:649 msgid "" "Searching for books. These links search for books in the specified calibre " "library. The syntax for this URL is::" msgstr "本を検索します。これらのリンクは、指定されたcalibreライブラリ内の本を検索します。このURLの構文は以下のとおりです::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:654 msgid "" "where `query` is any valid calibre search expression. You must hex encode " "any query containing spaces or special characters, which generally means all" " of them. For example, the calibre search expression for searching for a " "hierarchical tag beginning with 'AA' is ``tags:\"=.AA\"``. This template " "constructs a search URL for that expression::" msgstr "ここで `query` は有効なcalibre検索式です。スペースや特殊文字を含む検索式はすべて16進数エンコードする必要があります。つまり、ほとんどすべての検索式が該当します。例えば、 'AA' で始まる階層タグを検索するためのcalibre検索式は ``tags:\"=.AA\"`` です。このテンプレートは、その検索式に対応する検索URLを生成します::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:660 msgid "The resulting URL is::" msgstr "結果の URL は次のようになります::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:664 msgid "" "Here is an example of the same URL built using the " ":ref:``ff_make_url_extended`` function instead of :ref:`ff_strcat`::" msgstr "以下は、:ref:`ff_strcat` 関数ではなく :ref:`ff_make_url_extended` 関数を使用して構築された同じURLの例です::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:669 msgid "" "Open a book details window on a book in some library. The syntax for this " "URL is::" msgstr "いずれかのライブラリにある本について、本の詳細ウィンドウを開きます。このURLの構文は以下のとおりです::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:673 msgid "An example template is::" msgstr "テンプレートの例は次のとおりです::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:677 #: ../../../__w/calibre/calibre/manual/template_lang.rst:694 msgid "which produces the URL::" msgstr "これにより、次の URL が生成されます::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:681 msgid "" "Open the notes associated with an author/series/etc. The syntax of the URL " "is::" msgstr "著者やシリーズなどに関連付けられた注釈を開きます。URLの構文は以下のとおりです::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:686 msgid "" "``Field_Name`` is the lookup name of the field. If the field is a custom " "column then replace the ``#`` character with an underscore (``_``). " "``Item_Id`` is the internal numeric ID of the value in the field. There " "isn't a template function that returns the ``Item_Id``, so templates will " "normally use the second form, ``Hex_Encoded_Item_Name``. Here is a sample " "template that opens the note for the person ``Boy-Żeleński, Tadeusz`` in the" " field ``#authtest``::" msgstr "``Field_Name`` はフィールドの検索名です。フィールドがカスタム列の場合は、 ``#`` 文字をアンダースコア( ``_`` )に置き換えてください。 ``Item_Id`` は、フィールド内の値の内部数値IDです。 ``Item_Id`` を返すテンプレート関数はないため、テンプレートでは通常、2番目の形式である ``Hex_Encoded_Item_Name`` を使用します。以下は、 ``#authtest`` フィールドにある ``Boy-Żeleński, Tadeusz`` という人物のメモを開くサンプルテンプレートです::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:700 msgid "Stored templates" msgstr "保存済みテンプレート" #: ../../../__w/calibre/calibre/manual/template_lang.rst:702 msgid "" "Both :ref:`General Program Mode ` and :ref:`Python Template " "Mode ` support saving templates and calling those templates " "from another template, much like calling stored functions. You save " "templates using :guilabel:`Preferences->Advanced->Template functions`. More " "information is provided in that dialog. You call a template the same way you" " call a function, passing positional arguments if desired. An argument can " "be any expression. Examples of calling a template, assuming the stored " "template is named ``foo``:" msgstr ":ref:`一般プログラム モード ` と :ref:`Python テンプレート モード ` は両方とも、ストアド関数の呼び出しと同様に、テンプレートの保存と別のテンプレートからの呼び出しをサポートしています。テンプレートを保存するには、[設定 -> 詳細設定 -> テンプレート機能] を使用します。詳細については、そのダイアログに表示されます。関数を呼び出すのと同じ方法でテンプレートを呼び出し、必要に応じて位置引数を渡します。引数には任意の式を指定できます。保存されたテンプレートの名前が ``foo`` であると仮定して、テンプレートを呼び出す例:" #: ../../../__w/calibre/calibre/manual/template_lang.rst:704 msgid "``foo()`` -- call the template passing no arguments." msgstr "``foo()`` -- 引数を渡さずにテンプレートを呼び出します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:705 msgid "" "``foo(a, b)`` call the template passing the values of the two variables " "``a`` and ``b``." msgstr "``foo(a, b)`` は、2 つの変数 ``a`` と ``b`` の値を渡すテンプレートを呼び出します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:706 msgid "" "``foo(if field('series') then field('series_index') else 0 fi)`` -- if the " "book has a ``series`` then pass the ``series_index``, otherwise pass the " "value ``0``." msgstr "``foo(if field('series') then field('series_index') else 0 fi)`` -- 本に ``series`` があれば ``series_index`` を渡し、そうでなければ値 ``0`` を渡します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:708 msgid "" "In GPM you retrieve the arguments passed in the call to the stored template " "using the ``arguments`` function. It both declares and initializes local " "variables, effectively parameters. The variables are positional; they get " "the value of the parameter given in the call in the same position. If the " "corresponding parameter is not provided in the call then ``arguments`` " "assigns that variable the provided default value. If there is no default " "value then the variable is set to the empty string. For example, the " "following ``arguments`` function declares 2 variables, ``key``, " "``alternate``::" msgstr "GPMでは、保存されたテンプレートの呼び出し時に渡された引数を、 ``arguments`` 関数を使用して取得します。この関数はローカル変数を宣言し、同時に初期化します。これらの変数は位置に基づいており、呼び出し時に同じ位置で指定された引数の値が代入されます。呼び出し時に対応する引数が指定されていない場合、 ``arguments`` 関数はその変数に指定されたデフォルト値を代入します。デフォルト値が指定されていない場合は、変数は空の文字列に設定されます。例えば、次の ``arguments`` 関数は、``key`` と ``alternate`` という2つの変数を宣言します::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:712 msgid "Examples, again assuming the stored template is named ``foo``:" msgstr "例として、保存されたテンプレートの名前が今回も ``foo`` であると仮定します:" #: ../../../__w/calibre/calibre/manual/template_lang.rst:714 msgid "" "``foo('#myseries')`` -- argument ``key`` is assigned the value " "``'myseries'`` and the argument ``alternate`` is assigned the default value " "``'series'``." msgstr "``foo('#myseries')`` -- 引数 ``key`` には値 ``'myseries'`` が割り当てられ、引数 ``alternate`` にはデフォルト値 ``'series'`` が割り当てられます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:715 msgid "" "``foo('series', '#genre')`` the variable ``key`` is assigned the value " "``'series'`` and the variable ``alternate`` is assigned the value " "``'#genre'``." msgstr "``foo('series', '#genre')`` 変数 ``key`` には値 ``'series'`` が割り当てられ、変数 ``alternate`` には値 ``'#genre'`` が割り当てられます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:716 msgid "" "``foo()`` -- the variable ``key`` is assigned the empty string and the " "variable ``alternate`` is assigned the value ``'series'``." msgstr "``foo()`` -- 変数 ``key`` には空の文字列が割り当てられ、変数 ``alternate`` には値 ``'series'`` が割り当てられます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:718 msgid "" "In PTM the arguments are passed in the ``arguments`` parameter, which is a " "list of strings. There isn't any way to specify default values. You must " "check the length of the ``arguments`` list to be sure that the number of " "arguments is what you expect." msgstr "PTMでは、引数は文字列のリストである ``arguments`` パラメータで渡されます。デフォルト値を指定する方法はありません。引数の数が想定どおりであることを確認するには、 ``arguments`` リストの長さをチェックする必要があります。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:720 msgid "" "An easy way to test stored templates is using the ``Template tester`` " "dialog. For ease of access give it a keyboard shortcut in " ":guilabel:`Preferences->Advanced->Keyboard shortcuts->Template tester`. " "Giving the ``Stored templates`` dialog a shortcut will help switching more " "rapidly between the tester and editing the stored template's source code." msgstr "保存済みテンプレートをテストする簡単な方法は、 ``テンプレートテスタ`` ダイアログを使用することです。アクセスしやすくするには、:guilabel:`環境設定->高度な設定->キーボードショートカット->テンプレートテスタ` でキーボードショートカットを指定します。 ``保存済みテンプレート`` ダイアログにショートカットを指定すると、テスタをすばやく切り替えたり、保存されたテンプレートのソースコードを編集したりするのに役立ちます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:723 msgid "Providing additional information to templates" msgstr "テンプレートに追加情報を与える" #: ../../../__w/calibre/calibre/manual/template_lang.rst:725 msgid "" "A developer can choose to pass additional information to the template " "processor, such as application-specific book metadata or information about " "what the processor is being asked to do. A template can access this " "information and use it during the evaluation." msgstr "開発者は、アプリケーション固有の本の書誌やプロセッサに要求されていることに関する情報など、追加情報をテンプレートプロセッサに渡すことを選択できます。テンプレートはこの情報にアクセスして、評価中に使用できます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:727 msgid "**Developer: how to pass additional information**" msgstr "**開発者: 追加情報の渡し方**" #: ../../../__w/calibre/calibre/manual/template_lang.rst:729 msgid "" "The additional information is a Python dictionary containing pairs " "``variable_name: variable_value`` where the values must be strings. The " "template can access the dictionary, creating template local variables named " "``variable_name`` containing the value ``variable_value``. The user cannot " "change the name so it is best to use names that won't collide with other " "template local variables, for example by prefixing the name with an " "underscore." msgstr "追加情報は、``変数名と値`` のペアで構成されるPython辞書形式で提供されます。値は文字列のみ許されます。テンプレートはこの辞書にアクセスし、キーである変数名と同じ名前のテンプレートローカル変数を作成し、そこに値として対応する文字列を格納します。ユーザーは変数名を変更できないため、他のテンプレートローカル変数と名前が重複しないように、例えばアンダースコアを先頭に付けるなど、衝突しない名前を使用することが適切です。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:731 msgid "" "This dictionary is passed to the template processor (the ``formatter``) " "using the named parameter ``global_vars=your_dict``. The full method " "signature is::" msgstr "この辞書は、名前付きパラメータ ``global_vars=your_dict`` を使用してテンプレートプロセッサ( ``formatter`` )に渡されます。メソッドの完全なシグネチャは次のとおりです::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:739 msgid "**Template writer: how to access the additional information**" msgstr "**テンプレート作者: 追加情報のアクセス方法**" #: ../../../__w/calibre/calibre/manual/template_lang.rst:741 msgid "" "You access the additional information (the ``globals`` dictionary) in a " "template using the template function::" msgstr "テンプレート内で追加情報( ``globals`` 辞書)にアクセスするには、テンプレート関数を使用します::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:745 msgid "" "where ``id`` is any legal variable name. This function checks whether the " "additional information provided by the developer contains the name. If it " "does then the function assigns the provided value to a template local " "variable with that name. If the name is not in the additional information " "and if an ``expression`` is provided, the ``expression`` is evaluated and " "the result is assigned to the local variable. If neither a value nor an " "expression is provided, the function assigns the empty string (``''``) to " "the local variable." msgstr "ここで、``id`` は任意の有効な変数名です。この関数は、開発者から提供された追加情報に名前が含まれているかどうかを確認します。その場合、関数は提供された値をその名前のテンプレートローカル変数に割り当てます。名前が追加情報に含まれておらず、式が指定されている場合、式が評価され、結果がローカル変数に割り当てられます。値も式も指定されていない場合、関数は空の文字列 (``''``) をローカル変数に割り当てます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:747 msgid "" "A template can set a value in the ``globals`` dictionary using the template " "function::" msgstr "テンプレートは、テンプレート関数を使用して ``globals`` 辞書に値を設定できます::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:751 msgid "" "This function sets the ``globals`` dictionary key:value pair ``id:value`` " "where ``value`` is the value of the template local variable ``id``. If that " "local variable doesn't exist then ``value`` is set to the result of " "evaluating ``expression``." msgstr "この関数は、 ``globals`` 辞書にキーと値のペア ``id:value`` を設定します。ここで ``value`` はテンプレートのローカル変数 ``id`` の値です。もしそのローカル変数が存在しない場合は、``value`` は ``expression`` を評価した結果の値に設定されます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:754 msgid "Notes on the difference between modes" msgstr "モード間の違いに関する注意事項" #: ../../../__w/calibre/calibre/manual/template_lang.rst:756 msgid "" "The three program modes, :ref:`Single Function Mode ` (SFM), " ":ref:`Template Program Mode ` (`TPM`), and :ref:`General " "Program Mode ` (`GPM`), work differently. SFM is intended to " "be 'simple' so it hides a lot of programming language bits." msgstr "3つのプログラムモード、 :ref:`単関数モード ` (SFM), :ref:`テンプレートプログラムモード ` (`TPM`), and :ref:`一般プログラムモード ` (`GPM`)は、それぞれ動作が異なります。 SFMは「シンプル」を目指しているため、多くのプログラミング言語情報を隠します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:758 msgid "Differences:" msgstr "相違点:" #: ../../../__w/calibre/calibre/manual/template_lang.rst:760 msgid "" "In SFM the value of the column is always passed as an 'invisible' first " "argument to a function included in the template." msgstr "SFM では、列の値は常に「非表示」の最初の引数としてテンプレートに含まれる関数に渡されます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:761 msgid "" "SFM doesn't support the difference between variables and strings; all values" " are strings." msgstr "SFMは、変数と文字列の違いをサポートしていません。すべての値は文字列です。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:762 msgid "" "The following SFM template returns either the series name or the string \"no" " series\"::" msgstr "次のSFMテンプレートは、シリーズ名か文字列 \"no series\" のいずれかを返します::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:766 msgid "The equivalent template in `TPM` is ::" msgstr "`TPM` で同等のテンプレートは ::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:770 msgid "The equivalent template in `GPM` is::" msgstr "`GPM` で同等のテンプレートは::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:774 msgid "" "The first argument to ``ifempty`` is the value of the field ``series``. The " "second argument is the string ``no series``. In SFM the first argument, the " "value of the field, is automatically passed (the invisible argument)." msgstr "``ifempty`` の最初の引数は、フィールド ``series`` の値です。 2 番目の引数は文字列 ``no series`` です。 SFMでは、最初の引数であるフィールドの値が自動的に渡されます (非表示の引数)。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:775 msgid "" "Several template functions, for example ``booksize()`` and " "``current_library_name()``, take no arguments. Because of the 'invisible " "argument' you cannot use these functions in SFM." msgstr "``booksize()`` や ``current_library_name()`` などのテンプレート関数には引数を受け取らないものがいくつかあります。 「目に見えない引数」を使用するせいで、SFMではこれらの関数は使用できません。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:776 msgid "" "Nested functions, where a function calls another function to compute an " "argument, cannot be used in SFM. For example this template, intended to " "return the first 5 characters of the series value uppercased, won't work in " "SFM::" msgstr "関数が別の関数を呼び出して引数を計算する入れ子関数は、SFMでは使用できません。たとえば、大文字のシリーズ値の最初の 5 文字を​​返すことを目的としたこのテンプレートは、SFMでは機能しません::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:780 msgid "" "`TPM` and `GPM` support nested functions. The above template in `TPM` would " "be::" msgstr "`TPM` と `GPM` は、入れ子の関数をサポートします。 `TPM` の上記のテンプレートは次のようになります。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:784 msgid "In `GPM` it would be::" msgstr "`GPM` では次のようになります::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:788 msgid "" "As noted in the above :ref:`Template Program Mode ` section, " "using ``{`` and ``}`` characters in `TPM` string literals can lead to errors" " or unexpected results because they confuse the template processor. It tries" " to treat them as template boundaries, not characters. In some but not all " "cases you can replace a ``{`` with ``[[`` and a ``}`` with `]]`. Generally, " "if your program contains ``{`` and ``}`` characters then you should use " "`General Program Mode`." msgstr "上記のテンプレートプログラムモードのセクションで説明したように、TPM文字列リテラルで ``{`` および ``}`` 文字を使用すると、テンプレートプロセッサが混乱するため、エラーや予期しない結果が発生する可能性があります。それらを文字ではなくテンプレート境界として処理しようとします。すべてではありませんが ``{`` を ``[[`` に、そして ``}`` を ``]]`` に置き換えることができる場合もあります。一般的に、プログラムに ``{`` や ``}`` の文字が含まれている場合には `一般プログラムモード` を使用すべきです。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:792 msgid "User-defined Python template functions" msgstr "ユーザ定義の Python テンプレート関数" #: ../../../__w/calibre/calibre/manual/template_lang.rst:794 msgid "" "You can add your own Python functions to the template processor. Such " "functions can be used in any of the three template programming modes. The " "functions are added by going to :guilabel:`Preferences -> Advanced -> " "Template functions`. Instructions are shown in that dialog. Note that you " "can use `Python Templates` for a similar purpose. As calling user-defined " "functions is faster than calling a Python template, user-defined functions " "might be more efficient depending on the complexity of what the function or " "template does." msgstr "テンプレートプロセッサに独自のPython関数を追加できます。これらの関数は、3つのテンプレートプログラミングモードすべてで使用可能です。関数を追加するには、:guilabel:`環境設定 -> 詳細設定 -> テンプレート関数` を選択してください。詳しい手順は、このダイアログに表示されています。なお、同様の目的で `Pythonテンプレート` を使用することもできます。ユーザー定義関数を呼び出す方がPythonテンプレートを呼び出すよりも高速であるため、関数またはテンプレートの処理内容の複雑さによっては、ユーザー定義関数の方が効率的になる場合があります。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:797 msgid "Special notes for using templates in different contexts" msgstr "異なるコンテキストでテンプレートを使用するときの特別な注意" #: ../../../__w/calibre/calibre/manual/template_lang.rst:799 msgid "" "In the GUI (:guilabel:`Columns made from other columns` and " ":guilabel:`Template searches`):" msgstr "GUI(:guilabel:`他の列から作成された列` および :guilabel:`テンプレート検索` )では:" #: ../../../__w/calibre/calibre/manual/template_lang.rst:801 msgid "GPM templates work as before." msgstr "GPMテンプレートは以前と同様に機能します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:802 msgid "Python templates have full access to the calibre database." msgstr "Pythonテンプレートは、calibreデータベースにフルアクセスできます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:804 msgid "In icon rules:" msgstr "アイコンルールでは:" #: ../../../__w/calibre/calibre/manual/template_lang.rst:806 msgid "" "icon rule templates have no book data so field-based functions such as " ":ref:`ff_format_date_field`, :ref:`ff_list_count_field`, and " ":ref:`ff_check_yes_no` won't work." msgstr "アイコンルールテンプレートには本のデータが含まれていないため、`:ref:`ff_format_date_field` 、 `:ref:`ff_list_count_field` 、 `:ref:`ff_check_yes_no` といったフィールドベースの関数は機能しません。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:808 msgid "In the Content server:" msgstr "コンテンツサーバでは:" #: ../../../__w/calibre/calibre/manual/template_lang.rst:810 msgid "" "Templates have access to the new API but not the old API (LibraryDatabase)." msgstr "テンプレートは新しいAPIにはアクセスできますが、古いAPI(ライブラリデータベース)にはアクセスできません。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:811 msgid "" "Because of the above, the following formatter functions are not guaranteed " "to work in GPM templates (composite columns, icon rules, etc) and should be " "avoided if you use the content server:" msgstr "以上の理由により、以下のフォーマッタ関数はGPMテンプレート(複合列、アイコンルールなど)では正常に動作することが保証されないため、コンテンツサーバーを使用する場合は使用を避けてください。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:813 msgid ":ref:`ff_connected_device_name`" msgstr ":ref:`ff_connected_device_name`" #: ../../../__w/calibre/calibre/manual/template_lang.rst:814 msgid ":ref:`ff_connected_device_uuid`" msgstr ":ref:`ff_connected_device_uuid`" #: ../../../__w/calibre/calibre/manual/template_lang.rst:815 msgid ":ref:`ff_current_virtual_library_name`" msgstr ":ref:`ff_current_virtual_library_name`" #: ../../../__w/calibre/calibre/manual/template_lang.rst:816 msgid ":ref:`ff_is_marked`" msgstr ":ref:`ff_is_marked`" #: ../../../__w/calibre/calibre/manual/template_lang.rst:817 msgid ":ref:`ff_virtual_libraries`" msgstr ":ref:`ff_virtual_libraries`" #: ../../../__w/calibre/calibre/manual/template_lang.rst:820 msgid "Special notes for save/send templates" msgstr "テンプレートの保存/送信に関する特記事項" #: ../../../__w/calibre/calibre/manual/template_lang.rst:822 msgid "" "Special processing is applied when a template is used in a :guilabel:`Save " "to disk` or :guilabel:`Send to device` template. The values of the fields " "are cleaned, replacing characters that are special to file systems with " "underscores, including slashes. This means that field text cannot be used to" " create folders. However, slashes are not changed in prefix or suffix " "strings, so slashes in these strings will cause folders to be created. " "Because of this, you can create variable-depth folder structure." msgstr " :guilabel:`ディスクに保存` または :guilabel:`デバイスに送信` テンプレートでテンプレートを使用する場合、特別な処理が適用されます。フィールドの値はクリーンアップされ、ファイルシステムで特殊な意味を持つ文字(スラッシュを含む)はアンダースコアに置き換えられます。つまり、フィールドのテキストを使用してフォルダを作成することはできません。ただし、プレフィックスまたはサフィックス文字列内のスラッシュは変更されないため、これらの文字列にスラッシュが含まれている場合はフォルダが作成されます。これにより、可変な深さのフォルダ構造を作成できます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:824 msgid "" "For example, assume we want the folder structure `series/series_index - " "title`, with the caveat that if series does not exist, then the title should" " be in the top folder. The template to do this is::" msgstr "たとえば、フォルダの構造を `series/series_index - title` としたいが、シリーズが存在しない場合はタイトルを最上位のフォルダに配置したいと仮定します。これを行うためのテンプレートは次のとおりです::" #: ../../../__w/calibre/calibre/manual/template_lang.rst:828 msgid "The slash and the hyphen appear only if series is not empty." msgstr "スラッシュとハイフンは、シリーズが空でない場合にのみ表示されます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:830 msgid "" "The lookup function lets us do even fancier processing. For example, assume " "that if a book has a series, then we want the folder structure " "`series/series index - title.fmt`. If the book does not have a series then " "we want the folder structure `genre/author_sort/title.fmt`. If the book has " "no genre then we want to use 'Unknown'. We want two completely different " "paths, depending on the value of series." msgstr "ルックアップ関数を使用すると、さらに高度な処理を実行できます。たとえば、本にシリーズがあるときにはフォルダ構造を `series/series index - title.fmt` にしたいと仮定します。そして本にシリーズがない場合は、フォルダ構造を `genre/author_sort/title.fmt` にしたいものとします。その本にジャンルがない場合は 'Unknown' を使用します。series の値に応じて、2つの完全に異なるパスが必要です。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:832 msgid "To accomplish this, we:" msgstr "これを達成するには:" #: ../../../__w/calibre/calibre/manual/template_lang.rst:834 msgid "" "Create a composite field (give it lookup name #aa) containing " "``{series}/{series_index} - {title}``. If the series is not empty, then this" " template will produce `series/series_index - title`." msgstr "``{series}/{series_index} - {title}`` を含む複合フィールドを作成します (ルックアップ名 #aa を指定します)。シリーズが空でなければ、このテンプレートは `series/series_index - title` を生成します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:835 msgid "" "Create a composite field (give it lookup name #bb) containing " "``{#genre:ifempty(Unknown)}/{author_sort}/{title}``. This template produces " "`genre/author_sort/title`, where an empty genre is replaced with `Unknown`." msgstr "``{#genre:ifempty(Unknown)}/{author_sort}/{title}`` を含む複合フィールドを作成します (ルックアップ名 #bb を指定します)。このテンプレートは `genre/author_sort/title` を生成し、空のジャンルは `Unknown` に置き換えられます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:836 msgid "" "Set the save template to ``{series:lookup(.,#aa,#bb)}``. This template " "chooses composite field ``#aa`` if series is not empty and composite field " "``#bb`` if series is empty. We therefore have two completely different save " "paths, depending on whether or not `series` is empty." msgstr "保存テンプレートを ``{series:lookup(.,#aa,#bb)}`` に設定します。このテンプレートは、シリーズが空でない場合は複合フィールド ``#aa`` を、シリーズが空の場合は複合フィールド ``#bb`` を選択します。したがって、 ``series`` が空であるかどうかによって、完全に異なる2つの保存パスを提供することになります。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:839 msgid "Tips" msgstr "ヒント" #: ../../../__w/calibre/calibre/manual/template_lang.rst:841 msgid "" "Use the Template Tester to test templates. Add the tester to the context " "menu for books in the library and/or give it a keyboard shortcut." msgstr "テンプレートテスタを使用してテンプレートをテストします。テスタをライブラリ内の本のコンテキストメニューに追加するか、キーボードショートカットを指定します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:842 msgid "" "Templates can use other templates by referencing composite columns built " "with the desired template. Alternatively, you can use Stored Templates." msgstr "テンプレートは、他のテンプレートを使用できます。それをするには、使用したいテンプレートの作成した複合列を参照します。または、保存済みテンプレートを使用することもできます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:843 msgid "" "In a plugboard, you can set a field to empty (or whatever is equivalent to " "empty) by using the special template ``{}``. This template will always " "evaluate to an empty string." msgstr "プラグボードでは、特殊なテンプレート ``{}`` を使用することで、フィールドを空(または空に相当するもの)に設定できます。このテンプレートは常に空の文字列として評価されます。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:844 msgid "" "The technique described above to show numbers even if they have a zero value" " works with the standard field series_index." msgstr "ゼロ値であっても数値を表示する上記の手法は、標準フィールド series_index で機能します。" #: ../../../__w/calibre/calibre/manual/template_lang.rst:849 msgid "Template function reference" msgstr "テンプレート関数リファレンス"