Skip to content

Commit 9247bd8

Browse files
[po] auto sync
1 parent 820721c commit 9247bd8

File tree

168 files changed

+36678
-913
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+36678
-913
lines changed

.stat.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"translation": "88.22%", "updated_at": "2024-09-06T15:47:51Z"}
1+
{"translation": "89.74%", "updated_at": "2024-09-07T15:48:12Z"}

c-api/arg.po

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ msgid ""
1111
msgstr ""
1212
"Project-Id-Version: Python 3.12\n"
1313
"Report-Msgid-Bugs-To: \n"
14-
"POT-Creation-Date: 2024-07-26 14:49+0000\n"
14+
"POT-Creation-Date: 2024-09-06 15:04+0000\n"
1515
"PO-Revision-Date: 2024-05-11 00:32+0000\n"
1616
"Last-Translator: Rafael Fontenelle <rffontenelle@gmail.com>, 2024\n"
1717
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
@@ -689,6 +689,10 @@ msgstr ""
689689
"通过 *converter* 函数将 Python 对象转换为 C 变量。这需要两个参数:第一个是函数,第二个是 C 变量(任意类型)的地址,转换为 "
690690
":c:expr:`void *`。*转换器* 函数依次调用如下:"
691691

692+
#: ../../c-api/arg.rst:316
693+
msgid "status = converter(object, address);"
694+
msgstr "status = converter(object, address);"
695+
692696
#: ../../c-api/arg.rst:318
693697
msgid ""
694698
"where *object* is the Python object to be converted and *address* is the "
@@ -943,13 +947,45 @@ msgid ""
943947
"the :mod:`!_weakref` helper module for weak references::"
944948
msgstr "这是一个使用该函数的示例,取自 :mod:`!_weakref` 弱引用辅助模块的源代码::"
945949

950+
#: ../../c-api/arg.rst:477
951+
msgid ""
952+
"static PyObject *\n"
953+
"weakref_ref(PyObject *self, PyObject *args)\n"
954+
"{\n"
955+
" PyObject *object;\n"
956+
" PyObject *callback = NULL;\n"
957+
" PyObject *result = NULL;\n"
958+
"\n"
959+
" if (PyArg_UnpackTuple(args, \"ref\", 1, 2, &object, &callback)) {\n"
960+
" result = PyWeakref_NewRef(object, callback);\n"
961+
" }\n"
962+
" return result;\n"
963+
"}"
964+
msgstr ""
965+
"static PyObject *\n"
966+
"weakref_ref(PyObject *self, PyObject *args)\n"
967+
"{\n"
968+
" PyObject *object;\n"
969+
" PyObject *callback = NULL;\n"
970+
" PyObject *result = NULL;\n"
971+
"\n"
972+
" if (PyArg_UnpackTuple(args, \"ref\", 1, 2, &object, &callback)) {\n"
973+
" result = PyWeakref_NewRef(object, callback);\n"
974+
" }\n"
975+
" return result;\n"
976+
"}"
977+
946978
#: ../../c-api/arg.rst:490
947979
msgid ""
948980
"The call to :c:func:`PyArg_UnpackTuple` in this example is entirely "
949981
"equivalent to this call to :c:func:`PyArg_ParseTuple`::"
950982
msgstr ""
951983
"这个例子中调用 :c:func:`PyArg_UnpackTuple` 完全等价于调用 :c:func:`PyArg_ParseTuple`::"
952984

985+
#: ../../c-api/arg.rst:493
986+
msgid "PyArg_ParseTuple(args, \"O|O:ref\", &object, &callback)"
987+
msgstr "PyArg_ParseTuple(args, \"O|O:ref\", &object, &callback)"
988+
953989
#: ../../c-api/arg.rst:498
954990
msgid "Building values"
955991
msgstr "创建变量"

c-api/call.po

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ msgid ""
1111
msgstr ""
1212
"Project-Id-Version: Python 3.12\n"
1313
"Report-Msgid-Bugs-To: \n"
14-
"POT-Creation-Date: 2024-05-11 19:07+0000\n"
14+
"POT-Creation-Date: 2024-09-06 15:04+0000\n"
1515
"PO-Revision-Date: 2024-05-11 00:32+0000\n"
1616
"Last-Translator: Rafael Fontenelle <rffontenelle@gmail.com>, 2024\n"
1717
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
@@ -40,6 +40,12 @@ msgid ""
4040
"callable. The signature of the slot is::"
4141
msgstr "设置 :c:member:`~PyTypeObject.tp_call` 的类的实例都是可调用的。 槽位的签名为::"
4242

43+
#: ../../c-api/call.rst:17
44+
msgid ""
45+
"PyObject *tp_call(PyObject *callable, PyObject *args, PyObject *kwargs);"
46+
msgstr ""
47+
"PyObject *tp_call(PyObject *callable, PyObject *args, PyObject *kwargs);"
48+
4349
#: ../../c-api/call.rst:19
4450
msgid ""
4551
"A call is made using a tuple for the positional arguments and a dict for the"
@@ -259,6 +265,10 @@ msgid ""
259265
" Currently equivalent to::"
260266
msgstr "给定一个 vectorcall *nargsf* 实参,返回参数的实际数量。 目前等同于::"
261267

268+
#: ../../c-api/call.rst:153
269+
msgid "(Py_ssize_t)(nargsf & ~PY_VECTORCALL_ARGUMENTS_OFFSET)"
270+
msgstr "(Py_ssize_t)(nargsf & ~PY_VECTORCALL_ARGUMENTS_OFFSET)"
271+
262272
#: ../../c-api/call.rst:155
263273
msgid ""
264274
"However, the function ``PyVectorcall_NARGS`` should be used to allow for "

c-api/init_config.po

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,38 @@ msgid ""
116116
" Py_ExitStatusException(status);\n"
117117
"}"
118118
msgstr ""
119+
"int main(int argc, char **argv)\n"
120+
"{\n"
121+
" PyStatus status;\n"
122+
"\n"
123+
" PyConfig config;\n"
124+
" PyConfig_InitPythonConfig(&config);\n"
125+
" config.isolated = 1;\n"
126+
"\n"
127+
" /* 解码命令行参数。\n"
128+
" 隐式地预初始化 Python (隔离模式)。 */\n"
129+
" status = PyConfig_SetBytesArgv(&config, argc, argv);\n"
130+
" if (PyStatus_Exception(status)) {\n"
131+
" goto exception;\n"
132+
" }\n"
133+
"\n"
134+
" status = Py_InitializeFromConfig(&config);\n"
135+
" if (PyStatus_Exception(status)) {\n"
136+
" goto exception;\n"
137+
" }\n"
138+
" PyConfig_Clear(&config);\n"
139+
"\n"
140+
" return Py_RunMain();\n"
141+
"\n"
142+
"exception:\n"
143+
" PyConfig_Clear(&config);\n"
144+
" if (PyStatus_IsExit(status)) {\n"
145+
" return status.exitcode;\n"
146+
" }\n"
147+
" /* 显示错误消息然后退出进程\n"
148+
" 并设置非零值退出码 */\n"
149+
" Py_ExitStatusException(status);\n"
150+
"}"
119151

120152
#: ../../c-api/init_config.rst:76
121153
msgid "PyWideStringList"
@@ -281,6 +313,25 @@ msgid ""
281313
" return 0;\n"
282314
"}"
283315
msgstr ""
316+
"PyStatus alloc(void **ptr, size_t size)\n"
317+
"{\n"
318+
" *ptr = PyMem_RawMalloc(size);\n"
319+
" if (*ptr == NULL) {\n"
320+
" return PyStatus_NoMemory();\n"
321+
" }\n"
322+
" return PyStatus_Ok();\n"
323+
"}\n"
324+
"\n"
325+
"int main(int argc, char **argv)\n"
326+
"{\n"
327+
" void *ptr;\n"
328+
" PyStatus status = alloc(&ptr, 16);\n"
329+
" if (PyStatus_Exception(status)) {\n"
330+
" Py_ExitStatusException(status);\n"
331+
" }\n"
332+
" PyMem_Free(ptr);\n"
333+
" return 0;\n"
334+
"}"
284335

285336
#: ../../c-api/init_config.rst:213
286337
msgid "PyPreConfig"

0 commit comments

Comments
 (0)