Debian Codegraph @

translations/manual/en_GB/xpath.po

raw
1 # SOME DESCRIPTIVE TITLE.
2 # Copyright (C) Kovid Goyal
3 # This file is distributed under the same license as the calibre package.
4 #
5 # Translators:
6 # Andi Chandler <[email protected]>, 2017,2020,2026
7 # Luke Hollins <[email protected]>, 2015
8 msgid ""
9 msgstr ""
10 "Project-Id-Version: calibre\n"
11 "Report-Msgid-Bugs-To: \n"
12 "POT-Creation-Date: 2026-09-16 15:05+0000\n"
13 "PO-Revision-Date: 2014-06-17 08:35+0000\n"
14 "Last-Translator: Andi Chandler <[email protected]>, 2017,2020,2026\n"
15 "Language-Team: English (United Kingdom) (http://app.transifex.com/calibre/calibre/language/en_GB/)\n"
16 "MIME-Version: 1.0\n"
17 "Content-Type: text/plain; charset=UTF-8\n"
18 "Content-Transfer-Encoding: 8bit\n"
19 "Language: en_GB\n"
20 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
21
22 #: ../../../__w/calibre/calibre/manual/xpath.rst:4
23 msgid "XPath tutorial"
24 msgstr "XPath tutorial"
25
26 #: ../../../__w/calibre/calibre/manual/xpath.rst:6
27 msgid ""
28 "In this tutorial, you will be given a gentle introduction to `XPath "
29 "<https://en.wikipedia.org/wiki/XPath>`_, a query language that can be used "
30 "to select arbitrary parts of `HTML <https://en.wikipedia.org/wiki/HTML>`_ "
31 "documents in calibre. XPath is a widely used standard, and googling it will "
32 "yield a ton of information. This tutorial, however, focuses on using XPath "
33 "for e-book related tasks like finding chapter headings in an unstructured "
34 "HTML document."
35 msgstr "In this tutorial, you will be given a gentle introduction to `XPath <https://en.wikipedia.org/wiki/XPath>`_, a query language that can be used to select arbitrary parts of `HTML <https://en.wikipedia.org/wiki/HTML>`_ documents in calibre. XPath is a widely used standard, and googling it will yield a ton of information. This tutorial, however, focuses on using XPath for e-book related tasks like finding chapter headings in an unstructured HTML document."
36
37 #: ../../../__w/calibre/calibre/manual/xpath.rst:16
38 msgid "Contents"
39 msgstr "Contents"
40
41 #: ../../../__w/calibre/calibre/manual/xpath.rst:19
42 msgid "Selecting by tag name"
43 msgstr "Selecting by tag name"
44
45 #: ../../../__w/calibre/calibre/manual/xpath.rst:21
46 msgid ""
47 "The simplest form of selection is to select tags by name. For example, "
48 "suppose you want to select all the ``<h2>`` tags in a document. The XPath "
49 "query for this is simply::"
50 msgstr "The simplest form of selection is to select tags by name. For example, suppose you want to select all the ``<h2>`` tags in a document. The XPath query for this is simply::"
51
52 #: ../../../__w/calibre/calibre/manual/xpath.rst:27
53 msgid ""
54 "The prefix `//` means *search at any level of the document*. Now suppose you"
55 " want to search for ``<span>`` tags that are inside ``<a>`` tags. That can "
56 "be achieved with::"
57 msgstr "The prefix `//` means *search at any level of the document*. Now suppose you want to search for ``<span>`` tags that are inside ``<a>`` tags. That can be achieved with::"
58
59 #: ../../../__w/calibre/calibre/manual/xpath.rst:33
60 msgid ""
61 "If you want to search for tags at a particular level in the document, change"
62 " the prefix::"
63 msgstr "If you want to search for tags at a particular level in the document, change the prefix::"
64
65 #: ../../../__w/calibre/calibre/manual/xpath.rst:39
66 msgid ""
67 "This will match only ``<p>A very short e-book to demonstrate the use of "
68 "XPath.</p>`` in the :ref:`sample_ebook` but not any of the other ``<p>`` "
69 "tags. The ``h:`` prefix in the above examples is needed to match XHTML tags."
70 " This is because internally, calibre represents all content as XHTML. In "
71 "XHTML tags have a *namespace*, and ``h:`` is the namespace prefix for HTML "
72 "tags."
73 msgstr "This will match only ``<p>A very short e-book to demonstrate the use of XPath.</p>`` in the :ref:`sample_ebook` but not any of the other ``<p>`` tags. The ``h:`` prefix in the above examples is needed to match XHTML tags. This is because internally, calibre represents all content as XHTML. In XHTML tags have a *namespace*, and ``h:`` is the namespace prefix for HTML tags."
74
75 #: ../../../__w/calibre/calibre/manual/xpath.rst:45
76 msgid ""
77 "Now suppose you want to select both ``<h1>`` and ``<h2>`` tags. To do that, "
78 "we need an XPath construct called *predicate*. A :dfn:`predicate` is simply "
79 "a test that is used to select tags. Tests can be arbitrarily powerful and as"
80 " this tutorial progresses, you will see more powerful examples. A predicate "
81 "is created by enclosing the test expression in square brackets::"
82 msgstr "Now suppose you want to select both ``<h1>`` and ``<h2>`` tags. To do that, we need an XPath construct called *predicate*. A :dfn:`predicate` is simply a test that is used to select tags. Tests can be arbitrarily powerful and as this tutorial progresses, you will see more powerful examples. A predicate is created by enclosing the test expression in square brackets::"
83
84 #: ../../../__w/calibre/calibre/manual/xpath.rst:53
85 msgid ""
86 "There are several new features in this XPath expression. The first is the "
87 "use of the wildcard ``*``. It means *match any tag*. Now look at the test "
88 "expression ``name()='h1' or name()='h2'``. :term:`name()` is an example of a"
89 " *built-in function*. It simply evaluates to the name of the tag. So by "
90 "using it, we can select tags whose names are either `h1` or `h2`. Note that "
91 "the :term:`name()` function ignores namespaces so that there is no need for "
92 "the ``h:`` prefix. XPath has several useful built-in functions. A few more "
93 "will be introduced in this tutorial."
94 msgstr "There are several new features in this XPath expression. The first is the use of the wildcard ``*``. It means *match any tag*. Now look at the test expression ``name()='h1' or name()='h2'``. :term:`name()` is an example of a *built-in function*. It simply evaluates to the name of the tag. So by using it, we can select tags whose names are either `h1` or `h2`. Note that the :term:`name()` function ignores namespaces so that there is no need for the ``h:`` prefix. XPath has several useful built-in functions. A few more will be introduced in this tutorial."
95
96 #: ../../../__w/calibre/calibre/manual/xpath.rst:62
97 msgid "Selecting by attributes"
98 msgstr "Selecting by attributes"
99
100 #: ../../../__w/calibre/calibre/manual/xpath.rst:64
101 msgid ""
102 "To select tags based on their attributes, the use of predicates is "
103 "required::"
104 msgstr "To select tags based on their attributes, the use of predicates is required::"
105
106 #: ../../../__w/calibre/calibre/manual/xpath.rst:70
107 msgid ""
108 "Here, the ``@`` operator refers to the attributes of the tag. You can use "
109 "some of the `XPath built-in functions`_ to perform more sophisticated "
110 "matching on attribute values."
111 msgstr "Here, the ``@`` operator refers to the attributes of the tag. You can use some of the `XPath built-in functions`_ to perform more sophisticated matching on attribute values."
112
113 #: ../../../__w/calibre/calibre/manual/xpath.rst:75
114 msgid ""
115 "When XPath expressions are used for conversion options such as chapter "
116 "detection or the start reading at position, they are evaluated against the "
117 "*input* document, before calibre flattens the CSS. CSS flattening rewrites "
118 "class names, so the class names you see in the converted output (things like"
119 " ``calibre1``) do not exist yet when your expression runs. Copy class names "
120 "from the input document, not from the converted book. If in doubt, match on "
121 "tag names and text content instead, as these are not changed by the "
122 "conversion."
123 msgstr ""
124
125 #: ../../../__w/calibre/calibre/manual/xpath.rst:86
126 msgid "Selecting by tag content"
127 msgstr "Selecting by tag content"
128
129 #: ../../../__w/calibre/calibre/manual/xpath.rst:88
130 msgid ""
131 "Using XPath, you can even select tags based on the text they contain. The "
132 "best way to do this is to use the power of *regular expressions* via the "
133 "built-in function :term:`re:test()`::"
134 msgstr "Using XPath, you can even select tags based on the text they contain. The best way to do this is to use the power of *regular expressions* via the built-in function :term:`re:test()`::"
135
136 #: ../../../__w/calibre/calibre/manual/xpath.rst:94
137 msgid ""
138 "Here the ``.`` operator refers to the contents of the tag, just as the ``@``"
139 " operator referred to its attributes."
140 msgstr "Here the ``.`` operator refers to the contents of the tag, just as the ``@`` operator referred to its attributes."
141
142 #: ../../../__w/calibre/calibre/manual/xpath.rst:100
143 msgid "Sample e-book"
144 msgstr "Sample e-book"
145
146 #: ../../../__w/calibre/calibre/manual/xpath.rst:106
147 msgid "XPath built-in functions"
148 msgstr "XPath built-in functions"
149
150 #: ../../../__w/calibre/calibre/manual/xpath.rst:109
151 msgid "name()"
152 msgstr "name()"
153
154 #: ../../../__w/calibre/calibre/manual/xpath.rst:111
155 msgid "The name of the current tag."
156 msgstr "The name of the current tag."
157
158 #: ../../../__w/calibre/calibre/manual/xpath.rst:112
159 msgid "contains()"
160 msgstr "contains()"
161
162 #: ../../../__w/calibre/calibre/manual/xpath.rst:114
163 msgid "``contains(s1, s2)`` returns `true` if s1 contains s2."
164 msgstr "``contains(s1, s2)`` returns `true` if s1 contains s2."
165
166 #: ../../../__w/calibre/calibre/manual/xpath.rst:115
167 msgid "re:test()"
168 msgstr "re:test()"
169
170 #: ../../../__w/calibre/calibre/manual/xpath.rst:117
171 msgid ""
172 "``re:test(src, pattern, flags)`` returns `true` if the string `src` matches "
173 "the regular expression `pattern`. A particularly useful flag is ``i``, it "
174 "makes matching case insensitive. A good primer on the syntax for regular "
175 "expressions can be found at `regexp syntax "
176 "<https://docs.python.org/library/re.html>`_"
177 msgstr "``re:test(src, pattern, flags)`` returns `true` if the string `src` matches the regular expression `pattern`. A particularly useful flag is ``i``, it makes matching case insensitive. A good primer on the syntax for regular expressions can be found at `regexp syntax <https://docs.python.org/library/re.html>`_"