Debian Codegraph @

translations/manual/zh_CN/snippets.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 # Kevin Jin <[email protected]>, 2016
7 # RERBIN MA, 2025-2026
8 # tony shen <[email protected]>, 2024
9 msgid ""
10 msgstr ""
11 "Project-Id-Version: calibre\n"
12 "Report-Msgid-Bugs-To: \n"
13 "POT-Creation-Date: 2026-02-25 10:21+0000\n"
14 "PO-Revision-Date: 2015-01-10 01:24+0000\n"
15 "Last-Translator: RERBIN MA, 2025-2026\n"
16 "Language-Team: Chinese (China) (http://app.transifex.com/calibre/calibre/language/zh_CN/)\n"
17 "MIME-Version: 1.0\n"
18 "Content-Type: text/plain; charset=UTF-8\n"
19 "Content-Transfer-Encoding: 8bit\n"
20 "Language: zh_CN\n"
21 "Plural-Forms: nplurals=1; plural=0;\n"
22
23 #: ../../../__w/calibre/calibre/manual/snippets.rst:2
24 msgid "Snippets"
25 msgstr "片段"
26
27 #: ../../../__w/calibre/calibre/manual/snippets.rst:6
28 msgid ""
29 "The calibre E-book editor supports *snippets*. A snippet is a piece of text "
30 "that is either re-used often or contains a lot of redundant text. The editor"
31 " allows you to insert a snippet with only a few key strokes. For example, "
32 "suppose you often find yourself inserting link tags when editing HTML files,"
33 " then you can simply type ``<a`` in the editor and press |ct|. The editor "
34 "will expand it to::"
35 msgstr "Calibre电子书编辑器支持*代码片段*。片段是一段经常重复使用或包含大量冗余文本的文本。该编辑器使您能够只需敲击几次键盘即可插入代码段。例如,假设您经常在编辑HTML文件时插入链接标记,那么您只需在编辑器中键入 ``<a``,然后按|ct|即可。编辑将其展开为:"
36
37 #: ../../../__w/calibre/calibre/manual/snippets.rst:15
38 msgid ""
39 "Not only that, the word ``filename`` will be selected, with the cursor "
40 "placed over it, so that you can easily type in the real filename, using the "
41 "editor's nifty :ref:`editor_auto_complete` feature. And once you are done "
42 "typing the filename, press |ct| again and the cursor will jump to the "
43 "position in between the ``<a>`` tags so you can easily type in the text for "
44 "the link."
45 msgstr "不仅如此,“文件名”一词如被选中,并将光标放在它上面,这样您就可以使用编辑器漂亮的“自动完成编辑”功能轻松输入真实的文件名。一旦您输入完文件名,再次按 |ct|,光标将跳到<a>标记之间的位置,这样您就可以轻松地输入链接的文本。"
46
47 #: ../../../__w/calibre/calibre/manual/snippets.rst:21
48 msgid ""
49 "The snippets system in the editor is very sophisticated, there are a few "
50 "built-in snippets and you can create your own to suit your editing style."
51 msgstr "编辑器中的代码片段系统非常复杂,有几个内置的代码片段,您可以创建自己的代码片段来适应您的编辑风格。"
52
53 #: ../../../__w/calibre/calibre/manual/snippets.rst:24
54 msgid ""
55 "The following discussion of the built-in snippets should help illustrate the"
56 " power of the snippets system."
57 msgstr "下面关于内置代码段的讨论应该有助于说明代码段系统的强大功能。"
58
59 #: ../../../__w/calibre/calibre/manual/snippets.rst:28
60 msgid ""
61 "You can also use snippets in the text entry fields in the :guilabel:`Search "
62 "& replace` panel, however, placeholders (using |ct| to jump around) will not"
63 " work."
64 msgstr "您也可以在`搜索和替换`面板的文本输入字段中使用代码片段,但是占位符(使用|ct|跳转)不起作用。"
65
66 #: ../../../__w/calibre/calibre/manual/snippets.rst:33
67 msgid "The built-in snippets"
68 msgstr "内置代码段"
69
70 #: ../../../__w/calibre/calibre/manual/snippets.rst:35
71 msgid ""
72 "The built-in snippets are described below. Note that you can override them "
73 "by creating your own snippets with the same trigger text."
74 msgstr "内置的代码片段如下所述。请注意,您可以通过使用相同的触发器文本创建您自己的代码段来覆盖它们。"
75
76 #: ../../../__w/calibre/calibre/manual/snippets.rst:39
77 msgid "Inserting filler text [Lorem]"
78 msgstr "插入填充文字[Lorem]"
79
80 #: ../../../__w/calibre/calibre/manual/snippets.rst:41
81 msgid ""
82 "The first built-in snippet, and the simplest is used to insert filler text "
83 "into a document. The filler text is taken from `De finibus bonorum et "
84 "malorum <https://en.wikipedia.org/wiki/De_finibus_bonorum_et_malorum>`_ a "
85 "philosophical work by Cicero (translated to English). To use it simply type "
86 "``Lorem`` in an HTML file and press |ct|. It will be replaced by a couple of"
87 " paragraphs of filler."
88 msgstr "第一个内置代码段,也是最简单的,用于将填充文本插入到文档中。填充文摘自\"《善与恶的终结》<https://en.wikipedia.org/wiki/De_finibus_bonorum_et_malorum>\"_这是西塞罗的一部哲学著作(翻译成英文)。要使用它,只需在HTML文件中键入“Lorem”,然后按|ct|。它将被几段填充文字所取代。"
89
90 #: ../../../__w/calibre/calibre/manual/snippets.rst:48
91 msgid ""
92 "The definition of this snippet is very simple, the trigger text is defined "
93 "as ``Lorem`` and the template is defined simply as the literal text to be "
94 "inserted. You can easily customize it to use your favorite form of filler "
95 "text."
96 msgstr "这段代码的定义非常简单,触发器文本被定义为``Lorem``,模板被简单定义为要插入的文字文本。您可以轻松地对其进行定制,以使用您最喜欢的填充文本形式。"
97
98 #: ../../../__w/calibre/calibre/manual/snippets.rst:53
99 msgid "Inserting a self-closing HTML tag [<>]"
100 msgstr "插入自闭合HTML标签 [<>]"
101
102 #: ../../../__w/calibre/calibre/manual/snippets.rst:55
103 msgid ""
104 "Now let's look at a simple example of the powerful concept of "
105 "*placeholders*. Say you want to insert the self-closing tag ``<hr/>``. Just "
106 "type ``<>``, and press |ct|, the editor will expand the snippet to::"
107 msgstr "现在让我们来看一个简单的例子,它展示了*占位符*这个强大的概念。假设您想要插入自动结束标记``<hr/>``。只需键入``<>``,然后按 |ct|,编辑器将扩展代码片段为:"
108
109 #: ../../../__w/calibre/calibre/manual/snippets.rst:61
110 msgid ""
111 "Here, the ``|`` symbol represents the current cursor position. You can then "
112 "type ``hr`` and press |ct| to move the cursor to after the end of the tag. "
113 "This snippet is defined as::"
114 msgstr "这里,“|”符号表示当前光标位置。然后,您可以键入 “hr”,然后按|ct|将光标移动到标记的末尾。此代码段定义为:"
115
116 #: ../../../__w/calibre/calibre/manual/snippets.rst:68
117 msgid ""
118 "Placeholders are simply the dollar ($) sign followed by a number. When the "
119 "snippet is expanded by pressing |ct| the cursor is positioned at the first "
120 "placeholder (the placeholder with the lowest number). When you press |ct| "
121 "again the cursor jumps to the next placeholder (the placeholder with the "
122 "next higher number)."
123 msgstr "占位符只是美元($)符号后面跟着一个数字。按|ct|展开代码段时,光标位于第一个占位符(数字最小的占位符)。再次按|ct|时,光标会跳到下一个占位符(数字较大的占位符)。"
124
125 #: ../../../__w/calibre/calibre/manual/snippets.rst:75
126 msgid "Inserting an HTML link tag [<a]"
127 msgstr "插入HTML链接标记 [<a]"
128
129 #: ../../../__w/calibre/calibre/manual/snippets.rst:77
130 msgid ""
131 "HTML link tags all share a common structure. They have an ``href`` attribute"
132 " and some text between the opening and closing tags. A snippet to make "
133 "typing them more efficient will introduce us to some more features of "
134 "placeholders. To use this snippet, simply type ``<a`` and press |ct|. The "
135 "editor will expand this to::"
136 msgstr "所有的HTML链接标记都共享一个公共结构。它们有一个``href`‘属性,在开始标记和结束标记之间有一些文本。一段让输入效率更高的代码片段将向我们介绍占位符的一些更多功能。要使用此代码段,只需键入``<a``,然后按 |ct|。编辑会将其扩展为:"
137
138 #: ../../../__w/calibre/calibre/manual/snippets.rst:85
139 msgid ""
140 "Not only that, the word ``filename`` will be selected, with the cursor "
141 "placed over it, so that you can easily type in the real filename, using the "
142 "editor's nifty :ref:`editor_auto_complete` feature. And once you are done "
143 "typing the filename, press |ct| again and the cursor will jump to the "
144 "position in between the ``<a>`` tags so you can easily type in the text for "
145 "the link. After you are done typing the text, press |ct| again to jump to "
146 "the point after the closing tag. This snippet is defined as::"
147 msgstr "不仅如此,如选中单词``文件名``,并将光标放在该单词上,这样您就可以使用该编辑器的;编辑器自动插入”功能轻松地输入真实的文件名。一旦你输入完文件名,再按 |ct|,光标就会跳到“<a>”标记之间的位置,这样你就可以轻松地输入链接的文本。输入完文本后,再次按|ct|可跳到结束标记之后的位置。此代码段定义为:"
148
149 #: ../../../__w/calibre/calibre/manual/snippets.rst:96
150 msgid ""
151 "There are a couple of new features here. First the ``$1`` placeholder has "
152 "become more complex. It now includes some *default text* (the word "
153 "``filename``). If a placeholder contains default text, the default text is "
154 "substituted for the placeholder when the snippet is expanded. Also when you "
155 "jump to a placeholder with default text using |ct|, the default text is "
156 "selected. In this way, you can use default text to act as a reminder to you "
157 "to fill in important parts of the template. You can specify default text for"
158 " a placeholder by using the syntax: ``${<number>:default text}``."
159 msgstr "这里有几个新功能。首先,``$1``占位符变得更加复杂。它现在包括一些*默认文本*(单词``文件名``)。如果占位符包含默认文本,则在展开代码段时将用默认文本替换该占位符。此外,当您使用|ct|跳到具有默认文本的占位符时,默认文本也会被选中。通过这种方式,您可以使用默认文本来提醒您填写模板的重要部分。您可以使用以下语法为占位符指定默认文本:``${<number>:默认文本}``。"
160
161 #: ../../../__w/calibre/calibre/manual/snippets.rst:105
162 msgid ""
163 "The other new feature is that the second placeholder has an asterisk after "
164 "it (``${2*}``). This means that any text that was selected before expanding "
165 "the template is substituted for the placeholder. To see this in action, "
166 "select some text in the editor, press |ct|, type ``<a`` and press |ct| "
167 "again, the template will be expanded to::"
168 msgstr "另一个新特性是,第二个占位符后面有一个星号(``${2*}``)。这意味着在展开模板之前选择的任何文本都将替换占位符。要查看实际操作,请在编辑器中选择一些文本,按 |ct|,键入``<a``,然后再次按|ct|,模板将扩展为:"
169
170 #: ../../../__w/calibre/calibre/manual/snippets.rst:114
171 msgid "Inserting an HTML image tag [<i]"
172 msgstr "插入 HTML 图像标签 [<i]"
173
174 #: ../../../__w/calibre/calibre/manual/snippets.rst:116
175 msgid ""
176 "This is very similar to inserting an HTML link, as we saw above. It allows "
177 "you to quickly input an ``<img src=\"filename\" alt=\"description\" />`` tag"
178 " and jump between the ``src`` and ``alt`` attributes::"
179 msgstr "这非常类似于插入一个HTML链接,正如我们在上面看到的。它允许您快速输入``<img src=\"filename\" alt=\"description\" />``标签并在``src`和``alt`属性之间跳转:"
180
181 #: ../../../__w/calibre/calibre/manual/snippets.rst:124
182 msgid "Insert an arbitrary HTML tag [<<]"
183 msgstr "插入任意的HTML标记 [<<]"
184
185 #: ../../../__w/calibre/calibre/manual/snippets.rst:126
186 msgid ""
187 "This allows you to insert an arbitrary full HTML tag (or wrap previously "
188 "selected text in the tag). To use it, simply type ``<<`` and press |ct|. If "
189 "you want to wrap selected text, first select the text, press |ct| then type "
190 "``<<`` and press |ct| again. The editor will expand it to::"
191 msgstr "这允许您插入任意完整的 HTML 标签(或将之前选中的文本包裹在该标签中)。要使用此功能,只需输入 ``<<`` 并按下 |ct|。如果您想包裹选中的文本,请先选中该文本,按下 |ct|,然后输入 ``<<`` 并再次按下 |ct|。编辑器会将其扩展为::"
192
193 #: ../../../__w/calibre/calibre/manual/snippets.rst:134
194 msgid ""
195 "Type the tag name, for example: ``span`` and press |ct|, that will result "
196 "in::"
197 msgstr "键入标记名称,例如:“span”,然后按 |ct|,结果如下:"
198
199 #: ../../../__w/calibre/calibre/manual/snippets.rst:138
200 msgid ""
201 "You will note that the closing tag has been automatically filled with "
202 "``span``. This is achieved with yet another feature of placeholders, "
203 "*mirroring*. Mirroring simply means that if you specify the same placeholder"
204 " more than once in a template, the second and all later positions will be "
205 "automatically filled in with whatever you type in the first position, when "
206 "you press |ct|. The definition for this snippet is::"
207 msgstr "您会注意到闭合标签已自动填充了``span``。这是通过占位符的另一项功能“镜像”实现的。镜像简单来说就是:如果您在一个模板中多次指定了同一个占位符,那么当您按下 |ct| 时,将自动使用您在第一个位置键入的任何内容填充第二个和所有后面的位置。该代码片段的定义如下:"
208
209 #: ../../../__w/calibre/calibre/manual/snippets.rst:148
210 msgid ""
211 "As you can see, the first placeholder ($1) has been specified twice, the "
212 "second time in the closing tag, which will simply copy whatever you type in "
213 "the opening tag."
214 msgstr "正如您所看到的,第一个占位符 ($1)已经指定了两次,第二次是在结束标记中,这将简单地复制您在开始标记中键入的内容。"
215
216 #: ../../../__w/calibre/calibre/manual/snippets.rst:153
217 msgid "Inserting an arbitrary HTML tag with a class attribute [<c]"
218 msgstr "插入带有类属性的任意HTML标记 [<c]"
219
220 #: ../../../__w/calibre/calibre/manual/snippets.rst:155
221 msgid ""
222 "This is very similar to the insert arbitrary tag example above, except that "
223 "it assumes that you want to specify a class for the tag::"
224 msgstr "这与上面的插入任意 标记示例非常相似,不同之处在于它假定您要为标记指定一个类:"
225
226 #: ../../../__w/calibre/calibre/manual/snippets.rst:161
227 msgid ""
228 "This will allow you to first type the tag name, press |ct|, type the class "
229 "name, press |ct| type the contents of the tag and press |ct| one last time "
230 "to jump out of the tag. The closing tag will be auto-filled."
231 msgstr "这将允许您首先键入标记名,按 |ct|,键入类名,按 |ct |键入标记的内容,最后按|ct||跳出标记。结束标记将自动填充。"
232
233 #: ../../../__w/calibre/calibre/manual/snippets.rst:167
234 msgid "Creating your own snippets"
235 msgstr "创建您自己的代码片段"
236
237 #: ../../../__w/calibre/calibre/manual/snippets.rst:169
238 msgid ""
239 "Snippets really shine because you can create your own to suit your editing "
240 "style. To create your own snippets go to "
241 ":guilabel:`Edit->Preferences->Editor settings->Manage snippets` in the "
242 "editor. This will pop-up an easy to use dialog to help you create your own "
243 "snippets. Simply click the :guilabel:`Add snippet` button and you will see a"
244 " dialog that looks like:"
245 msgstr "片段确实很出色,因为您可以创建自己的片段以适合您的编辑风格。 要创建您自己的代码片段,请转到编辑器中的“编辑”->“首选项”->“编辑器设置”->“管理代码片段”。 这将弹出一个易于使用的对话框来帮助您创建自己的片段。 只需单击“添加片段”按钮,您将看到一个如下所示的对话框:"
246
247 #: ../../../__w/calibre/calibre/manual/snippets.rst:175
248 msgid "The create your own snippets tool"
249 msgstr "创建您自己的代码片段工具"
250
251 #: ../../../__w/calibre/calibre/manual/snippets.rst:180
252 msgid ""
253 "First give your snippet a name, something descriptive, to help identify the "
254 "snippet in the future. Then specify the *trigger*. A trigger is simply the "
255 "text that you have to type in the editor before pressing |ct| in order to "
256 "expand the snippet."
257 msgstr "首先,为您的代码段命名一个描述性的名称,以帮助在将来识别该代码段。然后指定*触发器*。触发器只是在按|ct|以展开代码片断之前必须在编辑器中键入的文本。"
258
259 #: ../../../__w/calibre/calibre/manual/snippets.rst:185
260 msgid ""
261 "Then specify the snippet template. You should start with one of the examples"
262 " above and modify it to suit your needs. Finally, specify which file types "
263 "you want the snippet to be active for. This way you can have multiple "
264 "snippets with the same trigger text that work differently in different file "
265 "types."
266 msgstr "然后指定代码段模板。您应该从上面的一个示例开始,然后修改它以满足您的需要。最后,指定要激活代码段的文件类型。这样,您就可以拥有具有相同触发器文本的多个代码段,这些代码段在不同的文件类型中工作方式不同。"
267
268 #: ../../../__w/calibre/calibre/manual/snippets.rst:190
269 msgid ""
270 "The next step is to test your newly created snippet. Use the "
271 ":guilabel:`Test` box at the bottom. Type in the trigger text and press |ct| "
272 "to expand the snippet and jump between placeholders."
273 msgstr "下一步是测试新创建的代码段。使用底部的“测试”框。键入触发器文本,然后按|ct|展开代码段并在占位符之间跳转。"