Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1041a1b

Browse files
[po] auto sync
1 parent 3d303b8 commit 1041a1b

7 files changed

Lines changed: 135 additions & 73 deletions

File tree

extending/embedding.po

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#
66
# Translators:
77
# weihaipy, 2020
8+
# Dai Xu <[email protected]>, 2021
89
#
910
#, fuzzy
1011
msgid ""
@@ -13,7 +14,7 @@ msgstr ""
1314
"Report-Msgid-Bugs-To: \n"
1415
"POT-Creation-Date: 2021-01-01 05:02+0000\n"
1516
"PO-Revision-Date: 2017-02-16 17:42+0000\n"
16-
"Last-Translator: weihaipy, 2020\n"
17+
"Last-Translator: Dai Xu <[email protected]>, 2021\n"
1718
"Language-Team: Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n"
1819
"MIME-Version: 1.0\n"
1920
"Content-Type: text/plain; charset=UTF-8\n"
@@ -37,6 +38,9 @@ msgid ""
3738
"writing some scripts in Python. You can also use it yourself if some of the"
3839
" functionality can be written in Python more easily."
3940
msgstr ""
41+
"前几章讨论了如何对 Python 进行扩展,也就是如何用 C 函数库 扩展 Python 的功能。反过来也是可以的:将 Python 嵌入到 C/C++"
42+
" 应用程序中丰富其功能。这种嵌入可以让应用程序用 Python 来实现某些功能,而不是用 C 或 C++ 。用途会有很多;比如允许用户用 Python "
43+
"编写一些脚本,以便定制应用程序满足需求。如果某些功能用 Python 编写起来更为容易,那么开发人员自己也能这么干。"
4044

4145
#: ../../extending/embedding.rst:20
4246
msgid ""
@@ -46,6 +50,8 @@ msgid ""
4650
"have nothing to do with Python --- instead, some parts of the application "
4751
"occasionally call the Python interpreter to run some Python code."
4852
msgstr ""
53+
"Python 的嵌入类似于扩展,但不完全相同。不同之处在于,扩展 Python 时应用程序的主程序仍然是 Python 解释器,而嵌入 Python "
54+
"时的主程序可能与 Python 完全无关——而是应用程序的某些部分偶尔会调用 Python 解释器来运行一些 Python 代码。"
4955

5056
#: ../../extending/embedding.rst:26
5157
msgid ""
@@ -56,6 +62,8 @@ msgid ""
5662
"arguments to Python. Then later you can call the interpreter from any part "
5763
"of the application."
5864
msgstr ""
65+
"因此,若要嵌入 Python,就要提供自己的主程序。此主程序要做的事情之一就是初始化 Python 解释器。至少得调用函数 "
66+
":c:func:`Py_Initialize`。还有些可选的调用可向 Python 传递命令行参数。之后即可从应用程序的任何地方调用解释器了。"
5967

6068
#: ../../extending/embedding.rst:32
6169
msgid ""
@@ -66,20 +74,23 @@ msgid ""
6674
"level operations described in the previous chapters to construct and use "
6775
"Python objects."
6876
msgstr ""
77+
"调用解释器的方式有好几种:可向 :c:func:`PyRun_SimpleString` 传入一个包含 Python 语句的字符串,也可向 "
78+
":c:func:`PyRun_SimpleFile` 传入一个 stdio "
79+
"文件指针和一个文件名(仅在错误信息中起到识别作用)。还可以调用前面介绍过的底层操作来构造并使用 Python 对象。"
6980

7081
#: ../../extending/embedding.rst:42
7182
msgid ":ref:`c-api-index`"
72-
msgstr ""
83+
msgstr ":ref:`c-api-index`"
7384

7485
#: ../../extending/embedding.rst:42
7586
msgid ""
7687
"The details of Python's C interface are given in this manual. A great deal "
7788
"of necessary information can be found here."
78-
msgstr ""
89+
msgstr "本文详细介绍了 Python 的 C 接口。这里有大量必要的信息。"
7990

8091
#: ../../extending/embedding.rst:49
8192
msgid "Very High Level Embedding"
82-
msgstr ""
93+
msgstr "高层次的嵌入"
8394

8495
#: ../../extending/embedding.rst:51
8596
msgid ""
@@ -88,6 +99,8 @@ msgid ""
8899
"needing to interact with the application directly. This can for example be "
89100
"used to perform some operation on a file. ::"
90101
msgstr ""
102+
"最简单的 Python 嵌入形式就是采用非常高层的接口。该接口的目标是只执行一段 Python "
103+
"脚本,而无需与应用程序直接交互。比如以下代码可以用来对某个文件进行一些操作。"
91104

92105
#: ../../extending/embedding.rst:78
93106
msgid ""
@@ -103,10 +116,15 @@ msgid ""
103116
":c:func:`PyRun_SimpleFile` function, which saves you the trouble of "
104117
"allocating memory space and loading the file contents."
105118
msgstr ""
119+
"在 :c:func:`Py_Initialize` 之前,应该先调用 :c:func:`Py_SetProgramName` 函数,以便向解释器告知 "
120+
"Python运行库的路径。接下来,:c:func:`Py_Initialize` 会初始化 Python 解释器,然后执行硬编码的 Python "
121+
"脚本,打印出日期和时间。之后,调用 :c:func:`Py_FinalizeEx` 关闭解释器,程序结束。在真实的程序中,可能需要从其他来源获取 "
122+
"Python 脚本,或许是从文本编辑器例程、文件,或者某个数据库。利用 :c:func:`PyRun_SimpleFile` 函数可以更好地从文件中获取"
123+
" Python 代码,可省去分配内存空间和加载文件内容的麻烦。"
106124

107125
#: ../../extending/embedding.rst:93
108126
msgid "Beyond Very High Level Embedding: An overview"
109-
msgstr ""
127+
msgstr "突破高层次嵌入的限制:概述"
110128

111129
#: ../../extending/embedding.rst:95
112130
msgid ""
@@ -116,6 +134,8 @@ msgid ""
116134
"calls. At the cost of having to write more C code, you can achieve almost "
117135
"anything."
118136
msgstr ""
137+
"高级接口能从应用程序中执行任何 Python "
138+
"代码,但至少交换数据可说是相当麻烦的。如若需要交换数据,应使用较低级别的调用。几乎可以实现任何功能,代价是得写更多的 C 代码。"
119139

120140
#: ../../extending/embedding.rst:100
121141
msgid ""
@@ -124,22 +144,24 @@ msgid ""
124144
"previous chapters are still valid. To show this, consider what the extension"
125145
" code from Python to C really does:"
126146
msgstr ""
147+
"应该注意,尽管意图不同,但扩展 Python 和嵌入 Python 的过程相当类似。前几章中讨论的大多数主题依然有效。为了说明这一点,不妨来看一下从 "
148+
"Python 到 C 的扩展代码到底做了什么:"
127149

128150
#: ../../extending/embedding.rst:105
129151
msgid "Convert data values from Python to C,"
130152
msgstr "转换 Python 的数据值到 C,"
131153

132154
#: ../../extending/embedding.rst:107
133155
msgid "Perform a function call to a C routine using the converted values, and"
134-
msgstr ""
156+
msgstr "用转换后的数据执行 C 程序的函数调用,以及"
135157

136158
#: ../../extending/embedding.rst:109
137159
msgid "Convert the data values from the call from C to Python."
138-
msgstr ""
160+
msgstr "将调用返回的数据从 C 转换为 Python 格式。"
139161

140162
#: ../../extending/embedding.rst:111
141163
msgid "When embedding Python, the interface code does:"
142-
msgstr ""
164+
msgstr "嵌入 Python 时,接口代码会这样做:"
143165

144166
#: ../../extending/embedding.rst:113
145167
msgid "Convert data values from C to Python,"
@@ -149,11 +171,11 @@ msgstr "转换 C 的数据值到 Python,"
149171
msgid ""
150172
"Perform a function call to a Python interface routine using the converted "
151173
"values, and"
152-
msgstr ""
174+
msgstr "用转换后的数据执行对 Python 接口的函数调用,"
153175

154176
#: ../../extending/embedding.rst:118
155177
msgid "Convert the data values from the call from Python to C."
156-
msgstr ""
178+
msgstr "将调用返回的数据从 Python 转换为 C 格式。"
157179

158180
#: ../../extending/embedding.rst:120
159181
msgid ""
@@ -162,6 +184,8 @@ msgid ""
162184
"is the routine that you call between both data conversions. When extending, "
163185
"you call a C routine, when embedding, you call a Python routine."
164186
msgstr ""
187+
"可见只是数据转换的步骤交换了一下顺序,以顺应跨语言的传输方向。唯一的区别是在两次数据转换之间调用的函数不同。在执行扩展时,调用一个 C "
188+
"函数,而执行嵌入时调用的是个 Python 函数。"
165189

166190
#: ../../extending/embedding.rst:125
167191
msgid ""
@@ -170,6 +194,8 @@ msgid ""
170194
" be understood. Since these aspects do not differ from extending the "
171195
"interpreter, you can refer to earlier chapters for the required information."
172196
msgstr ""
197+
"本文不会讨论如何将数据从 Python 转换到 C "
198+
"去,反之亦然。另外还假定读者能够正确使用引用并处理错误。由于这些地方与解释器的扩展没有区别,请参考前面的章节以获得所需的信息。"
173199

174200
#: ../../extending/embedding.rst:134
175201
msgid "Pure Embedding"
@@ -182,6 +208,7 @@ msgid ""
182208
"not directly interact with the application (but that will change in the next"
183209
" section)."
184210
msgstr ""
211+
"第一个程序的目标是执行 Python 脚本中的某个函数。就像高层次接口那样,Python 解释器并不会直接与应用程序进行交互(但下一节将改变这一点)。"
185212

186213
#: ../../extending/embedding.rst:141
187214
msgid "The code to run a function defined in a Python script is:"
@@ -195,6 +222,9 @@ msgid ""
195222
"(let's call the finished executable :program:`call`), and use it to execute "
196223
"a Python script, such as:"
197224
msgstr ""
225+
"上述代码先利用 ``argv[1]`` 加载 Python 脚本,再调用 ``argv[2]`` 指定的函数。函数的整数参数是 ``argv`` "
226+
"数组中的其余值。如果 :ref:`编译并链接<compiling>` 该程序(此处将最终的可执行程序称作 :program:`call`), "
227+
"并用它执行一个 Python 脚本,例如:"
198228

199229
#: ../../extending/embedding.rst:161
200230
msgid "then the result should be:"
@@ -206,6 +236,7 @@ msgid ""
206236
"is for data conversion between Python and C, and for error reporting. The "
207237
"interesting part with respect to embedding Python starts with ::"
208238
msgstr ""
239+
"尽管相对其功能而言,该程序体积相当庞大,但大部分代码是用于 Python 和 C 之间的数据转换,以及报告错误。嵌入 Python 的有趣部分从此开始:"
209240

210241
#: ../../extending/embedding.rst:178
211242
msgid ""

library/ast.po

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# xixi zhao <[email protected]>, 2019
1111
# Fred <[email protected]>, 2020
1212
# Freesand Leo <[email protected]>, 2020
13+
# Dai Xu <[email protected]>, 2021
1314
#
1415
#, fuzzy
1516
msgid ""
@@ -18,7 +19,7 @@ msgstr ""
1819
"Report-Msgid-Bugs-To: \n"
1920
"POT-Creation-Date: 2021-07-31 07:07+0000\n"
2021
"PO-Revision-Date: 2017-02-16 17:48+0000\n"
21-
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2020\n"
22+
"Last-Translator: Dai Xu <daixu61@hotmail.com>, 2021\n"
2223
"Language-Team: Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n"
2324
"MIME-Version: 1.0\n"
2425
"Content-Type: text/plain; charset=UTF-8\n"
@@ -1122,7 +1123,7 @@ msgstr ""
11221123

11231124
#: ../../library/ast.rst:1800
11241125
msgid "Command-Line Usage"
1125-
msgstr ""
1126+
msgstr "命令行用法"
11261127

11271128
#: ../../library/ast.rst:1804
11281129
msgid ""

library/imaplib.po

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
#
66
# Translators:
77
# Dingyuan Wang <[email protected]>, 2019
8-
# Freesand Leo <[email protected]>, 2021
98
# Arisaka97 <[email protected]>, 2021
109
# Kevin Deng <[email protected]>, 2021
1110
# Dai Xu <[email protected]>, 2021
11+
# Freesand Leo <[email protected]>, 2021
1212
#
1313
#, fuzzy
1414
msgid ""
@@ -17,7 +17,7 @@ msgstr ""
1717
"Report-Msgid-Bugs-To: \n"
1818
"POT-Creation-Date: 2021-03-02 05:36+0000\n"
1919
"PO-Revision-Date: 2017-02-16 23:14+0000\n"
20-
"Last-Translator: Dai Xu <daixu61@hotmail.com>, 2021\n"
20+
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2021\n"
2121
"Language-Team: Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n"
2222
"MIME-Version: 1.0\n"
2323
"Content-Type: text/plain; charset=UTF-8\n"
@@ -61,39 +61,46 @@ msgid ""
6161
"attempt. If timeout is not given or is None, the global default socket "
6262
"timeout is used."
6363
msgstr ""
64+
"这个类实现了实际的 IMAP4 协议。 当其实例被实例化时会创建连接并确定协议版本 (IMAP4 或 IMAP4rev1)。 如果未指明 "
65+
"*host*,则会使用 ``''`` (本地主机)。 如果省略 *port*,则会使用标准 IMAP4 端口 (143)。 可选的 *timeout* "
66+
"形参指定连接尝试的超时秒数。 如果未指定超时或为 None,则会使用全局默认的套接字超时。"
6467

6568
#: ../../library/imaplib.rst:42
6669
msgid ""
6770
"The :class:`IMAP4` class supports the :keyword:`with` statement. When used "
6871
"like this, the IMAP4 ``LOGOUT`` command is issued automatically when the "
6972
":keyword:`!with` statement exits. E.g.::"
7073
msgstr ""
74+
":class:`IMAP4` 类支持 :keyword:`with` 语句。 当这样使用时,IMAP4 ``LOGOUT`` 命令会在 "
75+
":keyword:`!with` 语句退出时自动发出。 例如::"
7176

7277
#: ../../library/imaplib.rst:52
7378
msgid "Support for the :keyword:`with` statement was added."
7479
msgstr "支持了 :keyword:`with` 语句。"
7580

7681
#: ../../library/imaplib.rst:55 ../../library/imaplib.rst:122
7782
msgid "The optional *timeout* parameter was added."
78-
msgstr ""
83+
msgstr "添加了可选的 *timeout* 形参。"
7984

8085
#: ../../library/imaplib.rst:58
8186
msgid ""
8287
"Three exceptions are defined as attributes of the :class:`IMAP4` class:"
83-
msgstr ""
88+
msgstr "有三个异常被定义为 :class:`IMAP4` 类的属性:"
8489

8590
#: ../../library/imaplib.rst:63
8691
msgid ""
8792
"Exception raised on any errors. The reason for the exception is passed to "
8893
"the constructor as a string."
89-
msgstr ""
94+
msgstr "任何错误都将引发该异常。 异常的原因会以字符串的形式传递给构造器。"
9095

9196
#: ../../library/imaplib.rst:69
9297
msgid ""
9398
"IMAP4 server errors cause this exception to be raised. This is a sub-class "
9499
"of :exc:`IMAP4.error`. Note that closing the instance and instantiating a "
95100
"new one will usually allow recovery from this exception."
96101
msgstr ""
102+
"IMAP4 服务器错误会导致引发该异常。 这是 :exc:`IMAP4.error` 的子类。 "
103+
"请注意关闭此实例并实例化一个新实例通常将会允许从该异常中恢复。"
97104

98105
#: ../../library/imaplib.rst:76
99106
msgid ""

library/smtplib.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ msgstr ""
197197

198198
#: ../../library/smtplib.rst:132
199199
msgid "The optional *timeout* parameter was added."
200-
msgstr ""
200+
msgstr "添加了可选的 *timeout* 形参。"
201201

202202
#: ../../library/smtplib.rst:136
203203
msgid "A nice selection of exceptions is defined as well:"

0 commit comments

Comments
 (0)