Skip to content

Commit 61be21b

Browse files
sync with cpython 480f02da
1 parent f967fed commit 61be21b

File tree

8 files changed

+1220
-1131
lines changed

8 files changed

+1220
-1131
lines changed

c-api/allocation.po

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ msgid ""
99
msgstr ""
1010
"Project-Id-Version: Python 3.13\n"
1111
"Report-Msgid-Bugs-To: \n"
12-
"POT-Creation-Date: 2025-03-18 00:14+0000\n"
12+
"POT-Creation-Date: 2025-05-27 00:15+0000\n"
1313
"PO-Revision-Date: 2022-10-16 15:35+0800\n"
1414
"Last-Translator: Matt Wang <mattwang44@gmail.com>\n"
1515
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -112,9 +112,12 @@ msgstr ""
112112
"取,該巨集的拿到指向該物件的指標。"
113113

114114
#: ../../c-api/allocation.rst:79
115-
msgid ":c:func:`PyModule_Create`"
116-
msgstr ":c:func:`PyModule_Create`"
115+
msgid ":ref:`moduleobjects`"
116+
msgstr ""
117117

118118
#: ../../c-api/allocation.rst:80
119119
msgid "To allocate and create extension modules."
120120
msgstr "分配記憶體和建立擴充模組。"
121+
122+
#~ msgid ":c:func:`PyModule_Create`"
123+
#~ msgstr ":c:func:`PyModule_Create`"

c-api/intro.po

Lines changed: 217 additions & 224 deletions
Large diffs are not rendered by default.

extending/building.po

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: Python 3.13\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2024-09-01 22:24+0800\n"
11+
"POT-Creation-Date: 2025-05-27 00:15+0000\n"
1212
"PO-Revision-Date: 2025-02-07 14:09+0000\n"
1313
"Last-Translator: Matt Wang <mattwang44@gmail.com>\n"
1414
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -33,10 +33,10 @@ msgstr ""
3333

3434
#: ../../extending/building.rst:12
3535
msgid ""
36-
"To be importable, the shared library must be available "
37-
"on :envvar:`PYTHONPATH`, and must be named after the module name, with an "
38-
"appropriate extension. When using setuptools, the correct filename is "
39-
"generated automatically."
36+
"To be importable, the shared library must be available on :envvar:"
37+
"`PYTHONPATH`, and must be named after the module name, with an appropriate "
38+
"extension. When using setuptools, the correct filename is generated "
39+
"automatically."
4040
msgstr ""
4141
"要能夠被引入,共用函式庫必須在 :envvar:`PYTHONPATH` 上可用,並且必須以模組名"
4242
"稱命名,並且必須有適當的副檔名。使用 setuptools 時,正確的檔名會自動產生。"
@@ -54,13 +54,14 @@ msgstr ""
5454
"見 :ref:`initializing-modules`。"
5555

5656
#: ../../extending/building.rst:25
57+
#, fuzzy
5758
msgid ""
58-
"For modules with ASCII-only names, the function must be named "
59-
"``PyInit_<modulename>``, with ``<modulename>`` replaced by the name of the "
60-
"module. When using :ref:`multi-phase-initialization`, non-ASCII module names "
61-
"are allowed. In this case, the initialization function name is "
62-
"``PyInitU_<modulename>``, with ``<modulename>`` encoded using Python's "
63-
"*punycode* encoding with hyphens replaced by underscores. In Python::"
59+
"For modules with ASCII-only names, the function must be named :samp:"
60+
"`PyInit_{<name>}`, with ``<name>`` replaced by the name of the module. When "
61+
"using :ref:`multi-phase-initialization`, non-ASCII module names are allowed. "
62+
"In this case, the initialization function name is :samp:`PyInitU_{<name>}`, "
63+
"with ``<name>`` encoded using Python's *punycode* encoding with hyphens "
64+
"replaced by underscores. In Python::"
6465
msgstr ""
6566
"對於僅包含 ASCII 名稱的模組,函式必須以 ``PyInit_<modulename>`` 命名,其中 "
6667
"``<modulename>`` 要替換為模組的名稱。當使用 :ref:`multi-phase-"
@@ -107,6 +108,6 @@ msgid ""
107108
"setuptools.html to learn more about how build and distribute C/C++ "
108109
"extensions with setuptools."
109110
msgstr ""
110-
"Python 3.12 與之後的版本不再帶有 distutils。請在 https://"
111-
"setuptools.readthedocs.io/en/latest/setuptools.html 上參閱 ``setuptools`` "
112-
"件,以了解如何使用 setuptools 建置和發佈 C/C++ 擴充套件。"
111+
"Python 3.12 與之後的版本不再帶有 distutils。請在 https://setuptools."
112+
"readthedocs.io/en/latest/setuptools.html 上參閱 ``setuptools`` 文件,以了解如"
113+
"何使用 setuptools 建置和發佈 C/C++ 擴充套件。"

extending/embedding.po

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: Python 3.13\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2025-03-07 15:49+0000\n"
11+
"POT-Creation-Date: 2025-05-27 00:15+0000\n"
1212
"PO-Revision-Date: 2018-05-23 14:09+0000\n"
1313
"Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n"
1414
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -420,62 +420,64 @@ msgid ""
420420
" return PyLong_FromLong(numargs);\n"
421421
"}\n"
422422
"\n"
423-
"static PyMethodDef EmbMethods[] = {\n"
423+
"static PyMethodDef emb_module_methods[] = {\n"
424424
" {\"numargs\", emb_numargs, METH_VARARGS,\n"
425425
" \"Return the number of arguments received by the process.\"},\n"
426426
" {NULL, NULL, 0, NULL}\n"
427427
"};\n"
428428
"\n"
429-
"static PyModuleDef EmbModule = {\n"
430-
" PyModuleDef_HEAD_INIT, \"emb\", NULL, -1, EmbMethods,\n"
431-
" NULL, NULL, NULL, NULL\n"
429+
"static struct PyModuleDef emb_module = {\n"
430+
" .m_base = PyModuleDef_HEAD_INIT,\n"
431+
" .m_name = \"emb\",\n"
432+
" .m_size = 0,\n"
433+
" .m_methods = emb_module_methods,\n"
432434
"};\n"
433435
"\n"
434436
"static PyObject*\n"
435437
"PyInit_emb(void)\n"
436438
"{\n"
437-
" return PyModule_Create(&EmbModule);\n"
439+
" return PyModuleDef_Init(&emb_module);\n"
438440
"}"
439441
msgstr ""
440442

441-
#: ../../extending/embedding.rst:265
443+
#: ../../extending/embedding.rst:267
442444
msgid ""
443445
"Insert the above code just above the :c:func:`main` function. Also, insert "
444446
"the following two statements before the call to :c:func:`Py_Initialize`::"
445447
msgstr ""
446448

447-
#: ../../extending/embedding.rst:268
449+
#: ../../extending/embedding.rst:270
448450
msgid ""
449451
"numargs = argc;\n"
450452
"PyImport_AppendInittab(\"emb\", &PyInit_emb);"
451453
msgstr ""
452454
"numargs = argc;\n"
453455
"PyImport_AppendInittab(\"emb\", &PyInit_emb);"
454456

455-
#: ../../extending/embedding.rst:271
457+
#: ../../extending/embedding.rst:273
456458
msgid ""
457459
"These two lines initialize the ``numargs`` variable, and make the :func:`!"
458460
"emb.numargs` function accessible to the embedded Python interpreter. With "
459461
"these extensions, the Python script can do things like"
460462
msgstr ""
461463

462-
#: ../../extending/embedding.rst:275
464+
#: ../../extending/embedding.rst:277
463465
msgid ""
464466
"import emb\n"
465467
"print(\"Number of arguments\", emb.numargs())"
466468
msgstr ""
467469

468-
#: ../../extending/embedding.rst:280
470+
#: ../../extending/embedding.rst:282
469471
msgid ""
470472
"In a real application, the methods will expose an API of the application to "
471473
"Python."
472474
msgstr ""
473475

474-
#: ../../extending/embedding.rst:290
476+
#: ../../extending/embedding.rst:292
475477
msgid "Embedding Python in C++"
476478
msgstr ""
477479

478-
#: ../../extending/embedding.rst:292
480+
#: ../../extending/embedding.rst:294
479481
msgid ""
480482
"It is also possible to embed Python in a C++ program; precisely how this is "
481483
"done will depend on the details of the C++ system used; in general you will "
@@ -484,19 +486,19 @@ msgid ""
484486
"+."
485487
msgstr ""
486488

487-
#: ../../extending/embedding.rst:301
489+
#: ../../extending/embedding.rst:303
488490
msgid "Compiling and Linking under Unix-like systems"
489491
msgstr ""
490492

491-
#: ../../extending/embedding.rst:303
493+
#: ../../extending/embedding.rst:305
492494
msgid ""
493495
"It is not necessarily trivial to find the right flags to pass to your "
494496
"compiler (and linker) in order to embed the Python interpreter into your "
495497
"application, particularly because Python needs to load library modules "
496498
"implemented as C dynamic extensions (:file:`.so` files) linked against it."
497499
msgstr ""
498500

499-
#: ../../extending/embedding.rst:309
501+
#: ../../extending/embedding.rst:311
500502
msgid ""
501503
"To find out the required compiler and linker flags, you can execute the :"
502504
"file:`python{X.Y}-config` script which is generated as part of the "
@@ -505,13 +507,13 @@ msgid ""
505507
"directly useful to you:"
506508
msgstr ""
507509

508-
#: ../../extending/embedding.rst:315
510+
#: ../../extending/embedding.rst:317
509511
msgid ""
510512
"``pythonX.Y-config --cflags`` will give you the recommended flags when "
511513
"compiling:"
512514
msgstr ""
513515

514-
#: ../../extending/embedding.rst:318
516+
#: ../../extending/embedding.rst:320
515517
msgid ""
516518
"$ /opt/bin/python3.11-config --cflags\n"
517519
"-I/opt/include/python3.11 -I/opt/include/python3.11 -Wsign-compare -DNDEBUG "
@@ -521,13 +523,13 @@ msgstr ""
521523
"-I/opt/include/python3.11 -I/opt/include/python3.11 -Wsign-compare -DNDEBUG "
522524
"-g -fwrapv -O3 -Wall"
523525

524-
#: ../../extending/embedding.rst:323
526+
#: ../../extending/embedding.rst:325
525527
msgid ""
526528
"``pythonX.Y-config --ldflags --embed`` will give you the recommended flags "
527529
"when linking:"
528530
msgstr ""
529531

530-
#: ../../extending/embedding.rst:326
532+
#: ../../extending/embedding.rst:328
531533
msgid ""
532534
"$ /opt/bin/python3.11-config --ldflags --embed\n"
533535
"-L/opt/lib/python3.11/config-3.11-x86_64-linux-gnu -L/opt/lib -lpython3.11 -"
@@ -537,15 +539,15 @@ msgstr ""
537539
"-L/opt/lib/python3.11/config-3.11-x86_64-linux-gnu -L/opt/lib -lpython3.11 -"
538540
"lpthread -ldl -lutil -lm"
539541

540-
#: ../../extending/embedding.rst:332
542+
#: ../../extending/embedding.rst:334
541543
msgid ""
542544
"To avoid confusion between several Python installations (and especially "
543545
"between the system Python and your own compiled Python), it is recommended "
544546
"that you use the absolute path to :file:`python{X.Y}-config`, as in the "
545547
"above example."
546548
msgstr ""
547549

548-
#: ../../extending/embedding.rst:337
550+
#: ../../extending/embedding.rst:339
549551
msgid ""
550552
"If this procedure doesn't work for you (it is not guaranteed to work for all "
551553
"Unix-like platforms; however, we welcome :ref:`bug reports <reporting-"
@@ -557,7 +559,7 @@ msgid ""
557559
"For example:"
558560
msgstr ""
559561

560-
#: ../../extending/embedding.rst:346
562+
#: ../../extending/embedding.rst:348
561563
msgid ""
562564
">>> import sysconfig\n"
563565
">>> sysconfig.get_config_var('LIBS')\n"

0 commit comments

Comments
 (0)