-
-
Notifications
You must be signed in to change notification settings - Fork 76
/
readline.po
398 lines (351 loc) · 19.4 KB
/
readline.po
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2021, Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# Menghua Xiao <[email protected]>, 2019
# Freesand Leo <[email protected]>, 2019
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.7\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-01-01 16:02+0000\n"
"PO-Revision-Date: 2019-09-01 03:23+0000\n"
"Last-Translator: Freesand Leo <[email protected]>, 2019\n"
"Language-Team: Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: zh_CN\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: ../../library/readline.rst:2
msgid ":mod:`readline` --- GNU readline interface"
msgstr ":mod:`readline` --- GNU readline 接口"
#: ../../library/readline.rst:12
msgid ""
"The :mod:`readline` module defines a number of functions to facilitate "
"completion and reading/writing of history files from the Python interpreter."
" This module can be used directly, or via the :mod:`rlcompleter` module, "
"which supports completion of Python identifiers at the interactive prompt. "
"Settings made using this module affect the behaviour of both the "
"interpreter's interactive prompt and the prompts offered by the built-in "
":func:`input` function."
msgstr ""
":mod:`readline` 模块定义了许多方便从 Python 解释器完成和读取/写入历史文件的函数。 "
"此模块可以直接使用,或通过支持在交互提示符下完成 Python 标识符的 :mod:`rlcompleter` 模块使用。 "
"使用此模块进行的设置会同时影响解释器的交互提示符以及内置 :func:`input` 函数提供的提示符。"
#: ../../library/readline.rst:20
msgid ""
"Readline keybindings may be configured via an initialization file, typically"
" ``.inputrc`` in your home directory. See `Readline Init File "
"<https://tiswww.cwru.edu/php/chet/readline/rluserman.html#SEC9>`_ in the GNU"
" Readline manual for information about the format and allowable constructs "
"of that file, and the capabilities of the Readline library in general."
msgstr ""
" Readline 的按键绑定可以通过一个初始化文件来配置,通常为你的用户主目录中的 ``.inputrc``。 请参阅 GNU Readline "
"手册中的 `Readline 初始化文件 "
"<https://tiswww.cwru.edu/php/chet/readline/rluserman.html#SEC9>`_ "
"了解有关该文件的格式和允许的结构的信息,以及 Readline 库的一般功能。"
#: ../../library/readline.rst:29
msgid ""
"The underlying Readline library API may be implemented by the ``libedit`` "
"library instead of GNU readline. On macOS the :mod:`readline` module detects"
" which library is being used at run time."
msgstr ""
"底层的 Readline 库 API 可能使用 ``libedit`` 库来实现而不是 GNU readline。 在 macOS 上 "
":mod:`readline` 模块会在运行时检测所使用的是哪个库。"
#: ../../library/readline.rst:34
msgid ""
"The configuration file for ``libedit`` is different from that of GNU "
"readline. If you programmatically load configuration strings you can check "
"for the text \"libedit\" in :const:`readline.__doc__` to differentiate "
"between GNU readline and libedit."
msgstr ""
"``libedit`` 所用的配置文件与 GNU readline 的不同。 如果你要在程序中载入配置字符串你可以在 "
":const:`readline.__doc__` 中检测文本 \"libedit\" 来区分 GNU readline 和 libedit。"
#: ../../library/readline.rst:39
msgid ""
"If you use *editline*/``libedit`` readline emulation on macOS, the "
"initialization file located in your home directory is named ``.editrc``. For"
" example, the following content in ``~/.editrc`` will turn ON *vi* "
"keybindings and TAB completion::"
msgstr ""
"如果你是在 macOS 上使用 *editline*/``libedit`` readline 模拟,则位于你的主目录中的初始化文件名称为 "
"``.editrc``。 例如,``~/.editrc`` 中的以下内容将开启 *vi* 按键绑定以及 TAB 补全::"
#: ../../library/readline.rst:49
msgid "Init file"
msgstr "初始化文件"
#: ../../library/readline.rst:51
msgid ""
"The following functions relate to the init file and user configuration:"
msgstr "下列函数与初始化文件和用户配置有关:"
#: ../../library/readline.rst:56
msgid ""
"Execute the init line provided in the *string* argument. This calls "
":c:func:`rl_parse_and_bind` in the underlying library."
msgstr "执行在 *string* 参数中提供的初始化行。 此函数会调用底层库中的 :c:func:`rl_parse_and_bind`。"
#: ../../library/readline.rst:62
msgid ""
"Execute a readline initialization file. The default filename is the last "
"filename used. This calls :c:func:`rl_read_init_file` in the underlying "
"library."
msgstr ""
"执行一个 readline 初始化文件。 默认文件名为最近所使用的文件名。 此函数会调用底层库中的 "
":c:func:`rl_read_init_file`。"
#: ../../library/readline.rst:67
msgid "Line buffer"
msgstr "行缓冲区"
#: ../../library/readline.rst:69
msgid "The following functions operate on the line buffer:"
msgstr "下列函数会在行缓冲区上操作。"
#: ../../library/readline.rst:74
msgid ""
"Return the current contents of the line buffer (:c:data:`rl_line_buffer` in "
"the underlying library)."
msgstr "返回行缓冲区的当前内容 (底层库中的 :c:data:`rl_line_buffer`)。"
#: ../../library/readline.rst:80
msgid ""
"Insert text into the line buffer at the cursor position. This calls "
":c:func:`rl_insert_text` in the underlying library, but ignores the return "
"value."
msgstr "将文本插入行缓冲区的当前游标位置。 该函数会调用底层库中的 :c:func:`rl_insert_text`,但会忽略其返回值。"
#: ../../library/readline.rst:87
msgid ""
"Change what's displayed on the screen to reflect the current contents of the"
" line buffer. This calls :c:func:`rl_redisplay` in the underlying library."
msgstr "改变屏幕的显示以反映行缓冲区的当前内容。 该函数会调用底层库中的 :c:func:`rl_redisplay`。"
#: ../../library/readline.rst:92
msgid "History file"
msgstr "历史文件"
#: ../../library/readline.rst:94
msgid "The following functions operate on a history file:"
msgstr "下列函数会在历史文件上操作:"
#: ../../library/readline.rst:99
msgid ""
"Load a readline history file, and append it to the history list. The default"
" filename is :file:`~/.history`. This calls :c:func:`read_history` in the "
"underlying library."
msgstr ""
"载入一个 readline 历史文件,并将其添加到历史列表。 默认文件名为 :file:`~/.history`。 此函数会调用底层库中的 "
":c:func:`read_history`。"
#: ../../library/readline.rst:106
msgid ""
"Save the history list to a readline history file, overwriting any existing "
"file. The default filename is :file:`~/.history`. This calls "
":c:func:`write_history` in the underlying library."
msgstr ""
"将历史列表保存为 readline 历史文件,覆盖任何现有文件。 默认文件名为 :file:`~/.history`。 此函数会调用底层库中的 "
":c:func:`write_history`。"
#: ../../library/readline.rst:113
msgid ""
"Append the last *nelements* items of history to a file. The default "
"filename is :file:`~/.history`. The file must already exist. This calls "
":c:func:`append_history` in the underlying library. This function only "
"exists if Python was compiled for a version of the library that supports it."
msgstr ""
"将历史列表的最后 *nelements* 项添加到历史文件。 默认文件名为 :file:`~/.history`。 文件必须已存在。 "
"此函数会调用底层库中的 :c:func:`append_history`。 此函数仅当 Python 编译包带有支持此功能的库版本时才会存在。"
#: ../../library/readline.rst:125
msgid ""
"Set or return the desired number of lines to save in the history file. The "
":func:`write_history_file` function uses this value to truncate the history "
"file, by calling :c:func:`history_truncate_file` in the underlying library."
" Negative values imply unlimited history file size."
msgstr ""
"设置或返回需要保存到历史文件的行数。 :func:`write_history_file` 函数会通过调用底层库中的 "
":c:func:`history_truncate_file` 以使用该值来截取历史文件。 负值意味着不限制历史文件的大小。"
#: ../../library/readline.rst:133
msgid "History list"
msgstr "历史列表"
#: ../../library/readline.rst:135
msgid "The following functions operate on a global history list:"
msgstr "以下函数会在全局历史列表上操作:"
#: ../../library/readline.rst:140
msgid ""
"Clear the current history. This calls :c:func:`clear_history` in the "
"underlying library. The Python function only exists if Python was compiled "
"for a version of the library that supports it."
msgstr ""
"清除当前历史。 此函数会调用底层库的 :c:func:`clear_history`。 此 Python 函数仅当 Python "
"编译包带有支持此功能的库版本时才会存在。"
#: ../../library/readline.rst:147
msgid ""
"Return the number of items currently in the history. (This is different "
"from :func:`get_history_length`, which returns the maximum number of lines "
"that will be written to a history file.)"
msgstr "返回历史列表的当前项数。 (此函数不同于 :func:`get_history_length`,后者是返回将被写入历史文件的最大行数。)"
#: ../../library/readline.rst:154
msgid ""
"Return the current contents of history item at *index*. The item index is "
"one-based. This calls :c:func:`history_get` in the underlying library."
msgstr ""
"返回序号为 *index* 的历史条目的当前内容。 条目序号从一开始。 此函数会调用底层库中的 :c:func:`history_get`。"
#: ../../library/readline.rst:160
msgid ""
"Remove history item specified by its position from the history. The position"
" is zero-based. This calls :c:func:`remove_history` in the underlying "
"library."
msgstr "从历史列表中移除指定位置上的历史条目。 条目位置从零开始。 此函数会调用底层库中的 :c:func:`remove_history`。"
#: ../../library/readline.rst:167
msgid ""
"Replace history item specified by its position with *line*. The position is "
"zero-based. This calls :c:func:`replace_history_entry` in the underlying "
"library."
msgstr ""
"将指定位置上的历史条目替换为 *line*。 条目位置从零开始。 此函数会调用底层库中的 "
":c:func:`replace_history_entry`。"
#: ../../library/readline.rst:174
msgid ""
"Append *line* to the history buffer, as if it was the last line typed. This "
"calls :c:func:`add_history` in the underlying library."
msgstr "将 *line* 添加到历史缓冲区,相当于是最近输入的一行。 此函数会调用底层库中的 :c:func:`add_history`。"
#: ../../library/readline.rst:180
msgid ""
"Enable or disable automatic calls to :c:func:`add_history` when reading "
"input via readline. The *enabled* argument should be a Boolean value that "
"when true, enables auto history, and that when false, disables auto history."
msgstr ""
"启用或禁用当通过 readline 读取输入时自动调用 :c:func:`add_history`。 *enabled* "
"参数应为一个布尔值,当其为真值时启用自动历史,当其为假值时禁用自动历史。"
#: ../../library/readline.rst:193
msgid "Startup hooks"
msgstr "启动钩子"
#: ../../library/readline.rst:198
msgid ""
"Set or remove the function invoked by the :c:data:`rl_startup_hook` callback"
" of the underlying library. If *function* is specified, it will be used as "
"the new hook function; if omitted or ``None``, any function already "
"installed is removed. The hook is called with no arguments just before "
"readline prints the first prompt."
msgstr ""
"设置或移除底层库的 :c:data:`rl_startup_hook` 回调所发起调用的函数。 如果指定了 "
"*function*,它将被用作新的钩子函数;如果省略或为 ``None``,任何已安装的函数将被移除。 钩子函数将在 readline "
"打印第一个提示信息之前不带参数地被调用。"
#: ../../library/readline.rst:207
msgid ""
"Set or remove the function invoked by the :c:data:`rl_pre_input_hook` "
"callback of the underlying library. If *function* is specified, it will be "
"used as the new hook function; if omitted or ``None``, any function already "
"installed is removed. The hook is called with no arguments after the first "
"prompt has been printed and just before readline starts reading input "
"characters. This function only exists if Python was compiled for a version "
"of the library that supports it."
msgstr ""
"设置或移除底层库的 :c:data:`rl_pre_input_hook` 回调所发起调用的函数。 如果指定了 "
"*function*,它将被用作新的钩子函数;如果省略或为 ``None``,任何已安装的函数将被移除。 "
"钩子函数将在打印第一个提示信息之后、readline 开始读取输入字符之前不带参数地被调用。 此函数仅当 Python "
"编译包带有支持此功能的库版本时才会存在。"
#: ../../library/readline.rst:217
msgid "Completion"
msgstr "Completion"
#: ../../library/readline.rst:219
msgid ""
"The following functions relate to implementing a custom word completion "
"function. This is typically operated by the Tab key, and can suggest and "
"automatically complete a word being typed. By default, Readline is set up "
"to be used by :mod:`rlcompleter` to complete Python identifiers for the "
"interactive interpreter. If the :mod:`readline` module is to be used with a"
" custom completer, a different set of word delimiters should be set."
msgstr ""
"以下函数与自定义单词补全函数的实现有关。 这通常使用 Tab 键进行操作,能够提示并自动补全正在输入的单词。 默认情况下,Readline 设置为由 "
":mod:`rlcompleter` 来补全交互模式解释器的 Python 标识符。 如果 :mod:`readline` "
"模块要配合自定义的补全函数来使用,则需要设置不同的单词分隔符。"
#: ../../library/readline.rst:229
msgid ""
"Set or remove the completer function. If *function* is specified, it will "
"be used as the new completer function; if omitted or ``None``, any completer"
" function already installed is removed. The completer function is called as"
" ``function(text, state)``, for *state* in ``0``, ``1``, ``2``, ..., until "
"it returns a non-string value. It should return the next possible "
"completion starting with *text*."
msgstr ""
"设置或移除补全函数。 如果指定了 *function*,它将被用作新的补全函数;如果省略或为 ``None``,任何已安装的补全函数将被移除。 "
"补全函数的调用形式为 ``function(text, state)``,其中 *state* 为 ``0``, ``1``, ``2``, ..., "
"直至其返回一个非字符串值。 它应当返回下一个以 *text* 开头的候选补全内容。"
#: ../../library/readline.rst:236
msgid ""
"The installed completer function is invoked by the *entry_func* callback "
"passed to :c:func:`rl_completion_matches` in the underlying library. The "
"*text* string comes from the first parameter to the "
":c:data:`rl_attempted_completion_function` callback of the underlying "
"library."
msgstr ""
"已安装的补全函数将由传递给底层库中 :c:func:`rl_completion_matches` 的 *entry_func* 回调函数来发起调用。 "
"*text* 字符串来自于底层库中 :c:data:`rl_attempted_completion_function` 回调函数的第一个形参。"
#: ../../library/readline.rst:245
msgid ""
"Get the completer function, or ``None`` if no completer function has been "
"set."
msgstr "获取补全函数,如果没有设置补全函数则返回 ``None``。"
#: ../../library/readline.rst:250
msgid ""
"Get the type of completion being attempted. This returns the "
":c:data:`rl_completion_type` variable in the underlying library as an "
"integer."
msgstr "获取正在尝试的补全类型。 此函数会将底层库中的 :c:data:`rl_completion_type` 变量作为一个整数返回。"
#: ../../library/readline.rst:258
msgid ""
"Get the beginning or ending index of the completion scope. These indexes are"
" the *start* and *end* arguments passed to the "
":c:data:`rl_attempted_completion_function` callback of the underlying "
"library."
msgstr ""
"获取补全域的开始和结束序号。 这些序号就是传给底层库中 :c:data:`rl_attempted_completion_function` 回调函数的"
" *start* 和 *end* 参数。"
#: ../../library/readline.rst:267
msgid ""
"Set or get the word delimiters for completion. These determine the start of"
" the word to be considered for completion (the completion scope). These "
"functions access the :c:data:`rl_completer_word_break_characters` variable "
"in the underlying library."
msgstr ""
"设置或获取补全的单词分隔符。 此分隔符确定了要考虑补全的单词的开始和结束位置(补全域)。 这些函数会访问底层库的 "
":c:data:`rl_completer_word_break_characters` 变量。"
#: ../../library/readline.rst:275
msgid ""
"Set or remove the completion display function. If *function* is specified, "
"it will be used as the new completion display function; if omitted or "
"``None``, any completion display function already installed is removed. "
"This sets or clears the :c:data:`rl_completion_display_matches_hook` "
"callback in the underlying library. The completion display function is "
"called as ``function(substitution, [matches], longest_match_length)`` once "
"each time matches need to be displayed."
msgstr ""
"设置或移除补全显示函数。 如果指定了 *function*,它将被用作新的补全显示函数;如果省略或为 "
"``None``,任何已安装的补全显示函数将被移除。 此函数会设置或清除底层库的 "
":c:data:`rl_completion_display_matches_hook` 回调函数。 补全显示函数会在每次需要显示匹配项时以 "
"``function(substitution, [matches], longest_match_length)`` 的形式被调用。"
#: ../../library/readline.rst:288
msgid "Example"
msgstr "示例"
#: ../../library/readline.rst:290
msgid ""
"The following example demonstrates how to use the :mod:`readline` module's "
"history reading and writing functions to automatically load and save a "
"history file named :file:`.python_history` from the user's home directory. "
"The code below would normally be executed automatically during interactive "
"sessions from the user's :envvar:`PYTHONSTARTUP` file. ::"
msgstr ""
"以下示例演示了如何使用 :mod:`readline` 模块的历史读取或写入函数来自动加载和保存用户主目录下名为 "
":file:`.python_history` 的历史文件。 以下代码通常应当在交互会话期间从用户的 :envvar:`PYTHONSTARTUP` "
"文件自动执行。 ::"
#: ../../library/readline.rst:310
msgid ""
"This code is actually automatically run when Python is run in "
":ref:`interactive mode <tut-interactive>` (see :ref:`rlcompleter-config`)."
msgstr ""
"此代码实际上会在 Python 运行于 :ref:`交互模式 <tut-interactive>` 时自动运行 (参见 "
":ref:`rlcompleter-config`)。"
#: ../../library/readline.rst:313
msgid ""
"The following example achieves the same goal but supports concurrent "
"interactive sessions, by only appending the new history. ::"
msgstr "以下示例实现了同样的目标,但是通过只添加新历史的方式来支持并发的交互会话。 ::"
#: ../../library/readline.rst:334
msgid ""
"The following example extends the :class:`code.InteractiveConsole` class to "
"support history save/restore. ::"
msgstr "以下示例扩展了 :class:`code.InteractiveConsole` 类以支持历史保存/恢复。 ::"