Skip to content

Commit b9bd29b

Browse files
Merge branch '3.12' into building
2 parents d85875d + e1b3c52 commit b9bd29b

File tree

3 files changed

+86
-21
lines changed

3 files changed

+86
-21
lines changed

c-api/complex.po

+41-17
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# SOME DESCRIPTIVE TITLE.
2-
# Copyright (C) 2001-2022, Python Software Foundation
1+
# Copyright (C) 2001-2023, Python Software Foundation
32
# This file is distributed under the same license as the Python package.
43
#
54
# Translators:
5+
# Matt Wang <mattwang44@gmail.com>, 2023
66
msgid ""
77
msgstr ""
88
"Project-Id-Version: Python 3.12\n"
99
"Report-Msgid-Bugs-To: \n"
1010
"POT-Creation-Date: 2023-07-29 00:03+0000\n"
1111
"PO-Revision-Date: 2015-12-09 17:51+0000\n"
12-
"Last-Translator: Liang-Bo Wang <me@liang2.tw>\n"
12+
"Last-Translator: Matt Wang <mattwang44@gmail.com>\n"
1313
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
1414
"tw)\n"
1515
"Language: zh_TW\n"
@@ -20,7 +20,7 @@ msgstr ""
2020

2121
#: ../../c-api/complex.rst:6
2222
msgid "Complex Number Objects"
23-
msgstr ""
23+
msgstr "複數物件"
2424

2525
#: ../../c-api/complex.rst:10
2626
msgid ""
@@ -29,17 +29,23 @@ msgid ""
2929
"and the other is a C structure which represents the actual complex number "
3030
"value. The API provides functions for working with both."
3131
msgstr ""
32+
"從 C API 來看,Python 的複數物件被實作為兩種不同的型別:一種是公開給 Python "
33+
"程式的 Python 物件,另一種是表示實際複數值的 C 結構。API 提供了與兩者一起作用"
34+
"的函式。"
3235

3336
#: ../../c-api/complex.rst:17
3437
msgid "Complex Numbers as C Structures"
35-
msgstr ""
38+
msgstr "作為 C 結構的複數"
3639

3740
#: ../../c-api/complex.rst:19
3841
msgid ""
3942
"Note that the functions which accept these structures as parameters and "
4043
"return them as results do so *by value* rather than dereferencing them "
4144
"through pointers. This is consistent throughout the API."
4245
msgstr ""
46+
"請注意,接受這些結構作為參數並將它們作為結果回傳的函式是\\ *按值 (by "
47+
"value)* 執行的,而不是透過指標取消參照 (dereference) 它們。這在整個 API 中"
48+
"都是一致的。"
4349

4450
#: ../../c-api/complex.rst:26
4551
msgid ""
@@ -48,103 +54,116 @@ msgid ""
4854
"objects use structures of this type as input or output values, as "
4955
"appropriate. It is defined as::"
5056
msgstr ""
57+
"相對於 Python 複數物件之數值部分的 C 結構。大多數處理複數物件的函式根據需求會"
58+
"使用這種型別的結構作為輸入或輸出值。它定義為: ::"
5159

5260
#: ../../c-api/complex.rst:39
5361
msgid ""
5462
"Return the sum of two complex numbers, using the C :c:type:`Py_complex` "
5563
"representation."
56-
msgstr ""
64+
msgstr "以 C 的 :c:type:`Py_complex` 表示形式來回傳兩個複數之和。"
5765

5866
#: ../../c-api/complex.rst:45
5967
msgid ""
6068
"Return the difference between two complex numbers, using the C :c:type:"
6169
"`Py_complex` representation."
62-
msgstr ""
70+
msgstr "以 C 的 :c:type:`Py_complex` 表示形式來回傳兩個複數間的差。"
6371

6472
#: ../../c-api/complex.rst:51
6573
msgid ""
6674
"Return the negation of the complex number *num*, using the C :c:type:"
6775
"`Py_complex` representation."
68-
msgstr ""
76+
msgstr "以 C 的 :c:type:`Py_complex` 表示形式來回傳複數 *num* 的相反數 (negation)。"
6977

7078
#: ../../c-api/complex.rst:57
7179
msgid ""
7280
"Return the product of two complex numbers, using the C :c:type:`Py_complex` "
7381
"representation."
74-
msgstr ""
82+
msgstr "以 C 的 :c:type:`Py_complex` 表示形式來回傳兩個複數的乘積。"
7583

7684
#: ../../c-api/complex.rst:63
7785
msgid ""
7886
"Return the quotient of two complex numbers, using the C :c:type:`Py_complex` "
7987
"representation."
80-
msgstr ""
88+
msgstr "以 C 的 :c:type:`Py_complex` 表示形式來回傳兩個複數的商。"
8189

8290
#: ../../c-api/complex.rst:66
8391
msgid ""
8492
"If *divisor* is null, this method returns zero and sets :c:data:`errno` to :"
8593
"c:macro:`!EDOM`."
8694
msgstr ""
95+
"如果 *divisor* 為 null,則此方法會回傳零並將 :c:data:`errno` 設定為 :c:macro:"
96+
"`!EDOM`。"
8797

8898
#: ../../c-api/complex.rst:72
8999
msgid ""
90100
"Return the exponentiation of *num* by *exp*, using the C :c:type:"
91101
"`Py_complex` representation."
92102
msgstr ""
103+
"以 C 的 :c:type:`Py_complex` 表示形式來回傳 *num* 的 *exp* 次方的結果。"
93104

94105
#: ../../c-api/complex.rst:75
95106
msgid ""
96107
"If *num* is null and *exp* is not a positive real number, this method "
97108
"returns zero and sets :c:data:`errno` to :c:macro:`!EDOM`."
98109
msgstr ""
110+
"如果 *num* 為 null 且 *exp* 不是正實數,則此方法會回傳零並將 :c:data:`errno` "
111+
"設定為 :c:macro:`!EDOM`。"
99112

100113
#: ../../c-api/complex.rst:80
101114
msgid "Complex Numbers as Python Objects"
102-
msgstr ""
115+
msgstr "作為 Python 物件的複數"
103116

104117
#: ../../c-api/complex.rst:85
105118
msgid ""
106119
"This subtype of :c:type:`PyObject` represents a Python complex number object."
107-
msgstr ""
120+
msgstr "這個 :c:type:`PyObject` 的子型別代表一個 Python 複數物件。"
108121

109122
#: ../../c-api/complex.rst:90
110123
msgid ""
111124
"This instance of :c:type:`PyTypeObject` represents the Python complex number "
112125
"type. It is the same object as :class:`complex` in the Python layer."
113126
msgstr ""
127+
"這個 :c:type:`PyTypeObject` 的實例代表 Python 複數型別。它與 Python 層中的 :"
128+
"class:`complex` 是同一個物件。"
114129

115130
#: ../../c-api/complex.rst:96
116131
msgid ""
117132
"Return true if its argument is a :c:type:`PyComplexObject` or a subtype of :"
118133
"c:type:`PyComplexObject`. This function always succeeds."
119134
msgstr ""
135+
"如果其引數是一個 :c:type:`PyComplexObject` 或者是 :c:type:`PyComplexObject` "
136+
"的子型別,則會回傳 true。這個函式不會失敗。"
120137

121138
#: ../../c-api/complex.rst:102
122139
msgid ""
123140
"Return true if its argument is a :c:type:`PyComplexObject`, but not a "
124141
"subtype of :c:type:`PyComplexObject`. This function always succeeds."
125142
msgstr ""
143+
"如果其引數是一個 :c:type:`PyComplexObject`,但不是 :c:type:`PyComplexObject` "
144+
"的子型別,則會回傳 true。這個函式不會失敗。"
126145

127146
#: ../../c-api/complex.rst:108
128147
msgid ""
129148
"Create a new Python complex number object from a C :c:type:`Py_complex` "
130149
"value."
131-
msgstr ""
150+
msgstr "從 C 的 :c:type:`Py_complex` 值建立一個新的 Python 複數物件。"
132151

133152
#: ../../c-api/complex.rst:113
134153
msgid "Return a new :c:type:`PyComplexObject` object from *real* and *imag*."
135-
msgstr ""
154+
msgstr "從 *real* 和 *imag* 回傳一個新的 :c:type:`PyComplexObject` 物件。"
136155

137156
#: ../../c-api/complex.rst:118
138157
msgid "Return the real part of *op* as a C :c:expr:`double`."
139-
msgstr ""
158+
msgstr "以 C 的 :c:expr:`double` 形式回傳 *op* 的實部。"
140159

141160
#: ../../c-api/complex.rst:123
142161
msgid "Return the imaginary part of *op* as a C :c:expr:`double`."
143-
msgstr ""
162+
msgstr "將 *op* 的虛部作為 C 的 :c:expr:`double` 回傳。"
144163

145164
#: ../../c-api/complex.rst:128
146165
msgid "Return the :c:type:`Py_complex` value of the complex number *op*."
147-
msgstr ""
166+
msgstr "回傳複數 *op* 的 :c:type:`Py_complex` 值。"
148167

149168
#: ../../c-api/complex.rst:130
150169
msgid ""
@@ -155,6 +174,11 @@ msgid ""
155174
"defined then it falls back to :meth:`~object.__index__`. Upon failure, this "
156175
"method returns ``-1.0`` as a real value."
157176
msgstr ""
177+
"如果 *op* 不是 Python 複數物件,但有一個 :meth:`~object.__complex__` 方法,則"
178+
"首先會呼叫該方法將 *op* 轉換為 Python 複數物件。如果 :meth:`!__complex__` 並"
179+
"未定義,那麼它會回退到 :meth:`~object.__float__`。如果 :meth:`!__float__` 未"
180+
"定義,則它將繼續回退為 :meth:`~object.__index__`。失敗時,此方法回傳 "
181+
"``-1.0`` 作為實部值。"
158182

159183
#: ../../c-api/complex.rst:137
160184
msgid "Use :meth:`~object.__index__` if available."

howto/sockets.po

+34-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: Python 3.11\n"
99
"Report-Msgid-Bugs-To: \n"
1010
"POT-Creation-Date: 2022-06-10 00:16+0000\n"
11-
"PO-Revision-Date: 2023-07-19 20:17+0800\n"
11+
"PO-Revision-Date: 2023-08-03 18:11+0800\n"
1212
"Last-Translator: Jay <weijay0804@gmail.com>\n"
1313
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
1414
"tw)\n"
@@ -417,7 +417,7 @@ msgstr ""
417417

418418
#: ../../howto/sockets.rst:252
419419
msgid "Binary Data"
420-
msgstr ""
420+
msgstr "二進位資料"
421421

422422
#: ../../howto/sockets.rst:254
423423
msgid ""
@@ -430,6 +430,13 @@ msgid ""
430430
"little-endian, with the least significant byte first - that same ``1`` would "
431431
"be ``01 00``."
432432
msgstr ""
433+
"使用 socket 傳輸二進位資料完全是可行的。最主要的問題在於不同機器使用不同的二"
434+
"進位資料格式。例如,`網路二進位順序 <https://en.wikipedia.org/wiki/"
435+
"Endianness#Networking>`_ 採用的是「大端序 big-endian」,"
436+
"所以一個值為 ``1`` 的 16 位元整數會表示成兩個 16 進位的位元組 ``00 01``。然而"
437+
"大多數常見的處理器 (x86/AMD64,ARM,RISC-V) 採用的是「小端序 little-"
438+
"endian」,所以相同的 ``1`` 會被表示成 ``01 00``。"
439+
"(譯者注:將一個多位數的低位放在較小的位址處,高位放在較大的位址處,則稱小端序;反之則稱大端序。)"
433440

434441
#: ../../howto/sockets.rst:262
435442
msgid ""
@@ -439,6 +446,10 @@ msgid ""
439446
"these do nothing, but where the machine is byte-reversed, these swap the "
440447
"bytes around appropriately."
441448
msgstr ""
449+
"Socket 函式庫提供了用於轉換 16 位元和 32 位元整數的函式 - ``ntohl, htonl, "
450+
"ntohs, htons``,其中 \"n\" 表示 *network*,\"h\" 表示 *host*,\"s\" 表示 "
451+
"*short*,\"l\" 表示 *long*。當網路的位元組順序和主機位元組順序相同時,這些函"
452+
"式不會做任何操作,但當主機的位元組順序相反時,這些函式會適當的交換位元組順序。"
442453

443454
#: ../../howto/sockets.rst:268
444455
msgid ""
@@ -449,10 +460,14 @@ msgid ""
449460
"be 8. Of course, this doesn't fit well with fixed-length messages. "
450461
"Decisions, decisions."
451462
msgstr ""
463+
"在現今的 64 位元機器中,二進位資料的 ASCII 表示通常會比二進位表示要小,這是因"
464+
"為在很多情況下,大多數整數的值為 0 或者 1。例如,字串形式的 ``\"0\"`` 是兩個"
465+
"位元組,而完整的 64 位元整數則是 8 個位元組。當然,這對固定長度的訊息來說不太"
466+
"適合,需要自行決定。"
452467

453468
#: ../../howto/sockets.rst:277
454469
msgid "Disconnecting"
455-
msgstr ""
470+
msgstr "結束連線"
456471

457472
#: ../../howto/sockets.rst:279
458473
msgid ""
@@ -465,6 +480,12 @@ msgid ""
465480
"same as ``shutdown(); close()``. So in most situations, an explicit "
466481
"``shutdown`` is not needed."
467482
msgstr ""
483+
"嚴格來說,在關閉 socket 前,你應該使用 ``shutdown`` 函式。``shutdown`` 函式是"
484+
"發送給 socket 另一端的一個提醒。根據你傳遞的引數,它可以表示「我不會再發送任"
485+
"何訊息了,但我仍然會持續監聽」,或者是「我不會再繼續監聽了,真讚!」。然而,"
486+
"大多數的 socket 函式庫或程式設計師都習慣忽略這種禮節,因為通常情況下 "
487+
"``close`` 跟 ``shutdown(); close()`` 是一樣的。所以在大多數情況下,不需要再特"
488+
"地使用 ``shutdown`` 了。"
468489

469490
#: ../../howto/sockets.rst:287
470491
msgid ""
@@ -475,6 +496,11 @@ msgid ""
475496
"complete request. The server sends a reply. If the ``send`` completes "
476497
"successfully then, indeed, the client was still receiving."
477498
msgstr ""
499+
"有效使用 ``shutdown`` 的一種方式是在類似 HTTP 的交換中,用戶端發送請求後,然"
500+
"後使用 ``shutdown(1)``。這告訴伺服器「這個用戶端已經發送完成,但仍可以接"
501+
"收」。伺服器可以通過接收「零位元組」來檢測 \"EOF\"。這樣它就可以確定已經接收到"
502+
"完整的請求。伺服器發送回覆,如果 ``send`` 成功完成,那麼用戶端確實在持續接"
503+
"收。"
478504

479505
#: ../../howto/sockets.rst:294
480506
msgid ""
@@ -485,6 +511,11 @@ msgid ""
485511
"indefinitely, thinking you're just being slow. *Please* ``close`` your "
486512
"sockets when you're done."
487513
msgstr ""
514+
"Python 更進一步地採取自動關閉的步驟,並且當 socket 被垃圾回收機制回收時,如果需要"
515+
"的話,他會自動執行 ``close``。但依賴這個機制是一個非常不好的習慣,如果你的 "
516+
"socket 在沒有 ``close`` 的情況下消失了,那麼另一端的 socket 可能會認為你只是"
517+
"慢了一步,而無期限的等待。*請務必* \\在使用完畢後使用 ``close`` 關閉你的 "
518+
"sockets。"
488519

489520
#: ../../howto/sockets.rst:302
490521
msgid "When Sockets Die"

library/csv.po

+11-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ msgstr ""
2020

2121
#: ../../library/csv.rst:2
2222
msgid ":mod:`csv` --- CSV File Reading and Writing"
23-
msgstr ""
23+
msgstr ":mod:`csv` --- CSV 檔案讀取及寫入"
2424

2525
#: ../../library/csv.rst:9
2626
msgid "**Source code:** :source:`Lib/csv.py`"
@@ -39,6 +39,13 @@ msgid ""
3939
"single module which can efficiently manipulate such data, hiding the details "
4040
"of reading and writing the data from the programmer."
4141
msgstr ""
42+
"所謂的 CSV (Comma Separated Values) 檔案格式是試算表及資料庫中最常見的"
43+
"匯入、匯出檔案格式。在嘗試以 :rfc:`4180` 中的標準化方式來描述格式之前,"
44+
"CSV 格式已經使用了許多年。由於缺少一個完善定義的標準,意味著各個不同的"
45+
"應用程式會在資料產生及銷毀時有微妙的差別。這些不同之處使得從不同資料來源"
46+
"處理 CSV 檔案時會非常擾人。儘管如此,雖然分隔符號和引號字元有所不同,整體的"
47+
"格式非常相似,可以寫個單一模組來高效率的操作這樣的資料,讓程式設計師可以隱藏"
48+
"讀取及寫入資料的細節。"
4249

4350
#: ../../library/csv.rst:28
4451
msgid ""
@@ -56,6 +63,9 @@ msgid ""
5663
"write sequences. Programmers can also read and write data in dictionary "
5764
"form using the :class:`DictReader` and :class:`DictWriter` classes."
5865
msgstr ""
66+
":mod:`csv` 模組的 :class:`reader` 及 :class:`writer` 物件可以讀取"
67+
"及寫入序列。程式設計師也可以透過 :class:`DictReader` 及 :class:`DictWriter`"
68+
" class(類別)使用 dictionary (字典)讀取及寫入資料。"
5969

6070
#: ../../library/csv.rst:41
6171
msgid ":pep:`305` - CSV File API"

0 commit comments

Comments
 (0)