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

Skip to content

Commit 16eab6e

Browse files
[po] auto sync
1 parent 9a47411 commit 16eab6e

Some content is hidden

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

102 files changed

+8938
-395
lines changed

.stat.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"translation": "90.33%", "updated_at": "2024-09-20T15:47:14Z"}
1+
{"translation": "91.83%", "updated_at": "2024-09-22T13:47:13Z"}

c-api/buffer.po

Lines changed: 66 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-06-07 14:48+0000\n"
14+
"POT-Creation-Date: 2024-09-20 14:57+0000\n"
1515
"PO-Revision-Date: 2024-05-11 00:32+0000\n"
1616
"Last-Translator: Rafael Fontenelle <[email protected]>, 2024\n"
1717
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
@@ -629,13 +629,50 @@ msgstr ""
629629
"如果 :c:member:`~Py_buffer.strides` 为 ``NULL``,则数组将被解释为一个标准的 n 维 C "
630630
"语言数组。否则,消费者程序必须按如下方式访问 n 维数组:"
631631

632+
#: ../../c-api/buffer.rst:368
633+
msgid ""
634+
"ptr = (char *)buf + indices[0] * strides[0] + ... + indices[n-1] * strides[n-1];\n"
635+
"item = *((typeof(item) *)ptr);"
636+
msgstr ""
637+
"ptr = (char *)buf + indices[0] * strides[0] + ... + indices[n-1] * strides[n-1];\n"
638+
"item = *((typeof(item) *)ptr);"
639+
632640
#: ../../c-api/buffer.rst:374
633641
msgid ""
634642
"As noted above, :c:member:`~Py_buffer.buf` can point to any location within "
635643
"the actual memory block. An exporter can check the validity of a buffer with"
636644
" this function:"
637645
msgstr "如上所述,:c:member:`~Py_buffer.buf` 可以指向实际内存块中的任意位置。输出者程序可以用该函数检查缓冲区的有效性。"
638646

647+
#: ../../c-api/buffer.rst:378
648+
msgid ""
649+
"def verify_structure(memlen, itemsize, ndim, shape, strides, offset):\n"
650+
" \"\"\"Verify that the parameters represent a valid array within\n"
651+
" the bounds of the allocated memory:\n"
652+
" char *mem: start of the physical memory block\n"
653+
" memlen: length of the physical memory block\n"
654+
" offset: (char *)buf - mem\n"
655+
" \"\"\"\n"
656+
" if offset % itemsize:\n"
657+
" return False\n"
658+
" if offset < 0 or offset+itemsize > memlen:\n"
659+
" return False\n"
660+
" if any(v % itemsize for v in strides):\n"
661+
" return False\n"
662+
"\n"
663+
" if ndim <= 0:\n"
664+
" return ndim == 0 and not shape and not strides\n"
665+
" if 0 in shape:\n"
666+
" return True\n"
667+
"\n"
668+
" imin = sum(strides[j]*(shape[j]-1) for j in range(ndim)\n"
669+
" if strides[j] <= 0)\n"
670+
" imax = sum(strides[j]*(shape[j]-1) for j in range(ndim)\n"
671+
" if strides[j] > 0)\n"
672+
"\n"
673+
" return 0 <= offset+imin and offset+imax+itemsize <= memlen"
674+
msgstr ""
675+
639676
#: ../../c-api/buffer.rst:408
640677
msgid "PIL-style: shape, strides and suboffsets"
641678
msgstr "PIL-风格:形状,步幅和子偏移量"
@@ -662,6 +699,34 @@ msgid ""
662699
"strides and suboffsets::"
663700
msgstr "这是一个函数,当n维索引所指向的N-D数组中有 ``NULL`` 步长和子偏移量时,它返回一个指针"
664701

702+
#: ../../c-api/buffer.rst:423
703+
msgid ""
704+
"void *get_item_pointer(int ndim, void *buf, Py_ssize_t *strides,\n"
705+
" Py_ssize_t *suboffsets, Py_ssize_t *indices) {\n"
706+
" char *pointer = (char*)buf;\n"
707+
" int i;\n"
708+
" for (i = 0; i < ndim; i++) {\n"
709+
" pointer += strides[i] * indices[i];\n"
710+
" if (suboffsets[i] >=0 ) {\n"
711+
" pointer = *((char**)pointer) + suboffsets[i];\n"
712+
" }\n"
713+
" }\n"
714+
" return (void*)pointer;\n"
715+
"}"
716+
msgstr ""
717+
"void *get_item_pointer(int ndim, void *buf, Py_ssize_t *strides,\n"
718+
" Py_ssize_t *suboffsets, Py_ssize_t *indices) {\n"
719+
" char *pointer = (char*)buf;\n"
720+
" int i;\n"
721+
" for (i = 0; i < ndim; i++) {\n"
722+
" pointer += strides[i] * indices[i];\n"
723+
" if (suboffsets[i] >=0 ) {\n"
724+
" pointer = *((char**)pointer) + suboffsets[i];\n"
725+
" }\n"
726+
" }\n"
727+
" return (void*)pointer;\n"
728+
"}"
729+
665730
#: ../../c-api/buffer.rst:438
666731
msgid "Buffer-related functions"
667732
msgstr "缓冲区相关函数"

c-api/capsule.po

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
# SOME DESCRIPTIVE TITLE.
2-
# Copyright (C) 2001-2023, Python Software Foundation
2+
# Copyright (C) 2001-2024, Python Software Foundation
33
# This file is distributed under the same license as the Python package.
44
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
55
#
66
# Translators:
7-
# Shengjing Zhu <[email protected]>, 2021
8-
# Trim21 <[email protected]>, 2021
9-
# Freesand Leo <[email protected]>, 2023
7+
# Rafael Fontenelle <[email protected]>, 2024
108
#
119
#, fuzzy
1210
msgid ""
1311
msgstr ""
1412
"Project-Id-Version: Python 3.12\n"
1513
"Report-Msgid-Bugs-To: \n"
16-
"POT-Creation-Date: 2023-07-29 02:08+0000\n"
17-
"PO-Revision-Date: 2021-06-28 00:47+0000\n"
18-
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2023\n"
14+
"POT-Creation-Date: 2024-09-20 14:57+0000\n"
15+
"PO-Revision-Date: 2024-05-11 00:32+0000\n"
16+
"Last-Translator: Rafael Fontenelle <rffontenelle@gmail.com>, 2024\n"
1917
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
2018
"MIME-Version: 1.0\n"
2119
"Content-Type: text/plain; charset=UTF-8\n"
@@ -49,6 +47,10 @@ msgstr ""
4947
msgid "The type of a destructor callback for a capsule. Defined as::"
5048
msgstr "Capsule 的析构器回调的类型。 定义如下:"
5149

50+
#: ../../c-api/capsule.rst:29
51+
msgid "typedef void (*PyCapsule_Destructor)(PyObject *);"
52+
msgstr "typedef void (*PyCapsule_Destructor)(PyObject *);"
53+
5254
#: ../../c-api/capsule.rst:31
5355
msgid ""
5456
"See :c:func:`PyCapsule_New` for the semantics of PyCapsule_Destructor "

c-api/datetime.po

Lines changed: 3 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-09-06 15:04+0000\n"
14+
"POT-Creation-Date: 2024-09-20 14:57+0000\n"
1515
"PO-Revision-Date: 2024-05-11 00:32+0000\n"
1616
"Last-Translator: Rafael Fontenelle <[email protected]>, 2024\n"
1717
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
@@ -360,6 +360,8 @@ msgid ""
360360
"Create and return a new :class:`datetime.datetime` object given an argument "
361361
"tuple suitable for passing to :meth:`datetime.datetime.fromtimestamp`."
362362
msgstr ""
363+
"创建并返回一个给定参数元组的新 :class:`datetime.datetime` 对象,适合传给 "
364+
":meth:`datetime.datetime.fromtimestamp`。"
363365

364366
#: ../../c-api/datetime.rst:326
365367
msgid ""

c-api/import.po

Lines changed: 8 additions & 2 deletions
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-08-31 11:30+0000\n"
14+
"POT-Creation-Date: 2024-09-20 14:57+0000\n"
1515
"PO-Revision-Date: 2024-05-11 00:32+0000\n"
1616
"Last-Translator: Rafael Fontenelle <[email protected]>, 2024\n"
1717
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
@@ -252,7 +252,7 @@ msgstr ""
252252
msgid ""
253253
"Uses :func:`!imp.source_from_cache` in calculating the source path if only "
254254
"the bytecode path is provided."
255-
msgstr ""
255+
msgstr "如果只提供了字节码路径则会使用 :func:`!imp.source_from_cache` 来计算源路径。"
256256

257257
#: ../../c-api/import.rst:179
258258
msgid "No longer uses the removed :mod:`!imp` module."
@@ -352,6 +352,12 @@ msgid ""
352352
" bool is_package;\n"
353353
"};"
354354
msgstr ""
355+
"struct _frozen {\n"
356+
" const char *name;\n"
357+
" const unsigned char *code;\n"
358+
" int size;\n"
359+
" bool is_package;\n"
360+
"};"
355361

356362
#: ../../c-api/import.rst:261
357363
msgid ""

c-api/init.po

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ msgid ""
1212
msgstr ""
1313
"Project-Id-Version: Python 3.12\n"
1414
"Report-Msgid-Bugs-To: \n"
15-
"POT-Creation-Date: 2024-08-09 17:14+0000\n"
15+
"POT-Creation-Date: 2024-09-20 14:57+0000\n"
1616
"PO-Revision-Date: 2024-05-11 00:32+0000\n"
1717
"Last-Translator: Rafael Fontenelle <[email protected]>, 2024\n"
1818
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
@@ -983,6 +983,10 @@ msgid ""
983983
"something like ::"
984984
msgstr "返回 Python 解释器的版本。 这将为如下形式的字符串 ::"
985985

986+
#: ../../c-api/init.rst:663
987+
msgid "\"3.0a5+ (py3k:63103M, May 12 2008, 00:53:55) \\n[GCC 4.2.3]\""
988+
msgstr "\"3.0a5+ (py3k:63103M, May 12 2008, 00:53:55) \\n[GCC 4.2.3]\""
989+
986990
#: ../../c-api/init.rst:667
987991
msgid ""
988992
"The first word (up to the first space character) is the current Python "
@@ -1034,6 +1038,10 @@ msgid ""
10341038
"version, in square brackets, for example::"
10351039
msgstr "返回用于编译当前 Python 版本的编译器指令,为带方括号的形式,例如::"
10361040

1041+
#: ../../c-api/init.rst:705
1042+
msgid "\"[GCC 2.7.2.2]\""
1043+
msgstr "\"[GCC 2.7.2.2]\""
1044+
10371045
#: ../../c-api/init.rst:709 ../../c-api/init.rst:723
10381046
msgid ""
10391047
"The returned string points into static storage; the caller should not modify"
@@ -1047,6 +1055,10 @@ msgid ""
10471055
" current Python interpreter instance, for example ::"
10481056
msgstr "返回有关当前Python解释器实例的序列号和构建日期和时间的信息,例如:"
10491057

1058+
#: ../../c-api/init.rst:719
1059+
msgid "\"#67, Aug 1 1997, 22:34:28\""
1060+
msgstr "\"#67, Aug 1 1997, 22:34:28\""
1061+
10501062
#: ../../c-api/init.rst:735
10511063
msgid ""
10521064
"This API is kept for backward compatibility: setting "
@@ -1124,6 +1136,10 @@ msgstr ""
11241136
"在 3.1.3 之前的版本中,你可以通过在调用 :c:func:`PySys_SetArgv` 之后手动弹出第一个 :data:`sys.path` "
11251137
"元素,例如使用::"
11261138

1139+
#: ../../c-api/init.rst:776
1140+
msgid "PyRun_SimpleString(\"import sys; sys.path.pop(0)\\n\");"
1141+
msgstr "PyRun_SimpleString(\"import sys; sys.path.pop(0)\\n\");"
1142+
11271143
#: ../../c-api/init.rst:788
11281144
msgid ""
11291145
"This API is kept for backward compatibility: setting "
@@ -1232,10 +1248,26 @@ msgid ""
12321248
"structure::"
12331249
msgstr "大多数操作 :term:`GIL` 的扩展代码具有以下简单结构:"
12341250

1251+
#: ../../c-api/init.rst:882
1252+
msgid ""
1253+
"Save the thread state in a local variable.\n"
1254+
"Release the global interpreter lock.\n"
1255+
"... Do some blocking I/O operation ...\n"
1256+
"Reacquire the global interpreter lock.\n"
1257+
"Restore the thread state from the local variable."
1258+
msgstr ""
1259+
12351260
#: ../../c-api/init.rst:888
12361261
msgid "This is so common that a pair of macros exists to simplify it::"
12371262
msgstr "这是如此常用因此增加了一对宏来简化它::"
12381263

1264+
#: ../../c-api/init.rst:890
1265+
msgid ""
1266+
"Py_BEGIN_ALLOW_THREADS\n"
1267+
"... Do some blocking I/O operation ...\n"
1268+
"Py_END_ALLOW_THREADS"
1269+
msgstr ""
1270+
12391271
#: ../../c-api/init.rst:898
12401272
msgid ""
12411273
"The :c:macro:`Py_BEGIN_ALLOW_THREADS` macro opens a new block and declares a"
@@ -1249,6 +1281,15 @@ msgstr ""
12491281
msgid "The block above expands to the following code::"
12501282
msgstr "上面的代码块可扩展为下面的代码::"
12511283

1284+
#: ../../c-api/init.rst:904
1285+
msgid ""
1286+
"PyThreadState *_save;\n"
1287+
"\n"
1288+
"_save = PyEval_SaveThread();\n"
1289+
"... Do some blocking I/O operation ...\n"
1290+
"PyEval_RestoreThread(_save);"
1291+
msgstr ""
1292+
12521293
#: ../../c-api/init.rst:914
12531294
msgid ""
12541295
"Here is how these functions work: the global interpreter lock is used to "
@@ -1314,6 +1355,19 @@ msgstr ""
13141355
":c:func:`PyGILState_Ensure` 和 :c:func:`PyGILState_Release` 函数会自动完成上述的所有操作。 从"
13151356
" C 线程调用到 Python 的典型方式如下::"
13161357

1358+
#: ../../c-api/init.rst:955
1359+
msgid ""
1360+
"PyGILState_STATE gstate;\n"
1361+
"gstate = PyGILState_Ensure();\n"
1362+
"\n"
1363+
"/* Perform Python actions here. */\n"
1364+
"result = CallSomeFunction();\n"
1365+
"/* evaluate result or handle exception */\n"
1366+
"\n"
1367+
"/* Release the thread. No Python API allowed beyond this point. */\n"
1368+
"PyGILState_Release(gstate);"
1369+
msgstr ""
1370+
13171371
#: ../../c-api/init.rst:965
13181372
msgid ""
13191373
"Note that the ``PyGILState_*`` functions assume there is only one global "
@@ -2159,6 +2213,20 @@ msgid ""
21592213
"certain functionality restricted::"
21602214
msgstr "子解释器在彼此相互隔离,并让特定功能受限的情况下是最有效率的::"
21612215

2216+
#: ../../c-api/init.rst:1638
2217+
msgid ""
2218+
"PyInterpreterConfig config = {\n"
2219+
" .use_main_obmalloc = 0,\n"
2220+
" .allow_fork = 0,\n"
2221+
" .allow_exec = 0,\n"
2222+
" .allow_threads = 1,\n"
2223+
" .allow_daemon_threads = 0,\n"
2224+
" .check_multi_interp_extensions = 1,\n"
2225+
" .gil = PyInterpreterConfig_OWN_GIL,\n"
2226+
"};\n"
2227+
"PyThreadState *tstate = Py_NewInterpreterFromConfig(&config);"
2228+
msgstr ""
2229+
21622230
#: ../../c-api/init.rst:1649
21632231
msgid ""
21642232
"Note that the config is used only briefly and does not get modified. During "

c-api/intro.po

Lines changed: 49 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-09-06 15:04+0000\n"
14+
"POT-Creation-Date: 2024-09-20 14:57+0000\n"
1515
"PO-Revision-Date: 2024-05-11 00:32+0000\n"
1616
"Last-Translator: Rafael Fontenelle <[email protected]>, 2024\n"
1717
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
@@ -842,6 +842,27 @@ msgid ""
842842
" return total;\n"
843843
"}"
844844
msgstr ""
845+
"long\n"
846+
"sum_list(PyObject *list)\n"
847+
"{\n"
848+
" Py_ssize_t i, n;\n"
849+
" long total = 0, value;\n"
850+
" PyObject *item;\n"
851+
"\n"
852+
" n = PyList_Size(list);\n"
853+
" if (n < 0)\n"
854+
" return -1; /* Not a list */\n"
855+
" for (i = 0; i < n; i++) {\n"
856+
" item = PyList_GetItem(list, i); /* 不能失败 */\n"
857+
" if (!PyLong_Check(item)) continue; /* 跳过非整数 */\n"
858+
" value = PyLong_AsLong(item);\n"
859+
" if (value == -1 && PyErr_Occurred())\n"
860+
" /* 太大的整数无法适应 C long 类型,放弃 */\n"
861+
" return -1;\n"
862+
" total += value;\n"
863+
" }\n"
864+
" return total;\n"
865+
"}"
845866

846867
#: ../../c-api/intro.rst:527
847868
msgid ""
@@ -873,6 +894,33 @@ msgid ""
873894
" return total;\n"
874895
"}"
875896
msgstr ""
897+
"long\n"
898+
"sum_sequence(PyObject *sequence)\n"
899+
"{\n"
900+
" Py_ssize_t i, n;\n"
901+
" long total = 0, value;\n"
902+
" PyObject *item;\n"
903+
" n = PySequence_Length(sequence);\n"
904+
" if (n < 0)\n"
905+
" return -1; /* 没有长度 */\n"
906+
" for (i = 0; i < n; i++) {\n"
907+
" item = PySequence_GetItem(sequence, i);\n"
908+
" if (item == NULL)\n"
909+
" return -1; /* 不是序列,或其他错误 */\n"
910+
" if (PyLong_Check(item)) {\n"
911+
" value = PyLong_AsLong(item);\n"
912+
" Py_DECREF(item);\n"
913+
" if (value == -1 && PyErr_Occurred())\n"
914+
" /* 太大的整数无法适应 C long 类型,放弃 */\n"
915+
" return -1;\n"
916+
" total += value;\n"
917+
" }\n"
918+
" else {\n"
919+
" Py_DECREF(item); /* 丢弃引用所有权 */\n"
920+
" }\n"
921+
" }\n"
922+
" return total;\n"
923+
"}"
876924

877925
#: ../../c-api/intro.rst:561
878926
msgid "Types"

0 commit comments

Comments
 (0)