diff --git a/library/enum.po b/library/enum.po index 84d1026bc1b..74ea042065b 100644 --- a/library/enum.po +++ b/library/enum.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-08-23 00:03+0000\n" -"PO-Revision-Date: 2018-05-23 16:01+0000\n" +"PO-Revision-Date: 2023-09-04 13:48+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -20,7 +20,7 @@ msgstr "" #: ../../library/enum.rst:2 msgid ":mod:`enum` --- Support for enumerations" -msgstr "" +msgstr ":mod:`enum` --- 對列舉的支援" #: ../../library/enum.rst:14 msgid "**Source code:** :source:`Lib/enum.py`" @@ -30,47 +30,47 @@ msgstr "**原始碼:**\\ :source:`Lib/enum.py`" msgid "" "This page contains the API reference information. For tutorial information " "and discussion of more advanced topics, see" -msgstr "" +msgstr "本頁包含 API 的參考資訊。關於教學資訊及更多進階主題的討論請參考" #: ../../library/enum.rst:21 msgid ":ref:`Basic Tutorial `" -msgstr "" +msgstr ":ref:`基本教學 `" #: ../../library/enum.rst:22 msgid ":ref:`Advanced Tutorial `" -msgstr "" +msgstr ":ref:`進階教學 `" #: ../../library/enum.rst:23 msgid ":ref:`Enum Cookbook `" -msgstr "" +msgstr ":ref:`列舉指南 `" #: ../../library/enum.rst:27 msgid "An enumeration:" -msgstr "" +msgstr "列舉:" #: ../../library/enum.rst:29 msgid "is a set of symbolic names (members) bound to unique values" -msgstr "" +msgstr "是一組綁定唯一值的代表名稱(成員)" #: ../../library/enum.rst:30 msgid "" "can be iterated over to return its canonical (i.e. non-alias) members in " "definition order" -msgstr "" +msgstr "可以用疊代的方式以定義的順序回傳其正式 (canonical)(即非別名)成員" #: ../../library/enum.rst:32 msgid "uses *call* syntax to return members by value" -msgstr "" +msgstr "使用 *call* 語法來透過值回傳成員" #: ../../library/enum.rst:33 msgid "uses *index* syntax to return members by name" -msgstr "" +msgstr "使用 *index* 語法來透過名稱回傳成員" #: ../../library/enum.rst:35 msgid "" "Enumerations are created either by using :keyword:`class` syntax, or by " "using function-call syntax::" -msgstr "" +msgstr "列舉透過 :keyword:`class` 語法或函式呼叫的語法來建立: ::" #: ../../library/enum.rst:49 msgid "" @@ -78,26 +78,32 @@ msgid "" "not normal Python classes. See :ref:`How are Enums different? ` for more details." msgstr "" +"雖然我們可以用 :keyword:`class` 語法來建立列舉,列舉並不是標準的 Python 類" +"別。參考\\ :ref:`列舉有何差異 `\\ 以取得更多細節。" #: ../../library/enum.rst:53 msgid "Nomenclature" -msgstr "" +msgstr "命名方式" #: ../../library/enum.rst:55 msgid "The class :class:`!Color` is an *enumeration* (or *enum*)" -msgstr "" +msgstr ":class:`!Color` 類別是一個\\ *列舉*\\ (或 *enum*)" #: ../../library/enum.rst:56 msgid "" "The attributes :attr:`!Color.RED`, :attr:`!Color.GREEN`, etc., are " "*enumeration members* (or *members*) and are functionally constants." msgstr "" +":attr:`!Color.RED`、:attr:`!Color.GREEN` 等屬性是\\ *列舉成員*\\ (或\\ *成員" +"*),並且使用上可以看作常數。" #: ../../library/enum.rst:58 msgid "" "The enum members have *names* and *values* (the name of :attr:`!Color.RED` " "is ``RED``, the value of :attr:`!Color.BLUE` is ``3``, etc.)" msgstr "" +"列舉成員有\\ *名稱*\\ 和\\ *值*\\ (:attr:`!Color.RED` 的名稱是 ``RED``,:" +"attr:`!Color.BLUE` 的值是 ``3`` 諸如此類)" #: ../../library/enum.rst:65 msgid "Module Contents" @@ -109,7 +115,7 @@ msgstr ":class:`EnumType`" #: ../../library/enum.rst:69 msgid "The ``type`` for Enum and its subclasses." -msgstr "" +msgstr "Enum 及其子類別的 ``type``。" #: ../../library/enum.rst:71 msgid ":class:`Enum`" @@ -117,7 +123,7 @@ msgstr ":class:`Enum`" #: ../../library/enum.rst:73 msgid "Base class for creating enumerated constants." -msgstr "" +msgstr "用來建立列舉常數的基礎類別。" #: ../../library/enum.rst:75 msgid ":class:`IntEnum`" @@ -128,6 +134,8 @@ msgid "" "Base class for creating enumerated constants that are also subclasses of :" "class:`int`. (`Notes`_)" msgstr "" +"用來建立列舉常數的基礎類別,同時也是 :class:`int` 的子類別。(`備註 " +"`_)" #: ../../library/enum.rst:80 msgid ":class:`StrEnum`" @@ -138,6 +146,8 @@ msgid "" "Base class for creating enumerated constants that are also subclasses of :" "class:`str`. (`Notes`_)" msgstr "" +"用來建立列舉常數的基礎類別,同時也是 :class:`str` 的子類別。(`備註 " +"`_)" #: ../../library/enum.rst:85 msgid ":class:`Flag`" @@ -148,6 +158,8 @@ msgid "" "Base class for creating enumerated constants that can be combined using the " "bitwise operations without losing their :class:`Flag` membership." msgstr "" +"用來建立列舉常數的基礎類別,可以使用位元操作來結合成員且其結果不失去 :class:" +"`Flag` 的成員資格。" #: ../../library/enum.rst:90 msgid ":class:`IntFlag`" @@ -159,6 +171,9 @@ msgid "" "bitwise operators without losing their :class:`IntFlag` membership. :class:" "`IntFlag` members are also subclasses of :class:`int`. (`Notes`_)" msgstr "" +"用來建立列舉常數的基礎類別,可以使用位元操作來結合成員且其結果不失去 :class:" +"`IntFlag` 的成員資格。:class:`IntFlag` 的成員也是 :class:`int` 的子類別。(`" +"備註 `_)" #: ../../library/enum.rst:96 msgid ":class:`ReprEnum`" @@ -169,6 +184,8 @@ msgid "" "Used by :class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag` to keep " "the :class:`str() ` of the mixed-in type." msgstr "" +"由 :class:`IntEnum`、:class:`StrEnum` 及 :class:`IntFlag` 所使用來保留這些混" +"合類型的 :class:`str() `。" #: ../../library/enum.rst:101 msgid ":class:`EnumCheck`" @@ -180,6 +197,8 @@ msgid "" "``UNIQUE``, for use with :func:`verify` to ensure various constraints are " "met by a given enumeration." msgstr "" +"一個有 ``CONTINUOUS``、``NAMED_FLAGS`` 及 ``UNIQUE`` 這些值的列舉,和 :func:" +"`verify` 一起使用來確保給定的列舉符合多種限制。" #: ../../library/enum.rst:107 msgid ":class:`FlagBoundary`" @@ -191,6 +210,8 @@ msgid "" "``KEEP`` which allows for more fine-grained control over how invalid values " "are dealt with in an enumeration." msgstr "" +"一個有 ``STRICT``、``CONFORM``、``EJECT`` 及 ``KEEP`` 這些值的列舉,允許列舉" +"對如何處理非法值做更細微的控制。" #: ../../library/enum.rst:113 msgid ":class:`auto`" @@ -202,6 +223,8 @@ msgid "" "`StrEnum` defaults to the lower-cased version of the member name, while " "other Enums default to 1 and increase from there." msgstr "" +"列舉成員的實例會被取代成合適的值。:class:`StrEnum` 預設是小寫版本的成員名稱," +"其它列舉則預設是 1 且往後遞增。" #: ../../library/enum.rst:119 msgid ":func:`~enum.property`" @@ -213,6 +236,8 @@ msgid "" "member names. The ``value`` and ``name`` attributes are implemented this " "way." msgstr "" +"允許 :class:`Enum` 成員擁有屬性且不會與成員名稱有衝突。``value`` 及 ``name`` " +"屬性是用這個方式來實作。" #: ../../library/enum.rst:125 msgid ":func:`unique`" @@ -221,7 +246,7 @@ msgstr ":func:`unique`" #: ../../library/enum.rst:127 msgid "" "Enum class decorator that ensures only one name is bound to any one value." -msgstr "" +msgstr "Enum 類別的裝飾器,用來確保任何值只有綁定到一個名稱上。" #: ../../library/enum.rst:129 msgid ":func:`verify`" @@ -231,7 +256,7 @@ msgstr ":func:`verify`" msgid "" "Enum class decorator that checks user-selectable constraints on an " "enumeration." -msgstr "" +msgstr "Enum 類別的裝飾器,用來檢查列舉上使用者所選的限制。" #: ../../library/enum.rst:134 msgid ":func:`member`" @@ -239,7 +264,7 @@ msgstr ":func:`member`" #: ../../library/enum.rst:136 msgid "Make ``obj`` a member. Can be used as a decorator." -msgstr "" +msgstr "讓 ``obj`` 變成成員。可以當作裝飾器使用。" #: ../../library/enum.rst:138 msgid ":func:`nonmember`" @@ -247,7 +272,7 @@ msgstr ":func:`nonmember`" #: ../../library/enum.rst:140 msgid "Do not make ``obj`` a member. Can be used as a decorator." -msgstr "" +msgstr "不讓 ``obj`` 變成成員。可以當作裝飾器使用。" #: ../../library/enum.rst:142 msgid ":func:`global_enum`" @@ -259,6 +284,8 @@ msgid "" "members as belonging to the module instead of its class, and export the enum " "members to the global namespace." msgstr "" +"修改列舉上的 :class:`str() ` 及 :func:`repr` ,讓成員顯示為屬於模組而不" +"是類別,並將該列舉成員匯出到全域命名空間。" #: ../../library/enum.rst:148 msgid ":func:`show_flag_values`" @@ -266,7 +293,7 @@ msgstr ":func:`show_flag_values`" #: ../../library/enum.rst:150 msgid "Return a list of all power-of-two integers contained in a flag." -msgstr "" +msgstr "回傳旗標 (flag) 裡包含的所有 2 的次方的整數串列。" #: ../../library/enum.rst:153 msgid "``Flag``, ``IntFlag``, ``auto``" @@ -282,7 +309,7 @@ msgstr "" #: ../../library/enum.rst:159 msgid "Data Types" -msgstr "" +msgstr "資料型別" #: ../../library/enum.rst:164 msgid "" @@ -290,6 +317,8 @@ msgid "" "to subclass *EnumType* -- see :ref:`Subclassing EnumType ` for details." msgstr "" +"*EnumType* 是\\ *列舉*\\ 的 :term:`metaclass`。*EnumType* 可以有子類別 -- 細" +"節請參考 :ref:`建立 EnumType 的子類別 `。" #: ../../library/enum.rst:168 msgid "" @@ -298,14 +327,17 @@ msgid "" "*enum*, as well as creating the enum members, properly handling duplicates, " "providing iteration over the enum class, etc." msgstr "" +"*EnumType* 負責在最後的\\ *列舉*\\ 上面設定正確的 :meth:`!__repr__`、:meth:`!" +"__str__`、:meth:`!__format__` 及 :meth:`!__reduce__` 方法,以及建立列舉成員," +"並正確處理重複,提供列舉類別的疊代等等。" #: ../../library/enum.rst:175 msgid "This method is called in two different ways:" -msgstr "" +msgstr "這個方法可以用兩種不同的方式呼叫:" #: ../../library/enum.rst:177 msgid "to look up an existing member:" -msgstr "" +msgstr "查詢已存在的成員:" #: ../../library/enum.rst:0 msgid "cls" @@ -313,78 +345,78 @@ msgstr "cls" #: ../../library/enum.rst:179 ../../library/enum.rst:185 msgid "The enum class being called." -msgstr "" +msgstr "所呼叫的列舉類別。" #: ../../library/enum.rst:0 msgid "value" -msgstr "" +msgstr "value" #: ../../library/enum.rst:180 msgid "The value to lookup." -msgstr "" +msgstr "要查詢的值。" #: ../../library/enum.rst:182 msgid "" "to use the ``cls`` enum to create a new enum (only if the existing enum does " "not have any members):" -msgstr "" +msgstr "使用 ``cls`` 列舉來建立新列舉(只有在現有列舉沒有任何成員時)" #: ../../library/enum.rst:186 msgid "The name of the new Enum to create." -msgstr "" +msgstr "要建立的新列舉的名稱。" #: ../../library/enum.rst:0 msgid "names" -msgstr "" +msgstr "names" #: ../../library/enum.rst:187 msgid "The names/values of the members for the new Enum." -msgstr "" +msgstr "新列舉的成員的名稱/值。" #: ../../library/enum.rst:0 msgid "module" -msgstr "模組" +msgstr "module" #: ../../library/enum.rst:188 msgid "The name of the module the new Enum is created in." -msgstr "" +msgstr "新列舉要建立在哪個模組名稱下。" #: ../../library/enum.rst:0 msgid "qualname" -msgstr "" +msgstr "qualname" #: ../../library/enum.rst:189 msgid "The actual location in the module where this Enum can be found." -msgstr "" +msgstr "這個列舉在模組裡實際上的位置。" #: ../../library/enum.rst:0 msgid "type" -msgstr "" +msgstr "type" #: ../../library/enum.rst:190 msgid "A mix-in type for the new Enum." -msgstr "" +msgstr "新列舉的混合類型。" #: ../../library/enum.rst:0 msgid "start" -msgstr "" +msgstr "start" #: ../../library/enum.rst:191 msgid "The first integer value for the Enum (used by :class:`auto`)." -msgstr "" +msgstr "列舉的第一個整數值(由 :class:`auto` 所使用)" #: ../../library/enum.rst:0 msgid "boundary" -msgstr "" +msgstr "boundary" #: ../../library/enum.rst:192 msgid "" "How to handle out-of-range values from bit operations (:class:`Flag` only)." -msgstr "" +msgstr "在位元操作時怎麼處理不在範圍內的值(只有 :class:`Flag` 會用到)" #: ../../library/enum.rst:196 msgid "Returns ``True`` if member belongs to the ``cls``::" -msgstr "" +msgstr "如果 member 屬於 ``cls`` 則回傳 ``True``: ::" #: ../../library/enum.rst:204 msgid "" @@ -392,50 +424,55 @@ msgid "" "members; until then, a ``TypeError`` will be raised if a non-Enum-member is " "used in a containment check." msgstr "" +"在 Python 3.12 中這可以檢查成員的值,而不只是檢查成員;在此之前,如果用非列舉" +"成員做屬於檢查會引發 ``TypeError``。" #: ../../library/enum.rst:210 msgid "" "Returns ``['__class__', '__doc__', '__members__', '__module__']`` and the " "names of the members in *cls*::" msgstr "" +"回傳 ``['__class__', '__doc__', '__members__', '__module__']`` 及 *cls* 的成" +"員名稱: ::" #: ../../library/enum.rst:218 msgid "" "Returns the Enum member in *cls* matching *name*, or raises a :exc:" "`KeyError`::" -msgstr "" +msgstr "回傳 *cls* 中符合 *name* 的列舉成員,或引發 :exc:`KeyError`: ::" #: ../../library/enum.rst:225 msgid "Returns each member in *cls* in definition order::" -msgstr "" +msgstr "以定義的順序回傳在 *cls* 中的每個成員: ::" #: ../../library/enum.rst:232 msgid "Returns the number of member in *cls*::" -msgstr "" +msgstr "回傳 *cls* 的成員數量: ::" #: ../../library/enum.rst:239 msgid "Returns each member in *cls* in reverse definition order::" -msgstr "" +msgstr "以跟定義相反的順序回傳 *cls* 的每個成員: ::" #: ../../library/enum.rst:246 msgid "Before 3.11 ``enum`` used ``EnumMeta`` type, which is kept as an alias." msgstr "" +"在 3.11 之前,``enum`` 使用 ``EnumMeta`` 類型,目前保留此類型當作別名。" #: ../../library/enum.rst:251 msgid "*Enum* is the base class for all *enum* enumerations." -msgstr "" +msgstr "*Enum* 是所有 *enum* 列舉的基礎類別。" #: ../../library/enum.rst:255 msgid "The name used to define the ``Enum`` member::" -msgstr "" +msgstr "用來定義 ``Enum`` 成員的名稱: ::" #: ../../library/enum.rst:262 msgid "The value given to the ``Enum`` member::" -msgstr "" +msgstr "``Enum`` 成員給定的值: ::" #: ../../library/enum.rst:267 msgid "Enum member values" -msgstr "" +msgstr "列舉成員的值" #: ../../library/enum.rst:269 msgid "" @@ -443,12 +480,15 @@ msgid "" "exact value is unimportant you may use :class:`auto` instances and an " "appropriate value will be chosen for you. See :class:`auto` for the details." msgstr "" +"成員的值可以是任何值::class:`int`、:class:`str` 等等。如果實際使用什麼值並不" +"重要,你可以使用 :class:`auto` 實例,它會為你選擇適合的值。更多細節請參考 :" +"class:`auto`。" #: ../../library/enum.rst:276 msgid "" "``_ignore_`` is only used during creation and is removed from the " "enumeration once creation is complete." -msgstr "" +msgstr "``_ignore_`` 只有在建立的時候用到,在列舉建立完成後會被移除。" #: ../../library/enum.rst:279 msgid "" @@ -456,58 +496,64 @@ msgid "" "names will also be removed from the completed enumeration. See :ref:" "`TimePeriod ` for an example." msgstr "" +"``_ignore_`` 是一個不會變成成員的名稱串列,在列舉建立完成後其名稱會被移除。範" +"例請參考 :ref:`TimePeriod `。" #: ../../library/enum.rst:285 msgid "" "Returns ``['__class__', '__doc__', '__module__', 'name', 'value']`` and any " "public methods defined on *self.__class__*::" msgstr "" +"回傳 ``['__class__', '__doc__', '__module__', 'name', 'value']`` 及任何 " +"*self.__class__* 上定義的公開方法: ::" #: ../../library/enum.rst:0 msgid "name" -msgstr "" +msgstr "name" #: ../../library/enum.rst:306 msgid "The name of the member being defined (e.g. 'RED')." -msgstr "" +msgstr "定義的成員名稱(例如 'RED')。" #: ../../library/enum.rst:307 msgid "The start value for the Enum; the default is 1." -msgstr "" +msgstr "列舉的開始值,預設為 1。" #: ../../library/enum.rst:0 msgid "count" -msgstr "" +msgstr "count" #: ../../library/enum.rst:308 msgid "The number of members currently defined, not including this one." -msgstr "" +msgstr "已定義的成員數量,不包含目前這一個。" #: ../../library/enum.rst:0 msgid "last_values" -msgstr "" +msgstr "last_values" #: ../../library/enum.rst:309 msgid "A list of the previous values." -msgstr "" +msgstr "一個之前值的串列。" #: ../../library/enum.rst:311 msgid "" "A *staticmethod* that is used to determine the next value returned by :class:" "`auto`::" -msgstr "" +msgstr "一個 *staticmethod*,用來決定 :class:`auto` 下一個要回傳的值的: ::" #: ../../library/enum.rst:327 msgid "" "A *classmethod* that is used to further configure subsequent subclasses. By " "default, does nothing." -msgstr "" +msgstr "一個 *classmethod*,用來進一步設定後續的子類別,預設不做任何事。" #: ../../library/enum.rst:332 msgid "" "A *classmethod* for looking up values not found in *cls*. By default it " "does nothing, but can be overridden to implement custom search behavior::" msgstr "" +"一個 *classmethod*,用來查詢在 *cls* 裡找不到的值。預設不做任何事,但可以被覆" +"寫以實作客製化的搜尋行為: ::" #: ../../library/enum.rst:354 msgid ""