@@ -11,7 +11,7 @@ msgid ""
1111msgstr ""
1212"Project-Id-Version : Python 3.10\n "
1313"Report-Msgid-Bugs-To : \n "
14- "POT-Creation-Date : 2023-07-29 03:05 +0000\n "
14+ "POT-Creation-Date : 2023-11-24 18:59 +0000\n "
1515"PO-Revision-Date : 2022-11-05 17:21+0000\n "
1616"
Last-Translator :
Rafael Fontenelle <[email protected] >, 2023\n "
1717"Language-Team : Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
@@ -211,14 +211,16 @@ msgstr ""
211211msgid ""
212212"Read a code point from a canonical representation *data* (as obtained with "
213213":c:func:`PyUnicode_DATA`). No checks or ready calls are performed."
214- msgstr ""
214+ msgstr "从规范表示的 *data* (如同用 :c:func:`PyUnicode_DATA` 获取) 中读取一个码位。 不会执行检查或就绪调用。 "
215215
216216#: ../../c-api/unicode.rst:194
217217msgid ""
218218"Read a character from a Unicode object *o*, which must be in the "
219219"\" canonical\" representation. This is less efficient than "
220220":c:func:`PyUnicode_READ` if you do multiple consecutive reads."
221221msgstr ""
222+ "从 Unicode 对象 *o* 读取一个字符,必须使用“规范”表示形式。 如果你执行行多次连续读取则此函数的效率将低于 "
223+ ":c:func:`PyUnicode_READ`。"
222224
223225#: ../../c-api/unicode.rst:203
224226msgid ""
@@ -282,7 +284,7 @@ msgstr "如果字符串按照语言定义是合法的标识符则返回 ``1``,
282284msgid ""
283285"The function does not call :c:func:`Py_FatalError` anymore if the string is "
284286"not ready."
285- msgstr ""
287+ msgstr "如果字符串尚未就绪则此函数不会再调用 :c:func:`Py_FatalError`。 "
286288
287289#: ../../c-api/unicode.rst:264
288290msgid "Unicode Character Properties"
@@ -355,27 +357,31 @@ msgid ""
355357"invoked on a string. It has no bearing on the handling of strings written to"
356358" :data:`sys.stdout` or :data:`sys.stderr`.)"
357359msgstr ""
360+ "根据 *ch* 是否为可打印字符返回 ``1`` 或``0``。 不可打印字符是指在 Unicode 字符数据库中被定义为 \" Other\" 或 "
361+ "\" Separator\" 的字符,例外情况是 ASCII 空格 (0x20) 被视为可打印字符。 (请注意在此语境下可打印字符是指当在字符串上发起调用"
362+ " :func:`repr` 时不应被转义的字符。 它们字符串写入 :data:`sys.stdout` 或 :data:`sys.stderr` "
363+ "时所需的处理无关)。"
358364
359365#: ../../c-api/unicode.rst:332
360366msgid "These APIs can be used for fast direct character conversions:"
361- msgstr ""
367+ msgstr "这些 API 可用于快速直接的字符转换: "
362368
363369#: ../../c-api/unicode.rst:337
364370msgid "Return the character *ch* converted to lower case."
365- msgstr ""
371+ msgstr "返回转换为小写形式的字符 *ch*。 "
366372
367373#: ../../c-api/unicode.rst:339 ../../c-api/unicode.rst:347
368374#: ../../c-api/unicode.rst:355
369375msgid "This function uses simple case mappings."
370- msgstr ""
376+ msgstr "此函数使用简单的大小写映射。 "
371377
372378#: ../../c-api/unicode.rst:345
373379msgid "Return the character *ch* converted to upper case."
374- msgstr ""
380+ msgstr "返回转换为大写形式的字符 *ch*。 "
375381
376382#: ../../c-api/unicode.rst:353
377383msgid "Return the character *ch* converted to title case."
378- msgstr ""
384+ msgstr "返回转换为标题大小写形式的字符 *ch*。 "
379385
380386#: ../../c-api/unicode.rst:361
381387msgid ""
@@ -397,19 +403,19 @@ msgstr ""
397403
398404#: ../../c-api/unicode.rst:377
399405msgid "These APIs can be used to work with surrogates:"
400- msgstr ""
406+ msgstr "这些 API 可被用来操作代理项: "
401407
402408#: ../../c-api/unicode.rst:381
403409msgid "Check if *ch* is a surrogate (``0xD800 <= ch <= 0xDFFF``)."
404- msgstr ""
410+ msgstr "检测 *ch* 是否为代理项 (``0xD800 <= ch <= 0xDFFF``)。 "
405411
406412#: ../../c-api/unicode.rst:385
407413msgid "Check if *ch* is a high surrogate (``0xD800 <= ch <= 0xDBFF``)."
408- msgstr ""
414+ msgstr "检测 *ch* 是否为高代理项 (``0xD800 <= ch <= 0xDBFF``)。 "
409415
410416#: ../../c-api/unicode.rst:389
411417msgid "Check if *ch* is a low surrogate (``0xDC00 <= ch <= 0xDFFF``)."
412- msgstr ""
418+ msgstr "检测 *ch* 是否为低代理项 (``0xDC00 <= ch <= 0xDFFF``)。 "
413419
414420#: ../../c-api/unicode.rst:393
415421msgid ""
@@ -420,26 +426,28 @@ msgstr ""
420426
421427#: ../../c-api/unicode.rst:399
422428msgid "Creating and accessing Unicode strings"
423- msgstr ""
429+ msgstr "创建和访问 Unicode 字符串 "
424430
425431#: ../../c-api/unicode.rst:401
426432msgid ""
427433"To create Unicode objects and access their basic sequence properties, use "
428434"these APIs:"
429- msgstr ""
435+ msgstr "要创建 Unicode 对象和访问其基本序列属性,请使用这些 API: "
430436
431437#: ../../c-api/unicode.rst:406
432438msgid ""
433439"Create a new Unicode object. *maxchar* should be the true maximum code "
434440"point to be placed in the string. As an approximation, it can be rounded up"
435441" to the nearest value in the sequence 127, 255, 65535, 1114111."
436442msgstr ""
443+ "创建一个新的 Unicode 对象。 *maxchar* 应为可放入字符串的实际最大码位。 作为一个近似值,它可被向上舍入到序列 127, 255, "
444+ "65535, 1114111 中最接近的值。"
437445
438446#: ../../c-api/unicode.rst:410
439447msgid ""
440448"This is the recommended way to allocate a new Unicode object. Objects "
441449"created using this function are not resizable."
442- msgstr ""
450+ msgstr "这是分配新的 Unicode 对象的推荐方式。 使用此函数创建的对象不可改变大小。 "
443451
444452#: ../../c-api/unicode.rst:419
445453msgid ""
@@ -448,6 +456,9 @@ msgid ""
448456":c:func:`PyUnicode_KIND`). The *buffer* must point to an array of *size* "
449457"units of 1, 2 or 4 bytes per character, as given by the kind."
450458msgstr ""
459+ "以给定的 *kind* 创建一个新的 Unicode 对象(可能的值为 :c:macro:`PyUnicode_1BYTE_KIND` 等,即 "
460+ ":c:func:`PyUnicode_KIND` 所返回的值)。 *buffer* 必须指向由此分类所给出的,以每字符 1, 2 或 4 字节单位的 "
461+ "*size* 大小的数组。"
451462
452463#: ../../c-api/unicode.rst:429
453464msgid ""
@@ -469,7 +480,7 @@ msgstr ""
469480msgid ""
470481"Create a Unicode object from a UTF-8 encoded null-terminated char buffer "
471482"*u*."
472- msgstr ""
483+ msgstr "根据 UTF-8 编码的以空值结束的字符缓冲区 *u* 创建一个 Unicode 对象。 "
473484
474485#: ../../c-api/unicode.rst:447
475486msgid ""
@@ -713,22 +724,24 @@ msgid ""
713724"array as a second parameter (which will be used, if the first parameter is "
714725"``NULL``)."
715726msgstr ""
727+ "一个 Unicode 对象 (可以为 ``NULL``) 和一个以空值结束的 C 字符数组作为第二个形参(如果第一个形参为 "
728+ "``NULL``,第二个形参将被使用)。"
716729
717730#: ../../c-api/unicode.rst:531
718731msgid ":attr:`%S`"
719732msgstr ":attr:`%S`"
720733
721734#: ../../c-api/unicode.rst:531
722735msgid "The result of calling :c:func:`PyObject_Str`."
723- msgstr ""
736+ msgstr "调用 :c:func:`PyObject_Str` 的结果。 "
724737
725738#: ../../c-api/unicode.rst:534
726739msgid ":attr:`%R`"
727740msgstr ":attr:`%R`"
728741
729742#: ../../c-api/unicode.rst:534
730743msgid "The result of calling :c:func:`PyObject_Repr`."
731- msgstr ""
744+ msgstr "调用 :c:func:`PyObject_Repr` 的结果。 "
732745
733746#: ../../c-api/unicode.rst:538
734747msgid ""
@@ -753,27 +766,27 @@ msgstr ""
753766
754767#: ../../c-api/unicode.rst:551
755768msgid "Support for ``\" %lld\" `` and ``\" %llu\" `` added."
756- msgstr ""
769+ msgstr "增加了对 `` \" %lld \" `` 和 `` \" %llu \" `` 的支持。 "
757770
758771#: ../../c-api/unicode.rst:554
759772msgid "Support for ``\" %li\" ``, ``\" %lli\" `` and ``\" %zi\" `` added."
760- msgstr ""
773+ msgstr "增加了对 `` \" %li \" ``, `` \" %lli \" `` 和 `` \" %zi \" `` 的支持。 "
761774
762775#: ../../c-api/unicode.rst:557
763776msgid ""
764777"Support width and precision formatter for ``\" %s\" ``, ``\" %A\" ``, "
765778"``\" %U\" ``, ``\" %V\" ``, ``\" %S\" ``, ``\" %R\" `` added."
766- msgstr ""
779+ msgstr "增加了对 `` \" %s \" ``, `` \" %A \" ``, `` \" %U \" ``, `` \" %V \" ``, `` \" %S \" ``, `` \" %R \" `` 的宽度和精度格式符支持。 "
767780
768781#: ../../c-api/unicode.rst:564
769782msgid ""
770783"Identical to :c:func:`PyUnicode_FromFormat` except that it takes exactly two"
771784" arguments."
772- msgstr ""
785+ msgstr "等同于 :c:func:`PyUnicode_FromFormat` 但它将接受恰好两个参数。 "
773786
774787#: ../../c-api/unicode.rst:571
775788msgid "Decode an encoded object *obj* to a Unicode object."
776- msgstr ""
789+ msgstr "将一个已编码的对象 *obj* 解码为 Unicode 对象。 "
777790
778791#: ../../c-api/unicode.rst:573
779792msgid ""
@@ -782,22 +795,25 @@ msgid ""
782795" the error handling defined by *errors*. Both can be ``NULL`` to have the "
783796"interface use the default values (see :ref:`builtincodecs` for details)."
784797msgstr ""
798+ ":class:`bytes`, :class:`bytearray` 和其他 :term:`字节类对象 <bytes-like object>` "
799+ "将按照给定的 *encoding* 来解码并使用由 *errors* 定义的错误处理方式。 两者均可为 ``NULL`` 即让接口使用默认值(请参阅 "
800+ ":ref:`builtincodecs` 了解详情)。"
785801
786802#: ../../c-api/unicode.rst:579
787803msgid ""
788804"All other objects, including Unicode objects, cause a :exc:`TypeError` to be"
789805" set."
790- msgstr ""
806+ msgstr "所有其他对象,包括 Unicode 对象,都将导致设置 :exc:`TypeError`。 "
791807
792808#: ../../c-api/unicode.rst:582
793809msgid ""
794810"The API returns ``NULL`` if there was an error. The caller is responsible "
795811"for decref'ing the returned objects."
796- msgstr ""
812+ msgstr "如有错误该 API 将返回 ``NULL``。 调用方要负责递减指向所返回对象的引用。 "
797813
798814#: ../../c-api/unicode.rst:588
799815msgid "Return the length of the Unicode object, in code points."
800- msgstr ""
816+ msgstr "返回 Unicode 对象码位的长度。 "
801817
802818#: ../../c-api/unicode.rst:599
803819msgid ""
@@ -811,33 +827,35 @@ msgstr ""
811827msgid ""
812828"Fill a string with a character: write *fill_char* into "
813829"``unicode[start:start+length]``."
814- msgstr ""
830+ msgstr "使用一个字符填充字符串:将 *fill_char* 写入 ``unicode[start:start+length]``。 "
815831
816832#: ../../c-api/unicode.rst:613
817833msgid ""
818834"Fail if *fill_char* is bigger than the string maximum character, or if the "
819835"string has more than 1 reference."
820- msgstr ""
836+ msgstr "如果 *fill_char* 值大于字符串最大字符值,或者如果字符串有 1 以上的引用将执行失败。 "
821837
822838#: ../../c-api/unicode.rst:616
823839msgid ""
824840"Return the number of written character, or return ``-1`` and raise an "
825841"exception on error."
826- msgstr ""
842+ msgstr "返回写入的字符数量,或者在出错时返回 ``-1`` 并引发一个异常。 "
827843
828844#: ../../c-api/unicode.rst:625
829845msgid ""
830846"Write a character to a string. The string must have been created through "
831847":c:func:`PyUnicode_New`. Since Unicode strings are supposed to be "
832848"immutable, the string must not be shared, or have been hashed yet."
833849msgstr ""
850+ "将一个字符写入到字符串。 字符串必须通过 :c:func:`PyUnicode_New` 创建。 由于 Unicode "
851+ "字符串应当是不可变的,因此该字符串不能被共享,或是被哈希。"
834852
835853#: ../../c-api/unicode.rst:629
836854msgid ""
837855"This function checks that *unicode* is a Unicode object, that the index is "
838856"not out of bounds, and that the object can be modified safely (i.e. that it "
839857"its reference count is one)."
840- msgstr ""
858+ msgstr "该函数将检查 *unicode* 是否为 Unicode 对象,索引是否未越界,并且对象是否可被安全地修改(即其引用计数为一)。 "
841859
842860#: ../../c-api/unicode.rst:638
843861msgid ""
@@ -850,7 +868,7 @@ msgstr ""
850868msgid ""
851869"Return a substring of *str*, from character index *start* (included) to "
852870"character index *end* (excluded). Negative indices are not supported."
853- msgstr ""
871+ msgstr "返回 *str* 的一个子串,从字符索引 *start* (包括) 到字符索引 *end* (不包括)。 不支持负索引号。 "
854872
855873#: ../../c-api/unicode.rst:657
856874msgid ""
@@ -859,6 +877,8 @@ msgid ""
859877"particular, a :exc:`SystemError` if *buflen* is smaller than the length of "
860878"*u*). *buffer* is returned on success."
861879msgstr ""
880+ "将字符串 *u* 拷贝到一个 UCS4 缓冲区,包括一个空字符,如果设置了 *copy_null* 的话。 出错时返回 ``NULL`` "
881+ "并设置一个异常(特别是当 *buflen* 小于 *u* 的长度时,:exc:`SystemError` 将被设置)。 成功时返回 *buffer*。"
862882
863883#: ../../c-api/unicode.rst:667
864884msgid ""
@@ -965,7 +985,7 @@ msgstr ""
965985#: ../../c-api/unicode.rst:765
966986msgid ""
967987"Objects other than Unicode or its subtypes will cause a :exc:`TypeError`."
968- msgstr ""
988+ msgstr "非 Unicode 或其子类型的对象将导致 :exc:`TypeError`。 "
969989
970990#: ../../c-api/unicode.rst:769
971991msgid "Locale Encoding"
@@ -2001,12 +2021,12 @@ msgid ""
20012021"Intern the argument *\\ *string* in place. The argument must be the address "
20022022"of a pointer variable pointing to a Python Unicode string object. If there "
20032023"is an existing interned string that is the same as *\\ *string*, it sets "
2004- "*\\ *string* to it (decrementing the reference count of the old string object"
2005- " and incrementing the reference count of the interned string object), "
2006- "otherwise it leaves *\\ *string* alone and interns it (incrementing its "
2007- "reference count ). (Clarification: even though there is a lot of talk about "
2008- "reference counts , think of this function as reference-count- neutral; you own"
2009- " the object after the call if and only if you owned it before the call.)"
2024+ "*\\ *string* to it (releasing the reference to the old string object and "
2025+ "creating a new :term:`strong reference` to the interned string object), "
2026+ "otherwise it leaves *\\ *string* alone and interns it (creating a new "
2027+ ":term:`strong reference` ). (Clarification: even though there is a lot of "
2028+ "talk about references , think of this function as reference-neutral; you own "
2029+ "the object after the call if and only if you owned it before the call.)"
20102030msgstr ""
20112031
20122032#: ../../c-api/unicode.rst:1728
0 commit comments