Skip to content

Commit

Permalink
Merge branch '3.11' into 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
englam authored Jul 18, 2023
2 parents 93fcaae + a9f07c0 commit 61d784d
Show file tree
Hide file tree
Showing 9 changed files with 573 additions and 82 deletions.
55 changes: 55 additions & 0 deletions .github/DISSCUSSION_TEMPLATE/add_term.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
body:
- type: markdown
attributes:
value: |
感謝你參與本翻譯計畫 🚀
謝謝你願意補充術語,讓志工們的翻譯流程更順暢 🙏
接下來請麻煩依照下列的步驟完成術語補充,我們將在下一次的 meetup 討論新增的術語,並整理至術語表當中。
- type: checkboxes
id: steps_check
attributes:
label: 初步確認
description: 請確認下列每個步驟都已經完成。
options:
- label: 我已經確認過 [術語列表](https://github.com/python/python-docs-zh-tw/wiki/%E8%A1%93%E8%AA%9E%E5%88%97%E8%A1%A8) 中沒有相關術語。
required: true
- label: 我已經確認過 [Python 官方術語列表](https://docs.python.org/zh-tw/3/glossary.html) 中沒有相關術語。
required: true

- type: input
id: term_eng
attributes:
label: 術語原文
description: |
validations:
required: true

- type: input
id: term_zh
attributes:
label: 術語翻譯
description: |
validations:
required: true

- type: textarea
id: description
attributes:
label: 說明
description: |
請補充說明原文出處和想新增詞彙的原因。
validations:
required: true


- type: textarea
id: reference
attributes:
label: 參考資料
description: 若有其他參考資料,也請麻煩附上,可以加速 reviewer 的作業流程喔。
10 changes: 5 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,10 @@ rST 語法注意事項
===============

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



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


Expand Down
67 changes: 62 additions & 5 deletions howto/sockets.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@ msgstr ""
"Project-Id-Version: Python 3.11\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-06-10 00:16+0000\n"
"PO-Revision-Date: 2018-05-23 14:37+0000\n"
"Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n"
"PO-Revision-Date: 2023-07-12 02:22+0800\n"
"Last-Translator: Jay <weijay0804@gmail.com>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
"tw)\n"
"Language: zh_TW\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Poedit 3.3.2\n"

#: ../../howto/sockets.rst:5
msgid "Socket Programming HOWTO"
msgstr ""
msgstr "Socket 程式設計指南"

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

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

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

#: ../../howto/sockets.rst:40
msgid "History"
msgstr ""
msgstr "歷史"

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

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

#: ../../howto/sockets.rst:54
msgid "Creating a Socket"
msgstr ""
msgstr "建立一個 Socket"

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

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

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

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

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

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

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

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

#: ../../howto/sockets.rst:121
msgid "IPC"
Expand Down
32 changes: 21 additions & 11 deletions library/io.po
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2022, Python Software Foundation
# This file is distributed under the same license as the Python package.
#
Expand All @@ -8,7 +7,7 @@ msgstr ""
"Project-Id-Version: Python 3.11\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-05-09 00:15+0000\n"
"PO-Revision-Date: 2018-05-23 16:04+0000\n"
"PO-Revision-Date: 2023-07-17 17:38+0800\n"
"Last-Translator: Adrian Liaw <[email protected]>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
"tw)\n"
Expand All @@ -17,6 +16,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Poedit 3.3.2\n"

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

#: ../../library/io.rst:51 ../../library/io.rst:855 ../../library/io.rst:1122
msgid "Text I/O"
msgstr ""
msgstr "文字 I/O"

#: ../../library/io.rst:53
msgid ""
Expand Down Expand Up @@ -94,7 +94,7 @@ msgstr ""

#: ../../library/io.rst:72 ../../library/io.rst:1110
msgid "Binary I/O"
msgstr ""
msgstr "二進位 (Binary) I/O"

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

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

#: ../../library/io.rst:97
msgid "Raw I/O"
msgstr ""
msgstr "原始 (Raw) I/O"

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

#: ../../library/io.rst:112
msgid "Text Encoding"
msgstr ""
msgstr "文字編碼"

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

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

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

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

#: ../../library/io.rst:137
msgid ":pep:`686`"
msgstr ":pep:`686`"

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

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

#: ../../library/io.rst:145
msgid "See :pep:`597` for more details."
Expand Down
Loading

0 comments on commit 61d784d

Please sign in to comment.