8000 Merge branch '3.11' into 3.11 · python/python-docs-zh-tw@61d784d · GitHub
[go: up one dir, main page]

Skip to content

Commit 61d784d

Browse files
authored
Merge branch '3.11' into 3.11
2 parents 93fcaae + a9f07c0 commit 61d784d

File tree

9 files changed

+573
-82
lines changed

9 files changed

+573
-82
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
body:
2+
- type: markdown
3+
attributes:
4+
value: |
5+
感謝你參與本翻譯計畫 🚀
6+
7+
謝謝你願意補充術語,讓志工們的翻譯流程更順暢 🙏
8+
9+
接下來請麻煩依照下列的步驟完成術語補充,我們將在下一次的 meetup 討論新增的術語,並整理至術語表當中。
10+
11+
- type: checkboxes
12+
id: steps_check
13+
attributes:
14+
label: 初步確認
15+
description: 請確認下列每個步驟都已經完成。
16+
options:
17+
- label: 我已經確認過 [術語列表](https://github.com/python/python-docs-zh-tw/wiki/%E8%A1%93%E8%AA%9E%E5%88%97%E8%A1%A8) 中沒有相關術語。
18+
required: true
19+
- label: 我已經確認過 [Python 官方術語列表](https://docs.python.org/zh-tw/3/glossary.html) 中沒有相關術語。
20+
required: true
21+
22+
- type: input
23+
id: term_eng
24+
attributes:
25+
label: 術語原文
26+
description: |
27+
28+
validations:
29+
required: true
30+
31+
- type: input
32+
id: term_zh
33+
attributes:
34+
label: 術語翻譯
35+
description: |
36+
37+
validations:
38+
required: true
39+
40+
- type: textarea
41+
id: description
42+
attributes:
43+
label: 說明
44+
description: |
45+
請補充說明原文出處和想新增詞彙的原因。
46+
47+
validations:
48+
required: true
49+
50+
51+
- type: textarea
52+
id: reference
53+
attributes:
54+
label: 參考資料
55+
description: 若有其他參考資料,也請麻煩附上,可以加速 reviewer 的作業流程喔。

README.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,10 +318,10 @@ rST 語法注意事項
318318
===============
319319

320320
為了讓翻譯保持統一,我們整理了一份 `術語列表
321-
<https://airtable.com/shrHlRP52bZ9C7aY3/tbl7dhPe9Ph9XIAy3>`_ \
322-
如果翻譯過程中你覺得需要術語列表有所缺漏,請填寫 `術語列表擴充表單 \
323-
<https://airtable.com/shr6sU4HHSKAz0Y7J>`_。新增的術語,將會於每次\
324-
Sprint中共同討論是否合併進術語列表
321+
<https://github.com/python/python-docs-zh-tw/wiki/%E8%A1%93%E8%AA%9E%E5%88%97%E8%A1%A8>`_ \
322+
如果翻譯過 F438 程中你覺得需要術語列表有所缺漏,請至 `Discussion \
323+
<https://github.com/python/python-docs-zh-tw/discussions>`_ 開啟新的討論補充術語。\
324+
新增的術語,將會於每次 Sprint 中共同討論是否合併進術語列表
325325

326326

327327

@@ -346,7 +346,7 @@ Sprint中共同討論是否合併進術語列表。
346346
- `Doc-SIG mailing list <https://mail.python.org/mailman/listinfo/doc-sig>`_
347347
- `PEP 545 <https://www.python.org/dev/peps/pep-0545/>`_
348348
- `zh_CN Translation of the Python Documentation
349-
<https://zhsj.github.io/python-docs-zh-cn/>`_
349+
<https://github.com/python/python-docs-zh-cn>`_
350350
- `Cambridge Dictionary <https://dictionary.cambridge.org/>`_
351351

352352

howto/sockets.po

Lines changed: 62 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,20 @@ 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: 2018-05-23 14:37+0000\n"
12-
"Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n"
11+
"PO-Revision-Date: 2023-07-12 02:22+0800\n"
12+
"Last-Translator: Jay <weijay0804@gmail.com>\n"
1313
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
1414
"tw)\n"
1515
"Language: zh_TW\n"
1616
"MIME-Version: 1.0\n"
1717
"Content-Type: text/plain; charset=UTF-8\n"
1818
"Content-Transfer-Encoding: 8bit\n"
1919
"Plural-Forms: nplurals=1; plural=0;\n"
20+
"X-Generator: Poedit 3.3.2\n"
2021

2122
#: ../../howto/sockets.rst:5
2223
msgid "Socket Programming HOWTO"
23-
msgstr ""
24+
msgstr "Socket 程式設計指南"
2425

2526
#: ../../howto/sockets.rst:0
2627
msgid "Author"
@@ -43,6 +44,10 @@ msgid ""
4344
"a lot of them), but I hope it will give you enough background to begin using "
4445
"them decently."
4546
msgstr ""
47+
"Sockets 在各處都被廣泛使用,但卻是一項被誤解最嚴重的技術之一。這是一篇對 "
48+
"sockets 的概論介紹。這並不是一個完整的教學指南 - 你還需要做許多準備才能讓 "
49+
"sockets 正常運作。這篇文章也沒有包含細節(其中有非常多的細節),但我希望這篇"
50+
"文章能夠讓你有足夠的背景知識,以便開始正確的使用 sockets 程式設計。"
4651

4752
#: ../../howto/sockets.rst:20
4853
msgid "Sockets"
@@ -59,6 +64,13 @@ msgid ""
5964
"blocking sockets. But I'll start by talking about blocking sockets. You'll "
6065
"need to know how they work before dealing with non-blocking sockets."
6166
msgstr ""
67+
"我只會討論關於 INET(例如:IPv4)的 sockets,但它們涵蓋了幾乎 99% 的 "
68+
"sockets 使用場景。而我也將僅討論關於 STREAM(比如:TCP)類型的 sockets - 除"
69+
"非你真的知道你在做什麼(在這種情況下,這份指南可能不適合你),使用 STREAM "
70+
"類型的 socket 會獲得比其他 sockets 類型更好的表現和性能。我將會嘗試解釋 "
71+
"socket 是什麼,以及如何使用阻塞 (blocking) 和非阻塞 (non-blocking) sockets 的"
72+
"一些建議。但首先我會先談論阻塞 sockets。在處理非阻塞 sockets 之前,你需要了解"
73+
"它們的工作原理。"
6274

6375
#: ../../howto/sockets.rst:31
6476
msgid ""
@@ -70,10 +82,16 @@ msgid ""
7082
"sockets exclusively; the web server it's talking to uses both \"server\" "
7183
"sockets and \"client\" sockets."
7284
msgstr ""
85+
"要理解這些東西的困難點之一在於 \"scoket\" 可以代表多種具有些微差異的東西,這主要"
86+
"取決於上下文。所以首先,讓我們先區分「用戶端 (client)」socket 和「伺服器端"
87+
" (server)」socket 的差別,「用戶端」socket 表示通訊的一端,「伺服器端」"
88+
"socket 更像是一個電話總機接線員。用戶端應用程式(例如:你的瀏覽器)只能使"
89+
"用「用戶端」socket; 它所連接的網路伺服器則同時使用「伺服器端」socket 和 "
90+
"「用戶端」socket 來進行通訊。"
7391

7492
#: ../../howto/sockets.rst:40
7593
msgid "History"
76-
msgstr ""
94+
msgstr "歷史"
7795

7896
#: ../../howto/sockets.rst:42
7997
msgid ""
@@ -82,6 +100,9 @@ msgid ""
82100
"other forms of IPC that are faster, but for cross-platform communication, "
83101
"sockets are about the only game in town."
84102
msgstr ""
103+
"在各種形式的 :abbr:`IPC (Inter Process Communication)` 中,sockets 是最受歡迎"
104+
"的。在任何特定的平台上,可能會存在其他更快速的 IPC 形式,但對於跨平台通訊來"
105+
"說,sockets 是唯一的選擇。"
85106

86107
#: ../../howto/sockets.rst:47
87108
msgid ""
@@ -90,16 +111,22 @@ msgid ""
90111
"of sockets with INET makes talking to arbitrary machines around the world "
91112
"unbelievably easy (at least compared to other schemes)."
92113
msgstr ""
114+
"Sockets 作為 Unix 的 BSD 分支的一部分在 Berkeley 被發明出來。它們隨著網際網路的普"
115+
"及而迅速蔓延開來。這是有很好的理由 — sockets 和 INET 的結合讓世界各地任何"
116+
"的機器之間的通訊變得非常簡單(至少與其它方案相比是如此)。"
93117

94118
#: ../../howto/sockets.rst:54
95119
msgid "Creating a Socket"
96-
msgstr ""
120+
msgstr "建立一個 Socket"
97121

98122
#: ../../howto/sockets.rst:56
99123
msgid ""
100124
"Roughly speaking, when you clicked on the link that brought you to this "
101125
"page, your browser did something like the following::"
102126
msgstr ""
127+
"大致上來說,當你點擊了帶你來到這個頁面的連結時,你的瀏覽器做了以下的操作:\n"
128+
"\n"
129+
"::"
103130

104131
#: ../../howto/sockets.rst:64
105132
msgid ""
@@ -108,12 +135,19 @@ msgid ""
108135
"then be destroyed. That's right, destroyed. Client sockets are normally only "
109136
"used for one exchange (or a small set of sequential exchanges)."
110137
msgstr ""
138+
"當 ``connect`` 完成時,這個 socket ``s`` 可以用來發送請求來取得頁面的文本。同"
139+
"一個 socket 也會讀取回傳值,然後再被銷毀。是的,會被銷毀。用戶端 socket 通常只"
140+
"用來做一次交換(或是一小組連續交換)。"
111141

112142
#: ../../howto/sockets.rst:70
113143
msgid ""
114144
"What happens in the web server is a bit more complex. First, the web server "
115145
"creates a \"server socket\"::"
116146
msgstr ""
147+
"網路伺服器 (web server) 的運作就稍微複雜一點。首先,網路伺服器會建立一個「伺服器端 "
148+
"socket」:\n"
149+
"\n"
150+
"::"
117151

118152
#: ../../howto/sockets.rst:80
119153
msgid ""
@@ -124,13 +158,19 @@ msgid ""
124158
"machine. ``s.bind(('', 80))`` specifies that the socket is reachable by any "
125159
"address the machine happens to have."
126160
msgstr ""
161+
"有幾件事需要注意:我們使用了 ``socket.gethostname()``,這樣 socket 才能對外"
162+
"部網路可見。如果我們使用了 ``s.bind(('localhost', 80))`` 或 ``s."
163+
"bind(('127.0.0.1', 80))``,我們會得到一個「伺服器端」socket,但是只能在同一"
164+
"台機器內可見。``s.bind(('', 80))`` 指定 socket 可以透過機器的任何地址存取。"
127165

128166
#: ../../howto/sockets.rst:87
129167
msgid ""
130168
"A second thing to note: low number ports are usually reserved for \"well "
131169
"known\" services (HTTP, SNMP etc). If you're playing around, use a nice high "
132170
"number (4 digits)."
133171
msgstr ""
172+
"第二個要注意的是:數字小的連接埠 (port) 通常保留給「廣為人知的」服務(HTTP、SNMP"
173+
"等)。如果你只是想執行程式,可以使用一個數字較大的連接埠(4 位數字)。"
134174

135175
#: ../../howto/sockets.rst:91
136176
msgid ""
@@ -139,12 +179,19 @@ msgid ""
139179
"outside connections. If the rest of the code is written properly, that "
140180
"should be plenty."
141181
msgstr ""
182+
"最後,``listen`` 引數告訴 socket 函式庫 (library),我們希望在佇列 (queue) 中"
183+
"累積達 5 個(正常的最大值)連接請求後再拒絕外部連接。如果其餘的程式碼編寫"
184+
"正確,這應該足夠了。"
142185

143186
#: ../../howto/sockets.rst:95
144187
msgid ""
145188
"Now that we have a \"server\" socket, listening on port 80, we can enter the "
146189
"mainloop of the web server::"
147190
msgstr ""
191+
"現在我們有一個監聽 80 連接埠的「伺服器端」socket 了,我們可以進入網路伺服器的"
192+
"主迴圈了:\n"
193+
"\n"
194+
"::"
148195

149196
#: ../../howto/sockets.rst:106
150197
msgid ""
@@ -161,6 +208,16 @@ msgid ""
161208
"The two \"clients\" are free to chat it up - they are using some dynamically "
162209
"allocated port which will be recycled when the conversation ends."
163210
msgstr ""
211+
"事實上,有三種方法可以讓這個迴圈運作 - 分配一個執行緒 (thread) 來處理 "
212+
"``clientsocket`` 、建立一個新行程 (process) 來處理 ``clientsocket``,或者將"
213+
"這個程式重新改寫成使用非阻塞 socket,並使用 ``select`` 在我們的「伺服器端」"
214+
"socket 和任何有效的 ``clientsocket`` 之間進行多工處理。稍後將會更詳細的介紹。"
215+
"現在最重要的是理解:這就是「伺服器端」socket 做的\\ *所有* \\事情。它不會發送任何"
216+
"資料、也不接收任何資料,它只會建立「伺服器端」socket。每個 ``clientsocket`` "
217+
"都是為了回應某些\\ *其他* \\ ``connect()`` 到我們綁定的主機上的「用戶端」socket。"
218+
"一但 ``clientsocket`` 建立完成,就會繼續監聽更多的連接請求。兩個「用戶端」可"
219+
"以隨意的通訊 - 它們使用的是一些動態分配的連接埠,會在通訊結束的時候被回收並重新"
220+
"利用。"
164221

165222
#: ../../howto/sockets.rst:121
166223
msgid "IPC"

library/io.po

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# SOME DESCRIPTIVE TITLE.
21
# Copyright (C) 2001-2022, Python Software Foundation
32
# This file is distributed under the same license as the Python package.
43
#
@@ -8,7 +7,7 @@ msgstr ""
87
"Project-Id-Version: Python 3.11\n"
98
"Report-Msgid-Bugs-To: \n"
109
"POT-Creation-Date: 2023-05-09 00:15+0000\n"
11-
"PO-Revision-Date: 2018-05-23 16:04+0000\n"
10+
"PO-Revision-Date: 2023-07-17 17:38+0800\n"
1211
"Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n"
1312
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
1413
"tw)\n"
@@ -17,6 +16,7 @@ msgstr ""
1716
"Content-Type: text/plain; charset=UTF-8\n"
1817
"Content-Transfer-Encoding: 8bit\n"
1918
"Plural-Forms: nplurals=1; plural=0;\n"
19+
"X-Generator: Poedit 3.3.2\n"
2020

2121
#: ../../library/io.rst:2
2222
msgid ":mod:`io` --- Core tools for working with streams"
@@ -65,7 +65,7 @@ msgstr ""
6565

6666
#: ../../library/io.rst:51 ../../library/io.rst:855 ../../library/io.rst:1122
6767
msgid "Text I/O"
68-
msgstr ""
68+
msgstr "文字 I/O"
6969

7070
#: ../../library/io.rst:53
7171
msgid ""
@@ -94,7 +94,7 @@ msgstr ""
9494

9595
#: ../../library/io.rst:72 ../../library/io.rst:1110
9696
msgid "Binary I/O"
97-
msgstr ""
97+
msgstr "二進位 (Binary) I/O"
9898

9999
#: ../../library/io.rst:74
100100
msgid ""
@@ -120,17 +120,19 @@ msgstr ""
120120
msgid ""
121121
"The binary stream API is described in detail in the docs of :class:"
122122
"`BufferedIOBase`."
123-
msgstr ""
123+
msgstr "二進位資料串流 API 的詳細說明在 :class:`BufferedIOBase` 文件當中。"
124124

125125
#: ../../library/io.rst:92
126126
msgid ""
127127
"Other library modules may provide additional ways to create text or binary "
128128
"streams. See :meth:`socket.socket.makefile` for example."
129129
msgstr ""
130+
"其它函式庫模組可能提供額外的方法來建立文字或二進位資料串流。例如 :meth:"
131+
"`socket.socket.makefile`。"
130132

131133
#: ../../library/io.rst:97
132134
msgid "Raw I/O"
133-
msgstr ""
135+
msgstr "原始 (Raw) I/O"
134136

135137
#: ../../library/io.rst:99
136138
msgid ""
@@ -143,17 +145,19 @@ msgstr ""
143145
#: ../../library/io.rst:106
144146
msgid ""
145147
"The raw stream API is described in detail in the docs of :class:`RawIOBase`."
146-
msgstr ""
148+msgstr "原始串流 API 在 :class:`RawIOBase` 文件中有詳細描述。"
147149

148150
#: ../../library/io.rst:112
149151
msgid "Text Encoding"
150-
msgstr ""
152+
msgstr "文字編碼"
151153

152154
#: ../../library/io.rst:114
153155
msgid ""
154156
"The default encoding of :class:`TextIOWrapper` and :func:`open` is locale-"
155157
"specific (:func:`locale.getencoding`)."
156158
msgstr ""
159+
":class:`TextIOWrapper` 和 :func:`open` 預設編碼是根據區域設定的 (locale-"
160+
"specific) (:func:`locale.getencoding`)。"
157161

158162
#: ../../library/io.rst:117
159163
msgid ""
@@ -162,6 +166,9 @@ msgid ""
162166
"platforms use UTF-8 locale by default. This causes bugs because the locale "
163167
"encoding is not UTF-8 for most Windows users. For example::"
164168
msgstr ""
169+
"然而,許多開發人員在開啟以 UTF-8 編碼的文字檔案(例如:JSON、TOML、Markdown"
170+
"等)時忘記指定編碼,因為多數 Unix 平台預設使用 UTF-8 區域設定。這會導致錯誤,"
171+
"因為對於大多數 Windows 使用者來說,預設地區編碼並非 UTF-8。舉例來說:"
165172

166173
#: ../../library/io.rst:126
167174
msgid ""
@@ -170,6 +177,9 @@ msgid ""
170177
"``encoding=\"utf-8\"``. To use the current locale encoding, "
171178
"``encoding=\"locale\"`` is supported since Python 3.10."
172179
msgstr ""
180+
"因此,強烈建議在開啟文字檔案時,明確指定編碼。若你想使用 UTF-8 編碼,請傳入 "
181+
"``encoding=\"utf-8\"``。若想使用目前的地區編碼,Python 3.10 以後的版本支援使"
182+
"用 ``encoding=\"locale\"``。"
173183

174184
#: ../../library/io.rst:135
175185
msgid ":ref:`utf8-mode`"
@@ -179,19 +189,19 @@ msgstr ":ref:`utf8-mode`"
179189
msgid ""
180190
"Python UTF-8 Mode can be used to change the default encoding to UTF-8 from "
181191
"locale-specific encoding."
182-
msgstr ""
192+
msgstr "在 Python UTF-8 模式下,可以將預設編碼從特定地區編碼改為 UTF-8。"
183193

184194
#: ../../library/io.rst:137
185195
msgid ":pep:`686`"
186196
msgstr ":pep:`686`"
187197

188198
#: ../../library/io.rst:138
189199
msgid "Python 3.15 will make :ref:`utf8-mode` default."
190-
msgstr ""
200+
msgstr "Python 3.15 將預設使用 :ref:`utf8-mode`。"
191201

192202
#: ../../library/io.rst:143
193203
msgid "Opt-in EncodingWarning"
194-
msgstr ""
204+
msgstr "選擇性加入的編碼警告"
195205

196206
#: ../../library/io.rst:145
197207
msgid "See :pep:`597` for more details."

0 commit comments

Comments
 (0)
0