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

Skip to content

Commit 00624da

Browse files
[po] auto sync
1 parent a14c4ce commit 00624da

3 files changed

Lines changed: 46 additions & 15 deletions

File tree

extending/extending.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# eric R <[email protected]>, 2021
1010
# taotieren <[email protected]>, 2021
1111
# Harry Liu. <[email protected]>, 2021
12-
# Freesand Leo <[email protected]>, 2021
12+
# Freesand Leo <[email protected]>, 2022
1313
#
1414
#, fuzzy
1515
msgid ""
@@ -18,7 +18,7 @@ msgstr ""
1818
"Report-Msgid-Bugs-To: \n"
1919
"POT-Creation-Date: 2021-06-29 12:56+0000\n"
2020
"PO-Revision-Date: 2021-06-28 00:51+0000\n"
21-
"Last-Translator: Freesand Leo <[email protected]>, 2021\n"
21+
"Last-Translator: Freesand Leo <[email protected]>, 2022\n"
2222
"Language-Team: Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n"
2323
"MIME-Version: 1.0\n"
2424
"Content-Type: text/plain; charset=UTF-8\n"
@@ -1099,8 +1099,8 @@ msgid ""
10991099
"gives full owner responsibilities (the new owner must dispose of the "
11001100
"reference properly, as well as the previous owner)."
11011101
msgstr ""
1102-
"借用可以变为拥有引用,通过调用 :c:func:`Py_INCREF` "
1103-
"。这不会影响已经借出的拥有者的状态。这回创建一个新的拥有引用,并给予完全的拥有者责任(新的拥有者必须恰当的处置引用,就像之前的拥有者那样)。"
1102+
"借用可以变为拥有引用,通过调用 :c:func:`Py_INCREF`。 这不会影响已经借出的拥有者的状态。 "
1103+
"这会创建一个新的拥有引用,并给予完全的拥有者责任新的拥有者必须恰当的处置引用,就像之前的拥有者那样。"
11041104

11051105
#: ../../extending/extending.rst:962
11061106
msgid "Ownership Rules"

howto/clinic.po

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# df2dc1c92e792f7ae8417c51df43db8f_594d92a <0f49be28017426edb1db1a2ab6e67088_717605>, 2021
1212
# ppcfish <[email protected]>, 2021
1313
# Dai Xu <[email protected]>, 2022
14+
# Freesand Leo <[email protected]>, 2022
1415
#
1516
#, fuzzy
1617
msgid ""
@@ -19,7 +20,7 @@ msgstr ""
1920
"Report-Msgid-Bugs-To: \n"
2021
"POT-Creation-Date: 2021-06-29 12:56+0000\n"
2122
"PO-Revision-Date: 2021-06-28 00:52+0000\n"
22-
"Last-Translator: Dai Xu <daixu61@hotmail.com>, 2022\n"
23+
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2022\n"
2324
"Language-Team: Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n"
2425
"MIME-Version: 1.0\n"
2526
"Content-Type: text/plain; charset=UTF-8\n"
@@ -417,18 +418,19 @@ msgstr "这些参数行的常规形式如下:"
417418

418419
#: ../../howto/clinic.rst:276
419420
msgid "If the parameter has a default value, add that after the converter:"
420-
msgstr "如果参数带有默认值,请加在转换器之后:"
421+
msgstr "如果参数带有缺省值,请加在转换器之后:"
421422

422423
#: ../../howto/clinic.rst:283
423424
msgid ""
424425
"Argument Clinic's support for \"default values\" is quite sophisticated; "
425426
"please see :ref:`the section below on default values <default_values>` for "
426427
"more information."
427428
msgstr ""
429+
"Argument Clinic 对 “缺省值” 的支持方式相当复杂;更多信息请参见 :ref:`关于缺省值的部分 <default_values>` 。"
428430

429431
#: ../../howto/clinic.rst:287
430432
msgid "Add a blank line below the parameters."
431-
msgstr ""
433+
msgstr "在参数行下面添加一个空行。"
432434

433435
#: ../../howto/clinic.rst:289
434436
msgid ""
@@ -438,6 +440,8 @@ msgid ""
438440
"convenience syntax intended to make porting old code into Argument Clinic "
439441
"easier."
440442
msgstr ""
443+
" “转换器”是什么?它既确定了 C 语言要采用的变量类型,又确定了运行时将 Python 值转换成 C "
444+
"语言值的方法。现在需用到的是所谓“传统转换器”——快捷语法,旨在让旧代码更容易移植到 Argument Clinic。"
441445

442446
#: ../../howto/clinic.rst:296
443447
msgid ""
@@ -448,57 +452,63 @@ msgid ""
448452
"parsing function what the type of the variable is and how to convert it. "
449453
"For more on format units please see :ref:`arg-parsing`.)"
450454
msgstr ""
455+
"每个参数都要从``PyArg_Parse()`` 格式参数中复制其 “格式单元”,并以带引号字符串的形式指定其转换器。(“格式单元”是 "
456+
"``format`` 参数的1-3个字符的正式名称,用于让参数解析函数知晓该变量的类型及转换方法。关于格式单位的更多信息,请参阅 :ref:`arg-"
457+
"parsing` )。"
451458

452459
#: ../../howto/clinic.rst:305
453460
msgid ""
454461
"For multicharacter format units like ``z#``, use the entire two-or-three "
455462
"character string."
456-
msgstr ""
463+
msgstr "对于像 ``z#`` 这样的多字符格式单元,要使用2-3个字符组成的整个字符串。"
457464

458465
#: ../../howto/clinic.rst:323
459466
msgid ""
460467
"If your function has ``|`` in the format string, meaning some parameters "
461468
"have default values, you can ignore it. Argument Clinic infers which "
462469
"parameters are optional based on whether or not they have default values."
463470
msgstr ""
471+
"如果函数的格式字符串包含 ``|``,意味着有些参数带有缺省值,这可以忽略。Argument Clinic 根据参数是否有缺省值来推断哪些参数是可选的。"
464472

465473
#: ../../howto/clinic.rst:328
466474
msgid ""
467475
"If your function has ``$`` in the format string, meaning it takes keyword-"
468476
"only arguments, specify ``*`` on a line by itself before the first keyword-"
469477
"only argument, indented the same as the parameter lines."
470-
msgstr ""
478+
msgstr "如果函数的格式字符串中包含 $,意味着只接受关键字参数,请在第一个关键字参数之前单独给出一行 ``*``,缩进与参数行对齐。"
471479

472480
#: ../../howto/clinic.rst:333
473481
msgid "(``_pickle.Pickler.dump`` has neither, so our sample is unchanged.)"
474-
msgstr ""
482+
msgstr "(``_pickle.Pickler.dump`` 两种格式字符串都没有,所以这里的示例不用改动。)"
475483

476484
#: ../../howto/clinic.rst:336
477485
msgid ""
478486
"If the existing C function calls :c:func:`PyArg_ParseTuple` (as opposed to "
479487
":c:func:`PyArg_ParseTupleAndKeywords`), then all its arguments are "
480488
"positional-only."
481489
msgstr ""
490+
"如果 C 函数调用的是 :c:func:`PyArg_ParseTuple` (而不是 "
491+
":c:func:`PyArg_ParseTupleAndKeywords`),那么其所有参数均是仅限位置参数。"
482492

483493
#: ../../howto/clinic.rst:340
484494
msgid ""
485495
"To mark all parameters as positional-only in Argument Clinic, add a ``/`` on"
486496
" a line by itself after the last parameter, indented the same as the "
487497
"parameter lines."
488-
msgstr ""
498+
msgstr "若要在 Argument Clinic 中把所有参数都标记为只认位置,请在最后一个参数后面一行加入一个 ``/``,缩进程度与参数行对齐。"
489499

490500
#: ../../howto/clinic.rst:344
491501
msgid ""
492502
"Currently this is all-or-nothing; either all parameters are positional-only,"
493503
" or none of them are. (In the future Argument Clinic may relax this "
494504
"restriction.)"
495-
msgstr ""
505+
msgstr "目前这个标记是全体生效;要么所有参数都是只认位置,要么都不是。(以后 Argument Clinic 可能会放宽这一限制。)"
496506

497507
#: ../../howto/clinic.rst:364
498508
msgid ""
499509
"It's helpful to write a per-parameter docstring for each parameter. But per-"
500510
"parameter docstrings are optional; you can skip this step if you prefer."
501-
msgstr ""
511+
msgstr "为每个参数都编写一个文档字符串,这很有意义。但这是可选项;可以跳过这一步。"
502512

503513
#: ../../howto/clinic.rst:368
504514
msgid ""
@@ -509,33 +519,39 @@ msgid ""
509519
"this amount. You can write as much text as you like, across multiple lines "
510520
"if you wish."
511521
msgstr ""
522+
"下面介绍如何添加逐参数的文档字符串。逐参数文档字符串的第一行必须比参数定义多缩进一层。第一行的左边距即确定了所有逐参数文档字符串的左边距;所有文档字符串文本都要同等缩进。文本可以用多行编写。"
512523

513524
#: ../../howto/clinic.rst:392
514525
msgid ""
515526
"Save and close the file, then run ``Tools/clinic/clinic.py`` on it. With "
516527
"luck everything worked---your block now has output, and a ``.c.h`` file has "
517528
"been generated! Reopen the file in your text editor to see::"
518529
msgstr ""
530+
"保存并关闭该文件,然后运行 ``Tools/clinic/clinic.py`` 。 运气好的话就万事大吉——程序块现在有了输出信息,并且生成了一个 "
531+
"``.c.h`` 文件!在文本编辑器中重新打开该文件,可以看到:"
519532

520533
#: ../../howto/clinic.rst:411
521534
msgid ""
522535
"Obviously, if Argument Clinic didn't produce any output, it's because it "
523536
"found an error in your input. Keep fixing your errors and retrying until "
524537
"Argument Clinic processes your file without complaint."
525538
msgstr ""
539+
"显然,如果 Argument Clinic 未产生任何输出,那是因为在输入信息中发现了错误。继续修正错误并重试,直至 Argument Clinic "
540+
"正确地处理好文件。"
526541

527542
#: ../../howto/clinic.rst:415
528543
msgid ""
529544
"For readability, most of the glue code has been generated to a ``.c.h`` "
530545
"file. You'll need to include that in your original ``.c`` file, typically "
531546
"right after the clinic module block::"
532547
msgstr ""
548+
"为了便于阅读,大部分“胶水”代码已写入 ``.c.h`` 文件中。需在原 ``.c`` 文件中包含这个文件,通常是在 clinic 模块之后:"
533549

534550
#: ../../howto/clinic.rst:421
535551
msgid ""
536552
"Double-check that the argument-parsing code Argument Clinic generated looks "
537553
"basically the same as the existing code."
538-
msgstr ""
554+
msgstr "请仔细检查 Argument Clinic 生成的参数解析代码,是否与原有代码基本相同。"
539555

540556
#: ../../howto/clinic.rst:424
541557
msgid ""
@@ -544,13 +560,18 @@ msgid ""
544560
":c:func:`PyArg_ParseTupleAndKeywords`; ensure that the code generated by "
545561
"Argument Clinic calls the *exact* same function."
546562
msgstr ""
563+
"首先,确保两种代码使用相同的参数解析函数。原有代码必须调用 :c:func:`PyArg_ParseTuple` 或 "
564+
":c:func:`PyArg_ParseTupleAndKeywords` ;确保 Argument Clinic 生成的代码调用 *完全* "
565+
"相同的函数。"
547566

548567
#: ../../howto/clinic.rst:430
549568
msgid ""
550569
"Second, the format string passed in to :c:func:`PyArg_ParseTuple` or "
551570
":c:func:`PyArg_ParseTupleAndKeywords` should be *exactly* the same as the "
552571
"hand-written one in the existing function, up to the colon or semi-colon."
553572
msgstr ""
573+
"其次,传给 :c:func:`PyArg_ParseTuple` 或 :c:func:`PyArg_ParseTupleAndKeywords` "
574+
"的格式字符串应该 *完全* 与原有函数中的相同,直到冒号或分号为止。"
554575

555576
#: ../../howto/clinic.rst:435
556577
msgid ""

library/unittest.po

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2389,7 +2389,7 @@ msgstr ":class:`TestLoader` 对象具有下列方法:"
23892389
msgid ""
23902390
"Return a suite of all test cases contained in the :class:`TestCase`\\ "
23912391
"-derived :class:`testCaseClass`."
2392-
msgstr ""
2392+
msgstr "返回一个包含在 :class:`TestCase` 所派生的 :class:`testCaseClass` 中的所有测试用例的测试套件。"
23932393

23942394
#: ../../library/unittest.rst:1756
23952395
msgid ""
@@ -2399,13 +2399,18 @@ msgid ""
23992399
":meth:`runTest` method is implemented, a single test case is created for "
24002400
"that method instead."
24012401
msgstr ""
2402+
"会为每个由 :meth:`getTestCaseNames` 指明的方法创建一个测试用例实例。 在默认情况下这些都是以 ``test`` "
2403+
"开头的方法名称。 如果 :meth:`getTestCaseNames` 不返回任何方法,但 :meth:`runTest` "
2404+
"方法已被实现,则会为该方法创建一个单独的测试用例。"
24022405

24032406
#: ../../library/unittest.rst:1765
24042407
msgid ""
24052408
"Return a suite of all test cases contained in the given module. This method "
24062409
"searches *module* for classes derived from :class:`TestCase` and creates an "
24072410
"instance of the class for each test method defined for the class."
24082411
msgstr ""
2412+
"返回包含在给定模块中的所有测试用例的测试套件。 此方法会在 *module* 中搜索从派生自 :class:`TestCase` "
2413+
"的类并为该类定义的每个测试方法创建一个类实例。"
24092414

24102415
#: ../../library/unittest.rst:1772
24112416
msgid ""
@@ -2415,6 +2420,9 @@ msgid ""
24152420
"play well with this method. Doing so, however, can be useful when the "
24162421
"fixtures are different and defined in subclasses."
24172422
msgstr ""
2423+
"虽然使用 :class:`TestCase` "
2424+
"所派生的类的层级结构可以方便地共享配置和辅助函数,但在不打算直接实例化的基类上定义测试方法并不能很好地配合此方法使用。 "
2425+
"不过,当配置有差异并且定义在子类当中时这样做还是有用处的。"
24182426

24192427
#: ../../library/unittest.rst:1778
24202428
msgid ""
@@ -2423,6 +2431,8 @@ msgid ""
24232431
"`load_tests protocol`_. The *pattern* argument is passed as the third "
24242432
"argument to ``load_tests``."
24252433
msgstr ""
2434+
"如果一个模块提供了 ``load_tests`` 函数则它将被调用以加载测试。 这允许模块自行定制测试加载过程。 这就称为 `load_tests "
2435+
"protocol`_。 *pattern* 参数会被作为传给 ``load_tests`` 的第三个参数。"
24262436

24272437
#: ../../library/unittest.rst:1783
24282438
msgid "Support for ``load_tests`` added."

0 commit comments

Comments
 (0)