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

Skip to content

Commit efa5346

Browse files
[po] auto sync
1 parent efa6b0c commit efa5346

20 files changed

Lines changed: 8132 additions & 7995 deletions

c-api/buffer.po

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
# Jianchao Su, 2020
1818
# jsgang <[email protected]>, 2020
1919
# Freesand Leo <[email protected]>, 2020
20+
# Jiuh-star <[email protected]>, 2021
2021
#
2122
#, fuzzy
2223
msgid ""
@@ -25,7 +26,7 @@ msgstr ""
2526
"Report-Msgid-Bugs-To: \n"
2627
"POT-Creation-Date: 2021-01-01 05:02+0000\n"
2728
"PO-Revision-Date: 2017-02-16 17:33+0000\n"
28-
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2020\n"
29+
"Last-Translator: Jiuh-star <jiuh.star@gmail.com>, 2021\n"
2930
"Language-Team: Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n"
3031
"MIME-Version: 1.0\n"
3132
"Content-Type: text/plain; charset=UTF-8\n"
@@ -404,6 +405,8 @@ msgid ""
404405
":c:member:`~Py_buffer.buf`, :c:member:`~Py_buffer.len`, "
405406
":c:member:`~Py_buffer.itemsize`, :c:member:`~Py_buffer.ndim`."
406407
msgstr ""
408+
"以下字段不会被 *flags* 影响,并且必须总是用正确的值填充::c:member:`~Py_buffer.obj`, "
409+
":c:member:`~Py_buffer.buf`,:c:member:`~Py_buffer.len`,:c:member:`~Py_buffer.itemsize`,:c:member:`~Py_buffer.ndim`。"
407410

408411
#: ../../c-api/buffer.rst:239
409412
msgid "readonly, format"
@@ -517,6 +520,7 @@ msgid ""
517520
"with and without stride information. Without stride information, the buffer "
518521
"must be C-contiguous."
519522
msgstr ""
523+
"可以显式地请求C 或 Fortran :term:`连续 <contiguous>` ,不管有没有步幅信息。若没有步幅信息,则缓冲区必须是 C-连续的。"
520524

521525
#: ../../c-api/buffer.rst:296 ../../c-api/buffer.rst:321
522526
msgid "contig"
@@ -632,6 +636,10 @@ msgid ""
632636
"embedded at the start of :c:member:`~Py_buffer.buf`, pointing to two ``char "
633637
"x[2][3]`` arrays that can be located anywhere in memory."
634638
msgstr ""
639+
"除了常规项之外, PIL 风格的数组还可以包含指针,必须跟随这些指针才能到达维度的下一个元素。例如,常规的三维 C 语言数组 ``char "
640+
"v[2][2][3]`` 可以看作是一个指向 2 个二维数组的 2 个指针:``char "
641+
"(*v[2])[2][3]``。在子偏移表示中,这两个指针可以嵌入在 :c:member:`~Py_buffer.buf` "
642+
"的开头,指向两个可以位于内存任何位置的 ``char x[2][3]`` 数组。"
635643

636644
#: ../../c-api/buffer.rst:409
637645
msgid ""
@@ -740,6 +748,8 @@ msgid ""
740748
"*len* with writability set according to *readonly*. *buf* is interpreted as "
741749
"a sequence of unsigned bytes."
742750
msgstr ""
751+
"处理导出程序的缓冲区请求,该导出程序要公开大小为 *len* 的 *buf* ,并根据 *readonly* 设置可写性。*bug* "
752+
"被解释为一个无符号字节序列。"
743753

744754
#: ../../c-api/buffer.rst:515
745755
msgid ""

c-api/exceptions.po

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# Yi Cao <[email protected]>, 2020
1313
# jsgang <[email protected]>, 2020
1414
# Freesand Leo <[email protected]>, 2021
15+
# Jiuh-star <[email protected]>, 2021
1516
#
1617
#, fuzzy
1718
msgid ""
@@ -20,7 +21,7 @@ msgstr ""
2021
"Report-Msgid-Bugs-To: \n"
2122
"POT-Creation-Date: 2021-01-01 05:02+0000\n"
2223
"PO-Revision-Date: 2017-02-16 17:35+0000\n"
23-
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2021\n"
24+
"Last-Translator: Jiuh-star <jiuh.star@gmail.com>, 2021\n"
2425
"Language-Team: Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n"
2526
"MIME-Version: 1.0\n"
2627
"Content-Type: text/plain; charset=UTF-8\n"
@@ -45,6 +46,11 @@ msgid ""
4546
":c:func:`PyArg_\\*` functions return ``1`` for success and ``0`` for "
4647
"failure)."
4748
msgstr ""
49+
"本章描述的函数将让你处理和触发 Python 异常。了解一些 Python 异常处理的基本知识是很重要的。 它的工作原理有点像 POSIX 的 "
50+
":c:data:`errno` 变量:(每个线程)有一个全局指示器显示最近发生的错误。 大多数 C API "
51+
"函数不会在成功时理会它,但会在失败时设置它来指示错误的原因。 多数 C API 函数也返回一个错误指示器,如果它们应该返回一个指针,通常返回 "
52+
"``NULL``,如果返回一个整数,则返回 ``-1`` (例外: :c:func:`PyArg_\\*` 函数成功时返回 ``1`` 而失败时返回 "
53+
"``0``)。"
4854

4955
#: ../../c-api/exceptions.rst:20
5056
msgid ""
@@ -54,6 +60,8 @@ msgid ""
5460
"forbidden, for example you can't have a non-``NULL`` traceback if the "
5561
"exception type is ``NULL``)."
5662
msgstr ""
63+
"具体地说,错误指示器由三个对象指针组成:异常的类型,异常的值,和回溯对象。如果没有错误被设置,这些指针都可以是 "
64+
"``NULL``(尽管一些组合使禁止的,例如,如果异常类型是 ``NULL``,你不能有一个非 ``NULL`` 的回溯)。"
5765

5866
#: ../../c-api/exceptions.rst:26
5967
msgid ""
@@ -67,6 +75,8 @@ msgid ""
6775
"error is not handled or carefully propagated, additional calls into the "
6876
"Python/C API may not behave as intended and may fail in mysterious ways."
6977
msgstr ""
78+
"当一个函数由于它调用的某个函数失败而必须失败时,通常不会设置错误指示器;它调用的那个函数已经设置了它。而它负责处理错误和清理异常,或在清除其拥有的所有资源后返回(如对象应用或内存分配)。如果不准备处理异常,则*不*应该正常地继续。如果是由于一个错误返回,那么一定要向调用者表明已经设置了错误。如果错误没有得到处理或小心传播,对"
79+
" Python/C API的其它调用可能不会有预期的行为,并且可能会以某种神秘的方式失败。"
7080

7181
#: ../../c-api/exceptions.rst:37
7282
msgid ""
@@ -75,16 +85,18 @@ msgid ""
7585
"still propagating), while the latter returns an exception after it is caught"
7686
" (and has therefore stopped propagating)."
7787
msgstr ""
88+
"错误指示器 **不是** :func:`sys.exc_info()` "
89+
"的执行结果。前者对应尚未捕获的异常(异常还在传播),而后者在捕获异常后返回这个异常(异常已经停止传播)。"
7890

7991
#: ../../c-api/exceptions.rst:44
8092
msgid "Printing and clearing"
81-
msgstr ""
93+
msgstr "打印和清理"
8294

8395
#: ../../c-api/exceptions.rst:49
8496
msgid ""
8597
"Clear the error indicator. If the error indicator is not set, there is no "
8698
"effect."
87-
msgstr ""
99+
msgstr "清除错误指示器。如果没有设置错误指示器,则不会有作用。"
88100

89101
#: ../../c-api/exceptions.rst:55
90102
msgid ""
@@ -93,6 +105,8 @@ msgid ""
93105
"printed and the Python process will exit with the error code specified by "
94106
"the ``SystemExit`` instance."
95107
msgstr ""
108+
"将标准回溯打印到 ``sys.stderr`` 并清除错误指示器。**除非** 错误是 "
109+
"``SystemExit``,这种情况下不会打印回溯进程,且会退出 Python 进程,并显示 ``SystemExit`` 实例指定的错误代码。"
96110

97111
#: ../../c-api/exceptions.rst:60
98112
msgid ""
@@ -106,6 +120,8 @@ msgid ""
106120
":data:`sys.last_value` and :data:`sys.last_traceback` will be set to the "
107121
"type, value and traceback of the printed exception, respectively."
108122
msgstr ""
123+
"如果 *set_sys_last_vars* 非零,则变量 :data:`sys.last_type`,:data:`sys.last_value` 和"
124+
" :data:`sys.last_traceback` 将分别设置为打印异常的类型,值和回溯。"
109125

110126
#: ../../c-api/exceptions.rst:70
111127
msgid "Alias for ``PyErr_PrintEx(1)``."
@@ -115,7 +131,7 @@ msgstr "``PyErr_PrintEx(1)`` 的别名。"
115131
msgid ""
116132
"Call :func:`sys.unraisablehook` using the current exception and *obj* "
117133
"argument."
118-
msgstr ""
134+
msgstr "使用当前异常和 *obj* 参数调用 :func:`sys.unraisablehook`。"
119135

120136
#: ../../c-api/exceptions.rst:78
121137
msgid ""
@@ -124,17 +140,19 @@ msgid ""
124140
"raise the exception. It is used, for example, when an exception occurs in "
125141
"an :meth:`__del__` method."
126142
msgstr ""
143+
"当设置了异常,但解释器不可能实际地触发异常时,这个实用函数向 ``sys.stderr`` 打印一个警告信息。例如,当 :meth:`__del__` "
144+
"方法中发生异常时使用这个函数。"
127145

128146
#: ../../c-api/exceptions.rst:83
129147
msgid ""
130148
"The function is called with a single argument *obj* that identifies the "
131149
"context in which the unraisable exception occurred. If possible, the repr of"
132150
" *obj* will be printed in the warning message."
133-
msgstr ""
151+
msgstr "该函数使用单个参数 *obj* 进行调用,该参数标识发生不可触发异常的上下文。如果可能,*obj* 的报告将打印在警告消息中。"
134152

135153
#: ../../c-api/exceptions.rst:87
136154
msgid "An exception must be set when calling this function."
137-
msgstr ""
155+
msgstr "调用此函数时必须设置一个异常。"
138156

139157
#: ../../c-api/exceptions.rst:91
140158
msgid "Raising exceptions"
@@ -145,7 +163,7 @@ msgid ""
145163
"These functions help you set the current thread's error indicator. For "
146164
"convenience, some of these functions will always return a ``NULL`` pointer "
147165
"for use in a ``return`` statement."
148-
msgstr ""
166+
msgstr "这些函数可帮助你设置当前线程的错误指示器。为了方便起见,一些函数将始终返回 ``NULL`` 指针,以便用于 ``return`` 语句。"
149167

150168
#: ../../c-api/exceptions.rst:100
151169
msgid ""
@@ -155,12 +173,14 @@ msgid ""
155173
"count. The second argument is an error message; it is decoded from "
156174
"``'utf-8``'."
157175
msgstr ""
176+
"这是设置错误指示器最常用的方法。第一个参数指定异常类型;它通常是标准异常之一,e.g. "
177+
":c:data:`PyExc_RuntimeError`。你不务要增加它的引用计数。第二个参数是错误信息,它解码自 ``'utf-8'``。"
158178

159179
#: ../../c-api/exceptions.rst:108
160180
msgid ""
161181
"This function is similar to :c:func:`PyErr_SetString` but lets you specify "
162182
"an arbitrary Python object for the \"value\" of the exception."
163-
msgstr ""
183+
msgstr "此函数类似于 :c:func:`PyErr_SetString`,但是允许你为异常的“值”指定任意一个 Python 对象。"
164184

165185
#: ../../c-api/exceptions.rst:114
166186
msgid ""
@@ -169,6 +189,9 @@ msgid ""
169189
"help format the error message; they have the same meaning and values as in "
170190
":c:func:`PyUnicode_FromFormat`. *format* is an ASCII-encoded string."
171191
msgstr ""
192+
"这个函数设置了一个错误指示器并且返回了 ``NULL``,*exception* 应当是一个 Python 中的异常类。*format* "
193+
"和随后的形参会帮助格式化这个错误的信息;它们与 :c:func:`PyUnicode_FromFormat` 有着相同的含义和值。*format* "
194+
"是一个ASCII编码的字符串。"
172195

173196
#: ../../c-api/exceptions.rst:123
174197
msgid ""
@@ -178,7 +201,7 @@ msgstr ""
178201

179202
#: ../../c-api/exceptions.rst:131
180203
msgid "This is a shorthand for ``PyErr_SetObject(type, Py_None)``."
181-
msgstr ""
204+
msgstr "这是 ``PyErr_SetObject(type, Py_None)`` 的简写。"
182205

183206
#: ../../c-api/exceptions.rst:136
184207
msgid ""
@@ -400,7 +423,7 @@ msgstr ""
400423

401424
#: ../../c-api/exceptions.rst:367
402425
msgid "Querying the error indicator"
403-
msgstr ""
426+
msgstr "查询错误指示器"
404427

405428
#: ../../c-api/exceptions.rst:371
406429
msgid ""
@@ -657,7 +680,7 @@ msgstr ""
657680

658681
#: ../../c-api/exceptions.rst:624
659682
msgid "Unicode Exception Objects"
660-
msgstr ""
683+
msgstr "Unicode 异常对象"
661684

662685
#: ../../c-api/exceptions.rst:626
663686
msgid ""
@@ -737,7 +760,7 @@ msgstr ""
737760

738761
#: ../../c-api/exceptions.rst:700
739762
msgid "Return the *reason* attribute of the given exception object."
740-
msgstr ""
763+
msgstr "返回给定异常对象的 *reason* 属性"
741764

742765
#: ../../c-api/exceptions.rst:706
743766
msgid ""

c-api/intro.po

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# ww song <[email protected]>, 2018
1010
# ppcfish <[email protected]>, 2019
1111
# Freesand Leo <[email protected]>, 2019
12+
# Jiuh-star <[email protected]>, 2021
1213
#
1314
#, fuzzy
1415
msgid ""
@@ -17,7 +18,7 @@ msgstr ""
1718
"Report-Msgid-Bugs-To: \n"
1819
"POT-Creation-Date: 2021-01-01 05:02+0000\n"
1920
"PO-Revision-Date: 2017-02-16 17:36+0000\n"
20-
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2019\n"
21+
"Last-Translator: Jiuh-star <jiuh.star@gmail.com>, 2021\n"
2122
"Language-Team: Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n"
2223
"MIME-Version: 1.0\n"
2324
"Content-Type: text/plain; charset=UTF-8\n"
@@ -117,6 +118,8 @@ msgid ""
117118
"It is recommended to always define ``PY_SSIZE_T_CLEAN`` before including "
118119
"``Python.h``. See :ref:`arg-parsing` for a description of this macro."
119120
msgstr ""
121+
"推荐总是在 ``Python.h`` 前定义 ``PY_SSIZE_T_CLEAN`` 。查看 :ref:`arg-parsing` "
122+
"来了解这个宏的更多内容。"
120123

121124
#: ../../c-api/intro.rst:67
122125
msgid ""
@@ -136,6 +139,8 @@ msgid ""
136139
"future Python versions, which may define additional names beginning with one"
137140
" of these prefixes."
138141
msgstr ""
142+
"用户代码永远不应该定义以 ``Py`` 或 ``_Py`` "
143+
"开头的名称。这会使读者感到困惑,并危及用户代码对未来Python版本的可移植性,这些版本可能会定义以这些前缀之一开头的其他名称。"
139144

140145
#: ../../c-api/intro.rst:79
141146
msgid ""
@@ -174,6 +179,8 @@ msgid ""
174179
" header files properly declare the entry points to be ``extern \"C\"``. As a"
175180
" result, there is no need to do anything special to use the API from C++."
176181
msgstr ""
182+
"C++ 用户应该注意,尽管 API 是完全使用 C 来定义的,但头文件正确地将入口点声明为 ``extern \"C\"``,因此 API 在 C++ "
183+
"中使用此 API 不必再做任何特殊处理。"
177184

178185
#: ../../c-api/intro.rst:101
179186
msgid "Useful macros"
@@ -196,6 +203,9 @@ msgid ""
196203
"possible values are covered in ``case`` statements. Use this in places "
197204
"where you might be tempted to put an ``assert(0)`` or ``abort()`` call."
198205
msgstr ""
206+
"这个可以在你有一个设计上无法到达的代码路径时使用。例如,当一个 ``switch`` 语句中所有可能的值都已被 ``case`` "
207+
"子句覆盖了,就可将其用在 ``default:`` 子句中。当你非常想在某个位置放一个 ``assert(0)`` 或 ``abort()`` "
208+
"调用时也可以用这个。"
199209

200210
#: ../../c-api/intro.rst:115
201211
msgid ""

extending/extending.po

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# ww song <[email protected]>, 2018
1111
# Shengjing Zhu <[email protected]>, 2019
1212
# Harry Liu. <[email protected]>, 2020
13-
# Freesand Leo <[email protected]>, 2020
13+
# Freesand Leo <[email protected]>, 2021
1414
#
1515
#, fuzzy
1616
msgid ""
@@ -19,7 +19,7 @@ msgstr ""
1919
"Report-Msgid-Bugs-To: \n"
2020
"POT-Creation-Date: 2021-01-01 05:02+0000\n"
2121
"PO-Revision-Date: 2017-02-16 17:42+0000\n"
22-
"Last-Translator: Freesand Leo <[email protected]>, 2020\n"
22+
"Last-Translator: Freesand Leo <[email protected]>, 2021\n"
2323
"Language-Team: Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n"
2424
"MIME-Version: 1.0\n"
2525
"Content-Type: text/plain; charset=UTF-8\n"
@@ -166,7 +166,7 @@ msgstr ""
166166
msgid ""
167167
"The *self* argument points to the module object for module-level functions; "
168168
"for a method it would point to the object instance."
169-
msgstr "对模块级函数, *self* 参数指向模块对象;对于对象实例则指向方法。"
169+
msgstr "对模块级函数, *self* 参数指向模块对象;对于方法则指向对象实例。"
170170

171171
#: ../../extending/extending.rst:107
172172
msgid ""
@@ -460,8 +460,8 @@ msgid ""
460460
"``None``. You need this idiom to do so (which is implemented by the "
461461
":c:macro:`Py_RETURN_NONE` macro)::"
462462
msgstr ""
463-
"如果你的C函数没有有用的返回值(返回 :c:type:`void` 的函数),则必须返回 ``None`` 。(你可以用 "
464-
":c:macro:`Py_RETUN_NONE` 宏来完成):"
463+
"如果你的 C 函数没有有用的返回值 (返回 :c:type:`void` 的函数),则对应的 Python 函数必须返回 ``None`` "
464+
"你必须使用这种写法(可以通过 :c:macro:`Py_RETURN_NONE` 宏来实现):"
465465

466466
#: ../../extending/extending.rst:310
467467
msgid ""

0 commit comments

Comments
 (0)