Skip to content

Commit 40713b8

Browse files
committed
Translate fuzzy entries from upstream sync
Translated 34 fuzzy entries across 11 files introduced by the upstream sync with CPython. Key changes include: - c-api/typehints: Update code example string (PEP 585 → generic type) - library/constants: :data: → :class: for NoneType/EllipsisType/NotImplementedType - library/io: Translate new RawIOBase.read() paragraph split + update EOF conditions - library/math: Update frexp() description for finite nonzero number case - library/ssl: Fix TLSv1_2/TLSv1_3 code example; split SSLSocket sentence - library/stdtypes: Fix wrong cross-references (join/rsplit, not find/rindex) - library/typing: "compatible" → "assignable"; ABC → 協定 for protocol classes - library/urllib.request: Update example URLs from http:// to https:// - library/zipfile: Update security warning text; fix path traversal example - sphinx: Add full-width colon to "其他資源:" - whatsnew/3.10: :data: → :class: for reintroduced type classes
1 parent 80be7c7 commit 40713b8

11 files changed

Lines changed: 56 additions & 89 deletions

File tree

c-api/typehints.po

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ msgid "Here's an example of how to make an extension type generic::"
6262
msgstr "以下是個讓一個擴充型別泛用化 (generic) 的例子: ::"
6363

6464
#: ../../c-api/typehints.rst:30
65-
#, fuzzy
6665
msgid ""
6766
"...\n"
6867
"static PyMethodDef my_obj_methods[] = {\n"
@@ -77,8 +76,8 @@ msgstr ""
7776
"static PyMethodDef my_obj_methods[] = {\n"
7877
" // 其他方法。\n"
7978
" ...\n"
80-
" {\"__class_getitem__\", Py_GenericAlias, METH_O|METH_CLASS, \"See PEP "
81-
"585\"}\n"
79+
" {\"__class_getitem__\", Py_GenericAlias, METH_O|METH_CLASS, \"my_obj is "
80+
"generic over its contained type\"}\n"
8281
" ...\n"
8382
"}"
8483

library/constants.po

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,17 @@ msgstr ""
4545
"出 :exc:`SyntaxError`。"
4646

4747
#: ../../library/constants.rst:22
48-
#, fuzzy
4948
msgid ""
5049
"An object frequently used to represent the absence of a value, as when "
5150
"default arguments are not passed to a function. Assignments to ``None`` are "
5251
"illegal and raise a :exc:`SyntaxError`. ``None`` is the sole instance of "
5352
"the :class:`~types.NoneType` type."
5453
msgstr ""
55-
"型別 ``NoneType`` 的唯一值。``None`` 經常被使用來表達缺少值,例如未傳送預設的"
56-
"引數至函式時,相對應參數即會被賦予 ``None``。對於 ``None`` 的賦值是不合法的,"
57-
"並且會拋出 :exc:`SyntaxError`。``None`` 是型別 :data:`~types.NoneType` 的唯一"
58-
"實例。"
54+
"一個經常被使用來表達缺少值的物件,例如未傳送預設的引數至函式時。對於 "
55+
"``None`` 的賦值是不合法的,並且會引發 :exc:`SyntaxError`。``None`` 是 :class:"
56+
"`~types.NoneType` 型別的唯一實例。"
5957

6058
#: ../../library/constants.rst:30
61-
#, fuzzy
6259
msgid ""
6360
"A special value which should be returned by the binary special methods (e."
6461
"g. :meth:`~object.__eq__`, :meth:`~object.__lt__`, :meth:`~object.__add__`, :"
@@ -74,7 +71,7 @@ msgstr ""
7471
"傳的特殊值,代表著該運算沒有針對其他型別的實作。同理也可以被原地二元特殊方法 "
7572
"(in-place binary special methods) (如::meth:`~object.__imul__`、:meth:"
7673
"`~object.__iand__` 等)回傳。它不應該被作為 boolean(布林)來解讀。:data:`!"
77-
"NotImplemented` 是型別 :data:`types.NotImplementedType` 的唯一實例。"
74+
"NotImplemented` 是 :class:`types.NotImplementedType` 型別的唯一實例。"
7875

7976
#: ../../library/constants.rst:40
8077
msgid ""
@@ -122,7 +119,6 @@ msgstr ""
122119
"`DeprecationWarning`"
123120

124121
#: ../../library/constants.rst:68
125-
#, fuzzy
126122
msgid ""
127123
"The same as the ellipsis literal \"``...``\", an object frequently used to "
128124
"indicate that something is omitted. Assignment to ``Ellipsis`` is possible, "
@@ -131,7 +127,7 @@ msgid ""
131127
msgstr ""
132128
"與刪節號 \"``...``\" 字面相同,是一個經常被用來表示某些東西被省略的物件。對"
133129
"於 ``Ellipsis`` 的賦值是可能的,但對於 ``...`` 的賦值會引發 :exc:"
134-
"`SyntaxError`。``Ellipsis`` 是型別 :data:`types.EllipsisType` 的唯一實例。"
130+
"`SyntaxError`。``Ellipsis`` 是 :class:`types.EllipsisType` 型別的唯一實例。"
135131

136132
#: ../../library/constants.rst:76
137133
msgid ""

library/io.po

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -884,26 +884,23 @@ msgid ""
884884
msgstr ":class:`RawIOBase` 除了 :class:`IOBase` 的方法外,還提供以下這些方法:"
885885

886886
#: ../../library/io.rst:496
887-
#, fuzzy
888887
msgid ""
889888
"Read up to *size* bytes from the object and return them. As a convenience, "
890889
"if *size* is unspecified or -1, all bytes until EOF are returned."
891890
msgstr ""
892891
"從物件中讀取最多 *size* 個位元組並回傳。方便起見,如果 *size* 未指定或為 -1,"
893-
"則回傳直到檔案結尾 (EOF) 的所有位元組。否則,只會進行一次系統呼叫。如果作業系"
894-
"統呼叫回傳的位元組少於 *size*,則可能回傳少於 *size* 的位元組。"
892+
"則回傳直到檔案結尾 (EOF) 的所有位元組。"
895893

896894
#: ../../library/io.rst:499
897-
#, fuzzy
898895
msgid ""
899896
"Attempts to make only one system call but will retry if interrupted and the "
900897
"signal handler does not raise an exception (see :pep:`475` for the "
901898
"rationale). This means fewer than *size* bytes may be returned if the "
902899
"operating system call returns fewer than *size* bytes."
903900
msgstr ""
904-
"從物件中讀取最多 *size* 個位元組並回傳。方便起見,如果 *size* 未指定或為 -1,"
905-
"則回傳直到檔案結尾 (EOF) 的所有位元組。否則,只會進行一次系統呼叫。如果作業系"
906-
"統呼叫回傳的位元組少於 *size*,則可能回傳少於 *size* 的位元組。"
901+
"嘗試只進行一次系統呼叫,但若被中斷且訊號處理器未引發例外,則會重試(請參閱 :"
902+
"pep:`475` 的原因說明)。這意味著如果作業系統呼叫回傳的位元組少於 *size*,則可"
903+
"能回傳少於 *size* 的位元組。"
907904

908905
#: ../../library/io.rst:504
909906
msgid ""
@@ -926,17 +923,15 @@ msgid ""
926923
msgstr "讀取並回傳串流中直到檔案結尾的所有位元組,必要時使用多次對串流的呼叫。"
927924

928925
#: ../../library/io.rst:516
929-
#, fuzzy
930926
msgid ""
931927
"If ``0`` bytes are returned this indicates end of file. If the object is in "
932928
"non-blocking mode and the underlying :meth:`read` returns ``None`` "
933929
"indicating no bytes are available, ``None`` is returned."
934930
msgstr ""
935-
"如果回傳了 0 位元組,且 *size* 不是 0,這表示檔案結尾 (end of file)。如果物件"
936-
"處於非阻塞模式且沒有可用的位元組,則回傳 ``None``。"
931+
"如果回傳了 ``0`` 個位元組,這表示檔案結尾 (end of file)。如果物件處於非阻塞模"
932+
"式且底層的 :meth:`read` 回傳 ``None`` 表示沒有可用的位元組,則回傳 ``None``。"
937933

938934
#: ../../library/io.rst:522
939-
#, fuzzy
940935
msgid ""
941936
"Read bytes into a pre-allocated, writable :term:`bytes-like object` *b*, and "
942937
"return the number of bytes read. For example, *b* might be a :class:"
@@ -946,14 +941,13 @@ msgstr ""
946941
"讀取的位元組數量。例如,*b* 可能是一個 :class:`bytearray`。"
947942

948943
#: ../../library/io.rst:526
949-
#, fuzzy
950944
msgid ""
951945
"If ``0`` is returned and ``len(b)`` is not ``0``, this indicates end of "
952946
"file. If the object is in non-blocking mode and no bytes are available, "
953947
"``None`` is returned."
954948
msgstr ""
955-
"如果回傳了 0 位元組,且 *size* 不是 0,這表示檔案結尾 (end of file)。如果物件"
956-
"處於非阻塞模式且沒有可用的位元組,則回傳 ``None``。"
949+
"如果回傳了 ``0`` 且 ``len(b)`` 不是 ``0``,這表示檔案結尾 (end of file)。如果"
950+
"物件處於非阻塞模式且沒有可用的位元組,則回傳 ``None``。"
957951

958952
#: ../../library/io.rst:532
959953
msgid ""

library/math.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -878,17 +878,17 @@ msgstr ""
878878
"``copysign(1.0, -0.0)`` 回傳 *-1.0*。"
879879

880880
#: ../../library/math.rst:324
881-
#, fuzzy
882881
msgid ""
883882
"Return the mantissa and exponent of *x* as the pair ``(m, e)``. If *x* is a "
884883
"finite nonzero number, then *m* is a float with ``0.5 <= abs(m) < 1.0`` and "
885884
"an integer *e* is such that ``x == m * 2**e`` exactly. Else, return ``(x, "
886885
"0)``. This is used to \"pick apart\" the internal representation of a float "
887886
"in a portable way."
888887
msgstr ""
889-
"以 ``(m, e)`` 對的格式回傳 *x* 的尾數 *m* 及指數 *e*。*m* 是浮點數而 *e* 是整"
890-
"數,且兩者精確地使 ``x == m * 2**e``。若 *x* 為零,回傳 ``(0.0, 0)``,否則令 "
891-
"``0.5 <= abs(m) < 1``。此函式用於以可攜的方式「分割」浮點數內部表示法。"
888+
"以 ``(m, e)`` 對的格式回傳 *x* 的尾數 *m* 及指數 *e*。若 *x* 是有限的非零數,"
889+
"則 *m* 是一個浮點數且 ``0.5 <= abs(m) < 1.0``,整數 *e* 使得 ``x == m * "
890+
"2**e`` 完全成立。否則,回傳 ``(x, 0)``。此函式用於以可攜的方式「分割」浮點數"
891+
"內部表示法。"
892892

893893
#: ../../library/math.rst:331
894894
msgid ""

library/ssl.po

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,12 @@ msgstr ""
255255
"`SSLContext.load_verify_locations` 一樣。如果三個值都是 :const:`None`,此函式"
256256
"會自動選擇系統預設的 CA 憑證。"
257257

258-
# Skylull: `high encryption cipher` 可能是指 https://superuser.com/questions/1751902/how-to-check-which-ciphers-are-included-in-high-ciphers-constant
258+
# Skylull: `high encryption cipher` 可能是指
259+
# https://superuser.com/questions/1751902/how-to-check-which-ciphers-are-
260+
# included-in-high-ciphers-constant
259261
# 其文中表示可能是指 128bit 以上 key length 的加密算法,需要其他來源佐證。
260-
# 或是 https://help.fortinet.com/fweb/582/Content/FortiWeb/fortiweb-admin/supported_cipher_suites.htm#ssl_414712646_1189301
262+
# 或是 https://help.fortinet.com/fweb/582/Content/FortiWeb/fortiweb-
263+
# admin/supported_cipher_suites.htm#ssl_414712646_1189301
261264
#: ../../library/ssl.rst:143
262265
msgid ""
263266
"The settings are: :data:`PROTOCOL_TLS_CLIENT` or :data:"
@@ -1530,14 +1533,13 @@ msgstr ""
15301533
"wrap_socket` 來包裝 socket。"
15311534

15321535
#: ../../library/ssl.rst:1100
1533-
#, fuzzy
15341536
msgid ""
15351537
":class:`SSLSocket` instances must be created with :meth:`~SSLContext."
15361538
"wrap_socket`. In earlier versions, it was possible to create instances "
15371539
"directly. This was never documented or officially supported."
15381540
msgstr ""
15391541
":class:`SSLSocket` 實例必須使用 :meth:`~SSLContext.wrap_socket` 建立。在較早"
1540-
"的版本中可以直接建立實例,但這從未被記錄或正式支援。"
1542+
"的版本中,可以直接建立實例。這從未被記錄或正式支援。"
15411543

15421544
#: ../../library/ssl.rst:1106
15431545
msgid ""
@@ -3933,14 +3935,13 @@ msgid ""
39333935
msgstr ""
39343936

39353937
#: ../../library/ssl.rst:2755
3936-
#, fuzzy
39373938
msgid ""
39383939
">>> client_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)\n"
39393940
">>> client_context.minimum_version = ssl.TLSVersion.TLSv1_2\n"
39403941
">>> client_context.maximum_version = ssl.TLSVersion.TLSv1_3"
39413942
msgstr ""
39423943
">>> client_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)\n"
3943-
">>> client_context.minimum_version = ssl.TLSVersion.TLSv1_3\n"
3944+
">>> client_context.minimum_version = ssl.TLSVersion.TLSv1_2\n"
39443945
">>> client_context.maximum_version = ssl.TLSVersion.TLSv1_3"
39453946

39463947
#: ../../library/ssl.rst:2760

library/stdtypes.po

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4166,9 +4166,8 @@ msgstr ""
41664166
"['foo ']"
41674167

41684168
#: ../../library/stdtypes.rst:2660
4169-
#, fuzzy
41704169
msgid "See also :meth:`join` and :meth:`rsplit`."
4171-
msgstr "另請參閱 :meth:`find` 和 :meth:`rindex`。"
4170+
msgstr "另請參閱 :meth:`join` 和 :meth:`rsplit`。"
41724171

41734172
#: ../../library/stdtypes.rst:2668
41744173
msgid ""

library/typing.po

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,14 +1302,13 @@ msgid "The :data:`Any` type"
13021302
msgstr ":data:`Any` 型別"
13031303

13041304
#: ../../library/typing.rst:721
1305-
#, fuzzy
13061305
msgid ""
13071306
"A special kind of type is :data:`Any`. A static type checker will treat "
13081307
"every type as assignable to :data:`Any` and :data:`Any` as assignable to "
13091308
"every type."
13101309
msgstr ""
1311-
":data:`Any` 是一種特別的型別。一個靜態型別檢查器會將每個型別視為可相容於 :"
1312-
"data:`Any` 且 :data:`Any` 也可以相容於每個型別。"
1310+
":data:`Any` 是一種特別的型別。靜態型別檢查器會將每個型別視為可賦值給 :data:"
1311+
"`Any`且 :data:`Any` 也可賦值給每個型別。"
13131312

13141313
#: ../../library/typing.rst:725
13151314
msgid ""
@@ -1542,14 +1541,12 @@ msgid "Special type indicating an unconstrained type."
15421541
msgstr "特別型別,指出一個不受約束 (unconstrained) 的型別。"
15431542

15441543
#: ../../library/typing.rst:854
1545-
#, fuzzy
15461544
msgid "Every type is assignable to :data:`Any`."
1547-
msgstr "所有型別皆與 :data:`Any` 相容。"
1545+
msgstr "所有型別皆可賦值給 :data:`Any`。"
15481546

15491547
#: ../../library/typing.rst:855
1550-
#, fuzzy
15511548
msgid ":data:`Any` is assignable to every type."
1552-
msgstr ":data:`Any` 相容於所有型別。"
1549+
msgstr ":data:`Any` 可賦值給所有型別。"
15531550

15541551
#: ../../library/typing.rst:857
15551552
msgid ""
@@ -2292,17 +2289,16 @@ msgid ":data:`ClassVar` accepts only types and cannot be further subscribed."
22922289
msgstr ":data:`ClassVar` 只接受型別請不得使用下標。"
22932290

22942291
#: ../../library/typing.rst:1295
2295-
#, fuzzy
22962292
msgid ""
22972293
":data:`ClassVar` is not a class itself, and cannot be used with :func:"
22982294
"`isinstance` or :func:`issubclass`. :data:`ClassVar` does not change Python "
22992295
"runtime behavior, but it can be used by static type checkers. For example, a "
23002296
"type checker might flag the following code as an error::"
23012297
msgstr ""
2302-
":data:`ClassVar` 並不代表該類別本身,而且不應該和 :func:`isinstance` 或是 :"
2298+
":data:`ClassVar` 並不代表該類別本身,而且不能和 :func:`isinstance` 或是 :"
23032299
"func:`issubclass` 一起使用。:data:`ClassVar` 不會改變 Python runtime 的行為,"
2304-
"但它可以被第三方的型別檢查器使用。舉例來說,一個型別檢查器可能會標記下方的程"
2305-
"式碼為一個錯誤: ::"
2300+
"但它可以被靜態型別檢查器使用。舉例來說,一個型別檢查器可能會標記下方的程式碼"
2301+
"為一個錯誤: ::"
23062302

23072303
#: ../../library/typing.rst:1301
23082304
msgid ""
@@ -2379,7 +2375,6 @@ msgid ""
23792375
msgstr "特殊型別建構,用來標記一個 :class:`TypedDict` 的項目是唯讀的。"
23802376

23812377
#: ../../library/typing.rst:1362
2382-
#, fuzzy
23832378
msgid ""
23842379
"class Movie(TypedDict):\n"
23852380
" title: ReadOnly[str]\n"
@@ -2395,7 +2390,7 @@ msgstr ""
23952390
"\n"
23962391
"def mutate_movie(m: Movie) -> None:\n"
23972392
" m[\"year\"] = 1999 # allowed\n"
2398-
" m[\"title\"] = \"The Matrix\" # 型別檢查器錯誤"
2393+
" m[\"title\"] = \"The Matrix\" # type checker error"
23992394

24002395
#: ../../library/typing.rst:1370
24012396
msgid "There is no runtime checking for this property."
@@ -4623,29 +4618,24 @@ msgid ""
46234618
msgstr ""
46244619

46254620
#: ../../library/typing.rst:2856
4626-
#, fuzzy
46274621
msgid "A protocol with one abstract method ``__bytes__``."
4628-
msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。"
4622+
msgstr "一個有抽象方法 ``__bytes__`` 的協定。"
46294623

46304624
#: ../../library/typing.rst:2860
4631-
#, fuzzy
46324625
msgid "A protocol with one abstract method ``__complex__``."
4633-
msgstr "一個有抽象方法 ``__complex__`` 的 ABC。"
4626+
msgstr "一個有抽象方法 ``__complex__`` 的協定。"
46344627

46354628
#: ../../library/typing.rst:2864
4636-
#, fuzzy
46374629
msgid "A protocol with one abstract method ``__float__``."
4638-
msgstr "一個有抽象方法 ``__float__`` 的 ABC。"
4630+
msgstr "一個有抽象方法 ``__float__`` 的協定。"
46394631

46404632
#: ../../library/typing.rst:2868
4641-
#, fuzzy
46424633
msgid "A protocol with one abstract method ``__index__``."
4643-
msgstr "一個有抽象方法 ``__index__`` 的 ABC。"
4634+
msgstr "一個有抽象方法 ``__index__`` 的協定。"
46444635

46454636
#: ../../library/typing.rst:2874
4646-
#, fuzzy
46474637
msgid "A protocol with one abstract method ``__int__``."
4648-
msgstr "一個有抽象方法 ``__int__`` 的 ABC。"
4638+
msgstr "一個有抽象方法 ``__int__`` 的協定。"
46494639

46504640
#: ../../library/typing.rst:2878
46514641
msgid ""

0 commit comments

Comments
 (0)