Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 75 additions & 19 deletions howto/ipaddress.po
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
"tw)\n"
Expand All @@ -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"
Expand Down Expand Up @@ -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 ""
Expand All @@ -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 ""
Expand All @@ -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 ""
Expand All @@ -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 ""
Expand All @@ -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 ""
Expand Down Expand Up @@ -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 ""
Expand All @@ -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 標記法通常用於描述電腦在給定"
"網路上的網路介面,並將在下一節中進一步說明。"
Comment on lines +203 to +205
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"網路物件不能設定任何主機位元。這樣做的實際效果是 192.0.2.1/24 並不描述一個網"
"路。這類定義被稱為介面物件,因為 ip-on-a-network 標記法通常用於描述電腦在給定"
"網路上的網路介面,並將在下一節中進一步說明。"
"網路物件不能設定任何主機位元。這樣做的實際效果是 ``192.0.2.1/24`` 並不描述一個網"
"路。這類定義被稱為介面物件,因為 ip-on-a-network 標記法通常用於描述電腦在給定"
"網路上的網路介面,並將在下一節中進一步說明。"


#: ../../howto/ipaddress.rst:107
msgid ""
Expand All @@ -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 ""
Expand All @@ -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 ""
Expand All @@ -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 ""
Expand All @@ -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"
Expand All @@ -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 ""
Expand All @@ -288,7 +326,7 @@ msgstr ""

#: ../../howto/ipaddress.rst:172
msgid "Obtaining the network from an interface::"
msgstr ""
msgstr "從介面取得網路: ::"

#: ../../howto/ipaddress.rst:174
msgid ""
Expand All @@ -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 ""
Expand All @@ -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 ""
Expand Down Expand Up @@ -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 ""
Expand Down Expand Up @@ -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 ""
Expand All @@ -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 ""
Expand All @@ -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 ""
Expand All @@ -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 ""
Expand All @@ -478,18 +523,20 @@ 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 ""
"Other modules that use IP addresses (such as :mod:`socket`) usually won't "
"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 ""
Expand All @@ -507,7 +554,7 @@ msgstr ""

#: ../../howto/ipaddress.rst:296
msgid "Getting more detail when instance creation fails"
msgstr ""
msgstr "在實例建立失敗時取得更多細節"

#: ../../howto/ipaddress.rst:298
msgid ""
Expand All @@ -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 ""
Expand All @@ -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 ""
Expand Down Expand Up @@ -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 ""
Expand Down