Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfbcf378

Browse files
[po] auto sync
1 parent7f4bb2f commitfbcf378

File tree

2 files changed

+46
-6
lines changed

2 files changed

+46
-6
lines changed

‎.stat.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"translation":"81.77%","updated_at":"2025-06-03T14:57:21Z"}
1+
{"translation":"81.78%","updated_at":"2025-06-04T07:55:20Z"}

‎extending/extending.po

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#
66
# Translators:
77
# Rafael Fontenelle <rffontenelle@gmail.com>, 2025
8+
# Freesand Leo <yuqinju@163.com>, 2025
89
#
910
#,fuzzy
1011
msgid ""
@@ -13,7 +14,7 @@ msgstr ""
1314
"Report-Msgid-Bugs-To:\n"
1415
"POT-Creation-Date:2025-05-30 14:58+0000\n"
1516
"PO-Revision-Date:2025-05-08 05:09+0000\n"
16-
"Last-Translator:Rafael Fontenelle <rffontenelle@gmail.com>, 2025\n"
17+
"Last-Translator:Freesand Leo <yuqinju@163.com>, 2025\n"
1718
"Language-Team:Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
1819
"MIME-Version:1.0\n"
1920
"Content-Type:text/plain; charset=UTF-8\n"
@@ -392,34 +393,38 @@ msgid ""
392393
"You can also define a new exception that is unique to your module. The "
393394
"simplest way to do this is to declare a static global object variable at the"
394395
" beginning of the file::"
395-
msgstr""
396+
msgstr"你也可以定义你的模块独有的新异常。 做到这点的最简单方式是在文件的开头声明一个静态全局对象变量::"
396397

397398
#:../../extending/extending.rst:210
398399
msgid"static PyObject *SpamError = NULL;"
399-
msgstr""
400+
msgstr"static PyObject *SpamError = NULL;"
400401

401402
#:../../extending/extending.rst:212
402403
msgid""
403404
"and initialize it by calling :c:func:`PyErr_NewException` in the module's "
404405
":c:data:`Py_mod_exec` function (:c:func:`!spam_module_exec`)::"
405406
msgstr""
407+
"并通过在模块的 :c:data:`Py_mod_exec` 函数 (:c:func:`!spam_module_exec`) 中调用 "
408+
":c:func:`PyErr_NewException` 来初始化它::"
406409

407410
#:../../extending/extending.rst:215
408411
msgid"SpamError = PyErr_NewException(\"spam.error\", NULL, NULL);"
409-
msgstr""
412+
msgstr"SpamError = PyErr_NewException(\"spam.error\", NULL, NULL);"
410413

411414
#:../../extending/extending.rst:217
412415
msgid""
413416
"Since :c:data:`!SpamError` is a global variable, it will be overwitten every"
414417
" time the module is reinitialized, when the :c:data:`Py_mod_exec` function "
415418
"is called."
416419
msgstr""
420+
"由于 :c:data:`!SpamError` 是一个全局变量,它将在模块每次重新初始化时被覆盖,即当 :c:data:`Py_mod_exec` "
421+
"函数被调用时。"
417422

418423
#:../../extending/extending.rst:220
419424
msgid""
420425
"For now, let's avoid the issue: we will block repeated initialization by "
421426
"raising an :py:exc:`ImportError`::"
422-
msgstr""
427+
msgstr"对于现在,让我们来避免这个问题:我们将通过引发 :py:exc:`ImportError` 来阻止重复的初始化::"
423428

424429
#:../../extending/extending.rst:223
425430
msgid""
@@ -459,6 +464,41 @@ msgid ""
459464
" return PyModuleDef_Init(&spam_module);\n"
460465
"}"
461466
msgstr""
467+
"static PyObject *SpamError = NULL;\n"
468+
"\n"
469+
"static int\n"
470+
"spam_module_exec(PyObject *m)\n"
471+
"{\n"
472+
" if (SpamError != NULL) {\n"
473+
" PyErr_SetString(PyExc_ImportError,\n"
474+
"\"cannot initialize spam module more than once\");\n"
475+
" return -1;\n"
476+
" }\n"
477+
" SpamError = PyErr_NewException(\"spam.error\", NULL, NULL);\n"
478+
" if (PyModule_AddObjectRef(m,\"SpamError\", SpamError) < 0) {\n"
479+
" return -1;\n"
480+
" }\n"
481+
"\n"
482+
" return 0;\n"
483+
"}\n"
484+
"\n"
485+
"static PyModuleDef_Slot spam_module_slots[] = {\n"
486+
" {Py_mod_exec, spam_module_exec},\n"
487+
" {0, NULL}\n"
488+
"};\n"
489+
"\n"
490+
"static struct PyModuleDef spam_module = {\n"
491+
" .m_base = PyModuleDef_HEAD_INIT,\n"
492+
" .m_name =\"spam\",\n"
493+
" .m_size = 0, // non-negative\n"
494+
" .m_slots = spam_module_slots,\n"
495+
"};\n"
496+
"\n"
497+
"PyMODINIT_FUNC\n"
498+
"PyInit_spam(void)\n"
499+
"{\n"
500+
" return PyModuleDef_Init(&spam_module);\n"
501+
"}"
462502

463503
#:../../extending/extending.rst:259
464504
msgid""

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp