From 04e1c26ea3a8e7afb9c77b84fd1ded6370118ce3 Mon Sep 17 00:00:00 2001 From: b95702041 <83135455+b95702041@users.noreply.github.com> Date: Sat, 15 Nov 2025 02:39:32 -0500 Subject: [PATCH 1/5] Translate howto/ipaddress.po --- howto/ipaddress.po | 94 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 75 insertions(+), 19 deletions(-) diff --git a/howto/ipaddress.po b/howto/ipaddress.po index c6fc1ac7bb5..5928fac4d7b 100644 --- a/howto/ipaddress.po +++ b/howto/ipaddress.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2025-02-19 00:13+0000\n" -"PO-Revision-Date: 2024-07-20 16:09+0800\n" +"PO-Revision-Date: 2025-11-15 01:58-0500\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,7 +17,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.4.4\n" +"X-Generator: Poedit 3.8\n" #: ../../howto/ipaddress.rst:9 msgid "An introduction to the ipaddress module" @@ -61,10 +61,12 @@ msgid "" "addresses, the first thing you'll want to do is create some objects. You " "can use :mod:`ipaddress` to create objects from strings and integers." msgstr "" +"由於 :mod:ipaddress 是一個用於檢查和操作 IP 位址的模組,你首先會想要做的事情" +"是建立一些物件。你可以使用 :mod:ipaddress 從字串和整數建立物件。" #: ../../howto/ipaddress.rst:32 msgid "A Note on IP Versions" -msgstr "" +msgstr "關於IP 版本的說明" #: ../../howto/ipaddress.rst:34 msgid "" @@ -76,6 +78,10 @@ msgid "" "given the increasing number of devices with direct connections to the " "internet." msgstr "" +"對於不太熟悉 IP 定址的讀者來說,重要的是要知道網際網路協定 (Internet " +"Protocol, IP) 目前正在從協定的第 4 版過渡到第 6 版。這個轉換主要是因為協定的" +"第 4 版無法提供足夠的位址來處理全世界的需求,特別是考慮到直接連接到網際網路的" +"裝置數量不斷增加。" #: ../../howto/ipaddress.rst:41 msgid "" @@ -84,10 +90,12 @@ msgid "" "least be aware that these two versions exist, and it will sometimes be " "necessary to force the use of one version or the other." msgstr "" +"解釋這兩個版本協定之間差異的細節超出了本介紹的範圍,但讀者至少需要知道這兩個" +"版本的存在,而且有時候會需要強制使用其中一個版本。" #: ../../howto/ipaddress.rst:48 msgid "IP Host Addresses" -msgstr "" +msgstr "IP 主機位址" #: ../../howto/ipaddress.rst:50 msgid "" @@ -97,12 +105,16 @@ msgid "" "determines whether to create an IPv4 or IPv6 address based on the passed in " "value:" msgstr "" +"位址,通常被稱為「主機位址」,是處理 IP 定址時最基本的單位。建立位址最簡單的" +"方法是使用 :func:ipaddress.ip_address 工廠函式,它會根據傳入的值自動判斷要建" +"立 IPv4 還是 IPv6 位址:" #: ../../howto/ipaddress.rst:61 msgid "" "Addresses can also be created directly from integers. Values that will fit " "within 32 bits are assumed to be IPv4 addresses::" msgstr "" +"位址也可以直接從整數建立。符合 32 位元以內的值會被假定為 IPv4 位址: ::" #: ../../howto/ipaddress.rst:64 msgid "" @@ -122,6 +134,8 @@ msgid "" "invoked directly. This is particularly useful to force creation of IPv6 " "addresses for small integers::" msgstr "" +"要強制使用 IPv4 或 IPv6 位址,可以直接呼叫相關的類別。這對於強制為小整數建立 " +"IPv6 位址特別有用: ::" #: ../../howto/ipaddress.rst:73 msgid "" @@ -154,12 +168,17 @@ msgid "" "whether or not an address is part of the network and the network address " "defines the expected value of those bits." msgstr "" +"主機位址通常會被分組到 IP 網路中,因此 :mod:ipaddress 提供了一種建立、檢查和" +"操作網路定義的方法。IP 網路物件是從定義該網路所包含之主機位址範圍的字串建構而" +"成。這些資訊最簡單的形式是「網路位址/網路前綴」配對,其中前綴定義了用於比較的" +"前導位元數量,以判斷位址是否屬於該網路的一部分,而網路位址則定義了這些位元的" +"預期值。" #: ../../howto/ipaddress.rst:93 msgid "" "As for addresses, a factory function is provided that determines the correct " "IP version automatically::" -msgstr "" +msgstr "至於位址,提供了一個工廠函式可以自動判斷正確的 IP 版本: ::" #: ../../howto/ipaddress.rst:96 msgid "" @@ -181,6 +200,9 @@ msgid "" "commonly used to describe network interfaces of a computer on a given " "network and are described further in the next section." msgstr "" +"網路物件不能設定任何主機位元。這樣做的實際效果是 192.0.2.1/24 並不描述一個網" +"路。這類定義被稱為介面物件,因為 ip-on-a-network 標記法通常用於描述電腦在給定" +"網路上的網路介面,並將在下一節中進一步說明。" #: ../../howto/ipaddress.rst:107 msgid "" @@ -189,6 +211,8 @@ msgid "" "bits instead be coerced to zero, the flag ``strict=False`` can be passed to " "the constructor::" msgstr "" +"預設情況下,嘗試建立帶有主機位元設定的網路物件會導致引發 :exc:ValueError。若" +"要求將額外的位元強制轉換為零,可以在建構子中傳遞旗標 strict=False: ::" #: ../../howto/ipaddress.rst:112 msgid "" @@ -213,6 +237,9 @@ msgid "" "network is considered to contain only the single address identified by the " "integer, so the network prefix includes the entire network address::" msgstr "" +"雖然字串形式提供了更大的靈活性,但網路也可以像主機位址一樣使用整數來定義。在" +"這種情況下,網路被認為僅包含由該整數識別的單一位址,因此網路前綴包含了整個網" +"路位址: ::" #: ../../howto/ipaddress.rst:124 msgid "" @@ -231,10 +258,12 @@ msgid "" "As with addresses, creation of a particular kind of network can be forced by " "calling the class constructor directly instead of using the factory function." msgstr "" +"與位址一樣,可以透過直接呼叫類別建構子而非使用工廠函式,來強制建立特定類型的" +"網路。" #: ../../howto/ipaddress.rst:135 msgid "Host Interfaces" -msgstr "" +msgstr "主機介面" #: ../../howto/ipaddress.rst:137 msgid "" @@ -248,12 +277,19 @@ msgid "" "is identical to that for defining network objects, except that the address " "portion isn't constrained to being a network address." msgstr "" +"如上所述,如果你需要描述特定網路上的位址,位址類別和網路類別都不足以滿足需" +"求。像 192.0.2.1/24 這樣的標記法通常被網路工程師以及編寫防火牆和路由器工具的" +"人用作「網路 192.0.2.0/24 上的主機 192.0.2.1」的簡寫。因此,:mod:ipaddress 提" +"供了一組混合類別,將位址與特定網路關聯起來。建立介面的方式與定義網路物件相" +"同,只是位址部分不受限於必須是網路位址。" #: ../../howto/ipaddress.rst:152 msgid "" "Integer inputs are accepted (as with networks), and use of a particular IP " "version can be forced by calling the relevant constructor directly." msgstr "" +"可以接受整數輸入(如同網路一樣),並且可以透過直接呼叫相關的建構子來強制使用" +"特定的 IP 版本。" #: ../../howto/ipaddress.rst:157 msgid "Inspecting Address/Network/Interface Objects" @@ -265,10 +301,12 @@ msgid "" "Interface) object, so you probably want to get information about " "it. :mod:`ipaddress` tries to make doing this easy and intuitive." msgstr "" +"你費心建立了 IPv(4|6)(Address|Network|Interface) 物件,所以你可能想要取得關於" +"它的資訊。:mod:ipaddress 試圖讓這件事變得簡單且直觀。" #: ../../howto/ipaddress.rst:163 msgid "Extracting the IP version::" -msgstr "" +msgstr "提取 IP 版本: ::" #: ../../howto/ipaddress.rst:165 msgid "" @@ -288,7 +326,7 @@ msgstr "" #: ../../howto/ipaddress.rst:172 msgid "Obtaining the network from an interface::" -msgstr "" +msgstr "從介面取得網路: ::" #: ../../howto/ipaddress.rst:174 msgid "" @@ -308,7 +346,7 @@ msgstr "" #: ../../howto/ipaddress.rst:181 msgid "Finding out how many individual addresses are in a network::" -msgstr "" +msgstr "找出網路中有多少個別位址: ::" #: ../../howto/ipaddress.rst:183 msgid "" @@ -328,7 +366,7 @@ msgstr "" #: ../../howto/ipaddress.rst:190 msgid "Iterating through the \"usable\" addresses on a network::" -msgstr "" +msgstr "迭代網路上「可用的」位址: ::" #: ../../howto/ipaddress.rst:192 msgid "" @@ -361,10 +399,12 @@ msgid "" "Obtaining the netmask (i.e. set bits corresponding to the network prefix) or " "the hostmask (any bits that are not part of the netmask):" msgstr "" +"取得網路遮罩(即對應於網路前綴的設定位元)或主機遮罩(任何不屬於網路遮罩的位" +"元): ::" #: ../../howto/ipaddress.rst:220 msgid "Exploding or compressing the address::" -msgstr "" +msgstr "展開或壓縮位址: ::" #: ../../howto/ipaddress.rst:222 msgid "" @@ -393,16 +433,19 @@ msgid "" "easily ensure the most concise or most verbose form is used for IPv6 " "addresses while still correctly handling IPv4 addresses." msgstr "" +"雖然 IPv4 不支援展開或壓縮,但相關的物件仍然提供了相關屬性,使得版本中立的程" +"式碼可以輕鬆地確保 IPv6 位址使用最簡潔或最詳細的形式,同時仍能正確處理 IPv4 " +"位址。" #: ../../howto/ipaddress.rst:238 msgid "Networks as lists of Addresses" -msgstr "" +msgstr "作為位址串列的網路" #: ../../howto/ipaddress.rst:240 msgid "" "It's sometimes useful to treat networks as lists. This means it is possible " "to index them like this::" -msgstr "" +msgstr "有時將網路視為串列是很有用的。這意味著可以像這樣對它們進行索引: ::" #: ../../howto/ipaddress.rst:243 msgid "" @@ -428,7 +471,7 @@ msgstr "" msgid "" "It also means that network objects lend themselves to using the list " "membership test syntax like this::" -msgstr "" +msgstr "這也意味著網路物件適合使用串列成員測試語法,像這樣: ::" #: ../../howto/ipaddress.rst:256 msgid "" @@ -440,7 +483,7 @@ msgstr "" #: ../../howto/ipaddress.rst:259 msgid "Containment testing is done efficiently based on the network prefix::" -msgstr "" +msgstr "包含測試是基於網路前綴高效地完成的: ::" #: ../../howto/ipaddress.rst:261 msgid "" @@ -465,6 +508,8 @@ msgid "" ":mod:`ipaddress` provides some simple, hopefully intuitive ways to compare " "objects, where it makes sense::" msgstr "" +":mod:ipaddress 提供了一些簡單且希望是直觀的方法來比較物件,只要這樣做有道" +"理: ::" #: ../../howto/ipaddress.rst:274 msgid "" @@ -478,11 +523,11 @@ msgstr "" msgid "" "A :exc:`TypeError` exception is raised if you try to compare objects of " "different versions or different types." -msgstr "" +msgstr "如果你嘗試比較不同版本或不同類型的物件,會引發 :exc:TypeError 例外。" #: ../../howto/ipaddress.rst:282 msgid "Using IP Addresses with other modules" -msgstr "" +msgstr "與其他模組一起使用 IP 位址" #: ../../howto/ipaddress.rst:284 msgid "" @@ -490,6 +535,8 @@ msgid "" "accept objects from this module directly. Instead, they must be coerced to " "an integer or string that the other module will accept::" msgstr "" +"其他使用 IP 位址的模組(例如 :mod:socket)通常不會直接接受來自此模組的物件。" +"相反地,它們必須被強制轉換為其他模組能接受的整數或字串: ::" #: ../../howto/ipaddress.rst:288 msgid "" @@ -507,7 +554,7 @@ msgstr "" #: ../../howto/ipaddress.rst:296 msgid "Getting more detail when instance creation fails" -msgstr "" +msgstr "在實例建立失敗時取得更多細節" #: ../../howto/ipaddress.rst:298 msgid "" @@ -518,6 +565,10 @@ msgid "" "because it's necessary to know whether the value is *supposed* to be IPv4 or " "IPv6 in order to provide more detail on why it has been rejected." msgstr "" +"當使用版本無關的工廠函式建立位址/網路/介面物件時,任何錯誤都會" +"以 :exc:ValueError 回報,並附帶一個通用的錯誤訊息,簡單地說明傳入的值未被識別" +"為該類型的物件。缺乏具體錯誤的原因是,為了提供更多關於為何被拒絕的細節,需要" +"知道該值應該是 IPv4 還是 IPv6。" #: ../../howto/ipaddress.rst:305 msgid "" @@ -527,12 +578,15 @@ msgid "" "and :exc:`ipaddress.NetmaskValueError` to indicate exactly which part of the " "definition failed to parse correctly." msgstr "" +"為了支援需要存取這些額外細節的使用情境,個別類別建構子實際上會引" +"發 :exc:ValueError 的子類別 :exc:ipaddress.AddressValueError " +"和 :exc:ipaddress.NetmaskValueError,以明確指出定義的哪個部分無法正確解析。" #: ../../howto/ipaddress.rst:311 msgid "" "The error messages are significantly more detailed when using the class " "constructors directly. For example::" -msgstr "" +msgstr "當直接使用類別建構子時,錯誤訊息會詳細得多。例如: ::" #: ../../howto/ipaddress.rst:314 msgid "" @@ -580,6 +634,8 @@ msgid "" "their parent class, so if you're not concerned with the particular type of " "error, you can still write code like the following::" msgstr "" +"然而,這兩個模組特定的例外都以 :exc:ValueError 作為它們的父類別,因此如果你不" +"關心特定類型的錯誤,你仍然可以撰寫如下的程式碼: ::" #: ../../howto/ipaddress.rst:336 msgid "" From 679cee38d21971287e08e812906f065e1a8051d7 Mon Sep 17 00:00:00 2001 From: b95702041 <83135455+b95702041@users.noreply.github.com> Date: Sat, 15 Nov 2025 03:40:37 -0500 Subject: [PATCH 2/5] Updated Last-Translator information --- howto/ipaddress.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/howto/ipaddress.po b/howto/ipaddress.po index 5928fac4d7b..00d7b740961 100644 --- a/howto/ipaddress.po +++ b/howto/ipaddress.po @@ -9,7 +9,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2025-02-19 00:13+0000\n" "PO-Revision-Date: 2025-11-15 01:58-0500\n" -"Last-Translator: Adrian Liaw \n" +"Last-Translator: Chih-Chao Chang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" From e8af45fdb42e104c154f133b880c2d111b43e613 Mon Sep 17 00:00:00 2001 From: b95702041 <83135455+b95702041@users.noreply.github.com> Date: Sat, 15 Nov 2025 03:46:01 -0500 Subject: [PATCH 3/5] Add missing backticks to :mod:, :func:, :exc: references --- howto/ipaddress.po | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/howto/ipaddress.po b/howto/ipaddress.po index 00d7b740961..1d6a9084d57 100644 --- a/howto/ipaddress.po +++ b/howto/ipaddress.po @@ -61,8 +61,8 @@ msgid "" "addresses, the first thing you'll want to do is create some objects. You " "can use :mod:`ipaddress` to create objects from strings and integers." msgstr "" -"由於 :mod:ipaddress 是一個用於檢查和操作 IP 位址的模組,你首先會想要做的事情" -"是建立一些物件。你可以使用 :mod:ipaddress 從字串和整數建立物件。" +"由於 :mod:`ipaddress` 是一個用於檢查和操作 IP 位址的模組,你首先會想要做的事情" +"是建立一些物件。你可以使用 :mod:`ipaddress` 從字串和整數建立物件。" #: ../../howto/ipaddress.rst:32 msgid "A Note on IP Versions" @@ -106,7 +106,7 @@ msgid "" "value:" msgstr "" "位址,通常被稱為「主機位址」,是處理 IP 定址時最基本的單位。建立位址最簡單的" -"方法是使用 :func:ipaddress.ip_address 工廠函式,它會根據傳入的值自動判斷要建" +"方法是使用 :func:`ipaddress.ip_address` 工廠函式,它會根據傳入的值自動判斷要建" "立 IPv4 還是 IPv6 位址:" #: ../../howto/ipaddress.rst:61 @@ -168,7 +168,7 @@ msgid "" "whether or not an address is part of the network and the network address " "defines the expected value of those bits." msgstr "" -"主機位址通常會被分組到 IP 網路中,因此 :mod:ipaddress 提供了一種建立、檢查和" +"主機位址通常會被分組到 IP 網路中,因此 :mod:`ipaddress` 提供了一種建立、檢查和" "操作網路定義的方法。IP 網路物件是從定義該網路所包含之主機位址範圍的字串建構而" "成。這些資訊最簡單的形式是「網路位址/網路前綴」配對,其中前綴定義了用於比較的" "前導位元數量,以判斷位址是否屬於該網路的一部分,而網路位址則定義了這些位元的" @@ -211,7 +211,7 @@ msgid "" "bits instead be coerced to zero, the flag ``strict=False`` can be passed to " "the constructor::" msgstr "" -"預設情況下,嘗試建立帶有主機位元設定的網路物件會導致引發 :exc:ValueError。若" +"預設情況下,嘗試建立帶有主機位元設定的網路物件會導致引發 :exc:`ValueError`。若" "要求將額外的位元強制轉換為零,可以在建構子中傳遞旗標 strict=False: ::" #: ../../howto/ipaddress.rst:112 @@ -279,7 +279,7 @@ msgid "" msgstr "" "如上所述,如果你需要描述特定網路上的位址,位址類別和網路類別都不足以滿足需" "求。像 192.0.2.1/24 這樣的標記法通常被網路工程師以及編寫防火牆和路由器工具的" -"人用作「網路 192.0.2.0/24 上的主機 192.0.2.1」的簡寫。因此,:mod:ipaddress 提" +"人用作「網路 192.0.2.0/24 上的主機 192.0.2.1」的簡寫。因此,:mod:`ipaddress` 提" "供了一組混合類別,將位址與特定網路關聯起來。建立介面的方式與定義網路物件相" "同,只是位址部分不受限於必須是網路位址。" @@ -302,7 +302,7 @@ msgid "" "it. :mod:`ipaddress` tries to make doing this easy and intuitive." msgstr "" "你費心建立了 IPv(4|6)(Address|Network|Interface) 物件,所以你可能想要取得關於" -"它的資訊。:mod:ipaddress 試圖讓這件事變得簡單且直觀。" +"它的資訊。:mod:`ipaddress` 試圖讓這件事變得簡單且直觀。" #: ../../howto/ipaddress.rst:163 msgid "Extracting the IP version::" @@ -508,7 +508,7 @@ msgid "" ":mod:`ipaddress` provides some simple, hopefully intuitive ways to compare " "objects, where it makes sense::" msgstr "" -":mod:ipaddress 提供了一些簡單且希望是直觀的方法來比較物件,只要這樣做有道" +":mod:`ipaddress` 提供了一些簡單且希望是直觀的方法來比較物件,只要這樣做有道" "理: ::" #: ../../howto/ipaddress.rst:274 @@ -523,7 +523,7 @@ msgstr "" msgid "" "A :exc:`TypeError` exception is raised if you try to compare objects of " "different versions or different types." -msgstr "如果你嘗試比較不同版本或不同類型的物件,會引發 :exc:TypeError 例外。" +msgstr "如果你嘗試比較不同版本或不同類型的物件,會引發 :exc:`TypeError` 例外。" #: ../../howto/ipaddress.rst:282 msgid "Using IP Addresses with other modules" @@ -535,7 +535,7 @@ msgid "" "accept objects from this module directly. Instead, they must be coerced to " "an integer or string that the other module will accept::" msgstr "" -"其他使用 IP 位址的模組(例如 :mod:socket)通常不會直接接受來自此模組的物件。" +"其他使用 IP 位址的模組(例如 :mod:`socket`)通常不會直接接受來自此模組的物件。" "相反地,它們必須被強制轉換為其他模組能接受的整數或字串: ::" #: ../../howto/ipaddress.rst:288 @@ -566,7 +566,7 @@ msgid "" "IPv6 in order to provide more detail on why it has been rejected." msgstr "" "當使用版本無關的工廠函式建立位址/網路/介面物件時,任何錯誤都會" -"以 :exc:ValueError 回報,並附帶一個通用的錯誤訊息,簡單地說明傳入的值未被識別" +"以 :exc:`ValueError` 回報,並附帶一個通用的錯誤訊息,簡單地說明傳入的值未被識別" "為該類型的物件。缺乏具體錯誤的原因是,為了提供更多關於為何被拒絕的細節,需要" "知道該值應該是 IPv4 還是 IPv6。" @@ -579,8 +579,8 @@ msgid "" "definition failed to parse correctly." msgstr "" "為了支援需要存取這些額外細節的使用情境,個別類別建構子實際上會引" -"發 :exc:ValueError 的子類別 :exc:ipaddress.AddressValueError " -"和 :exc:ipaddress.NetmaskValueError,以明確指出定義的哪個部分無法正確解析。" +"發 :exc:`ValueError` 的子類別 :exc:`ipaddress.AddressValueError` " +"和 :exc:`ipaddress.NetmaskValueError`,以明確指出定義的哪個部分無法正確解析。" #: ../../howto/ipaddress.rst:311 msgid "" @@ -634,7 +634,7 @@ msgid "" "their parent class, so if you're not concerned with the particular type of " "error, you can still write code like the following::" msgstr "" -"然而,這兩個模組特定的例外都以 :exc:ValueError 作為它們的父類別,因此如果你不" +"然而,這兩個模組特定的例外都以 :exc:`ValueError` 作為它們的父類別,因此如果你不" "關心特定類型的錯誤,你仍然可以撰寫如下的程式碼: ::" #: ../../howto/ipaddress.rst:336 @@ -648,3 +648,4 @@ msgstr "" " network = ipaddress.IPv4Network(address)\n" "except ValueError:\n" " print('address/netmask is invalid for IPv4:', address)" + From c270429ea4ee6e907c3b912181af6c2177df9206 Mon Sep 17 00:00:00 2001 From: b95702041 <83135455+b95702041@users.noreply.github.com> Date: Sat, 15 Nov 2025 09:38:41 -0500 Subject: [PATCH 4/5] Translate howto/ipaddress.po --- howto/ipaddress.po | 49 +++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/howto/ipaddress.po b/howto/ipaddress.po index 1d6a9084d57..969cbab5e73 100644 --- a/howto/ipaddress.po +++ b/howto/ipaddress.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2025-02-19 00:13+0000\n" -"PO-Revision-Date: 2025-11-15 01:58-0500\n" +"PO-Revision-Date: 2025-11-15 09:37-0500\n" "Last-Translator: Chih-Chao Chang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -61,12 +61,12 @@ msgid "" "addresses, the first thing you'll want to do is create some objects. You " "can use :mod:`ipaddress` to create objects from strings and integers." msgstr "" -"由於 :mod:`ipaddress` 是一個用於檢查和操作 IP 位址的模組,你首先會想要做的事情" -"是建立一些物件。你可以使用 :mod:`ipaddress` 從字串和整數建立物件。" +"由於 :mod:`ipaddress` 是一個用於檢查和操作 IP 位址的模組,你首先會想要做的事" +"情是建立一些物件。你可以使用 :mod:`ipaddress` 從字串和整數建立物件。" #: ../../howto/ipaddress.rst:32 msgid "A Note on IP Versions" -msgstr "關於IP 版本的說明" +msgstr "關於 IP 版本的說明" #: ../../howto/ipaddress.rst:34 msgid "" @@ -78,7 +78,7 @@ msgid "" "given the increasing number of devices with direct connections to the " "internet." msgstr "" -"對於不太熟悉 IP 定址的讀者來說,重要的是要知道網際網路協定 (Internet " +"對於不太熟悉 IP 位址的讀者來說,重要的是要知道網際網路協定 (Internet " "Protocol, IP) 目前正在從協定的第 4 版過渡到第 6 版。這個轉換主要是因為協定的" "第 4 版無法提供足夠的位址來處理全世界的需求,特別是考慮到直接連接到網際網路的" "裝置數量不斷增加。" @@ -105,9 +105,9 @@ msgid "" "determines whether to create an IPv4 or IPv6 address based on the passed in " "value:" msgstr "" -"位址,通常被稱為「主機位址」,是處理 IP 定址時最基本的單位。建立位址最簡單的" -"方法是使用 :func:`ipaddress.ip_address` 工廠函式,它會根據傳入的值自動判斷要建" -"立 IPv4 還是 IPv6 位址:" +"位址,通常被稱為「主機位址」,是處理 IP 位址時最基本的單位。建立位址最簡單的" +"方法是使用 :func:`ipaddress.ip_address` 工廠函式,它會根據傳入的值自動判斷要" +"建立 IPv4 還是 IPv6 位址:" #: ../../howto/ipaddress.rst:61 msgid "" @@ -168,11 +168,11 @@ msgid "" "whether or not an address is part of the network and the network address " "defines the expected value of those bits." msgstr "" -"主機位址通常會被分組到 IP 網路中,因此 :mod:`ipaddress` 提供了一種建立、檢查和" -"操作網路定義的方法。IP 網路物件是從定義該網路所包含之主機位址範圍的字串建構而" -"成。這些資訊最簡單的形式是「網路位址/網路前綴」配對,其中前綴定義了用於比較的" -"前導位元數量,以判斷位址是否屬於該網路的一部分,而網路位址則定義了這些位元的" -"預期值。" +"主機位址通常會被分組到 IP 網路中,因此 :mod:`ipaddress` 提供了一種建立、檢查" +"和操作網路定義的方法。IP 網路物件是從定義該網路所包含之主機位址範圍的字串建構" +"而成。這些資訊最簡單的形式是「網路位址/網路前綴」配對,其中前綴定義了用於比較" +"的前導位元數量,以判斷位址是否屬於該網路的一部分,而網路位址則定義了這些位元" +"的預期值。" #: ../../howto/ipaddress.rst:93 msgid "" @@ -211,8 +211,8 @@ msgid "" "bits instead be coerced to zero, the flag ``strict=False`` can be passed to " "the constructor::" msgstr "" -"預設情況下,嘗試建立帶有主機位元設定的網路物件會導致引發 :exc:`ValueError`。若" -"要求將額外的位元強制轉換為零,可以在建構子中傳遞旗標 strict=False: ::" +"預設情況下,嘗試建立帶有主機位元設定的網路物件會導致引發 :exc:`ValueError`。" +"若要求將額外的位元強制轉換為零,可以在建構子中傳遞旗標 strict=False: ::" #: ../../howto/ipaddress.rst:112 msgid "" @@ -279,8 +279,8 @@ msgid "" msgstr "" "如上所述,如果你需要描述特定網路上的位址,位址類別和網路類別都不足以滿足需" "求。像 192.0.2.1/24 這樣的標記法通常被網路工程師以及編寫防火牆和路由器工具的" -"人用作「網路 192.0.2.0/24 上的主機 192.0.2.1」的簡寫。因此,:mod:`ipaddress` 提" -"供了一組混合類別,將位址與特定網路關聯起來。建立介面的方式與定義網路物件相" +"人用作「網路 192.0.2.0/24 上的主機 192.0.2.1」的簡寫。因此,:mod:`ipaddress` " +"提供了一組混合類別,將位址與特定網路關聯起來。建立介面的方式與定義網路物件相" "同,只是位址部分不受限於必須是網路位址。" #: ../../howto/ipaddress.rst:152 @@ -535,8 +535,8 @@ msgid "" "accept objects from this module directly. Instead, they must be coerced to " "an integer or string that the other module will accept::" msgstr "" -"其他使用 IP 位址的模組(例如 :mod:`socket`)通常不會直接接受來自此模組的物件。" -"相反地,它們必須被強制轉換為其他模組能接受的整數或字串: ::" +"其他使用 IP 位址的模組(例如 :mod:`socket`)通常不會直接接受來自此模組的物" +"件。相反地,它們必須被強制轉換為其他模組能接受的整數或字串: ::" #: ../../howto/ipaddress.rst:288 msgid "" @@ -566,9 +566,9 @@ msgid "" "IPv6 in order to provide more detail on why it has been rejected." msgstr "" "當使用版本無關的工廠函式建立位址/網路/介面物件時,任何錯誤都會" -"以 :exc:`ValueError` 回報,並附帶一個通用的錯誤訊息,簡單地說明傳入的值未被識別" -"為該類型的物件。缺乏具體錯誤的原因是,為了提供更多關於為何被拒絕的細節,需要" -"知道該值應該是 IPv4 還是 IPv6。" +"以 :exc:`ValueError` 回報,並附帶一個通用的錯誤訊息,簡單地說明傳入的值未被識" +"別為該類型的物件。缺乏具體錯誤的原因是,為了提供更多關於為何被拒絕的細節,需" +"要知道該值應該是 IPv4 還是 IPv6。" #: ../../howto/ipaddress.rst:305 msgid "" @@ -634,8 +634,8 @@ msgid "" "their parent class, so if you're not concerned with the particular type of " "error, you can still write code like the following::" msgstr "" -"然而,這兩個模組特定的例外都以 :exc:`ValueError` 作為它們的父類別,因此如果你不" -"關心特定類型的錯誤,你仍然可以撰寫如下的程式碼: ::" +"然而,這兩個模組特定的例外都以 :exc:`ValueError` 作為它們的父類別,因此如果你" +"不關心特定類型的錯誤,你仍然可以撰寫如下的程式碼: ::" #: ../../howto/ipaddress.rst:336 msgid "" @@ -648,4 +648,3 @@ msgstr "" " network = ipaddress.IPv4Network(address)\n" "except ValueError:\n" " print('address/netmask is invalid for IPv4:', address)" - From ff382cf0d8fcb9fc9a1481c03fbe04d7ce7f8b9d Mon Sep 17 00:00:00 2001 From: b95702041 <83135455+b95702041@users.noreply.github.com> Date: Sat, 15 Nov 2025 10:15:59 -0500 Subject: [PATCH 5/5] Translate howto/ipaddress.po --- howto/ipaddress.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/howto/ipaddress.po b/howto/ipaddress.po index 969cbab5e73..ac93ea18970 100644 --- a/howto/ipaddress.po +++ b/howto/ipaddress.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2025-02-19 00:13+0000\n" -"PO-Revision-Date: 2025-11-15 09:37-0500\n" +"PO-Revision-Date: 2025-11-15 10:14-0500\n" "Last-Translator: Chih-Chao Chang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -483,7 +483,7 @@ msgstr "" #: ../../howto/ipaddress.rst:259 msgid "Containment testing is done efficiently based on the network prefix::" -msgstr "包含測試是基於網路前綴高效地完成的: ::" +msgstr "msgstr \"可以根據網路前綴有效率地檢查是否包含: ::\"" #: ../../howto/ipaddress.rst:261 msgid ""