8000 [po] auto sync · python/python-docs-zh-cn@132358c · GitHub
[go: up one dir, main page]

Skip to content

Commit 132358c

Browse files
[po] auto sync
1 parent 1a2f5ee commit 132358c

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

.stat.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"translation": "81.06%", "updated_at": "2025-03-06T06:56:02Z"}
1+
{"translation": "81.07%", "updated_at": "2025-03-06T14:55:29Z"}

howto/enum.po

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1839,12 +1839,16 @@ msgid ""
18391839
"codes (such as ``%i`` or ``%h`` for IntEnum) treat the enum member as its "
18401840
"mixed-in type."
18411841
msgstr ""
1842+
"% 形式的格式化: ``%s`` 和 ``%r`` 会分别调用 :class:`Enum` 类的 :meth:`~object.__str__` 和 "
1843+
":meth:`~object.__repr__`;其他代码(如 ``%i`` 或 ``%h`` 用于 IntEnum)会将枚举成员当作对应的混入类型。"
18421844

18431845
#: ../../howto/enum.rst:917
18441846
msgid ""
18451847
":ref:`Formatted string literals <f-strings>`, :meth:`str.format`, and "
18461848
":func:`format` will use the enum's :meth:`~object.__str__` method."
18471849
msgstr ""
1850+
":ref:`格式化字符串字面值 <f-strings>`, :meth:`str.format` 和 :func:`format` 将使用枚举的 "
1851+
":meth:`~object.__str__` 方法。"
18481852

18491853
#: ../../howto/enum.rst:922
18501854
msgid ""
@@ -1853,10 +1857,12 @@ msgid ""
18531857
":meth:`~object.__str__` method has been reset to their data types' "
18541858
":meth:`~object.__str__` method."
18551859
msgstr ""
1860+
"由于 :class:`IntEnum`, :class:`IntFlag` 和 :class:`StrEnum` 被设计为现有常量的无缝替换,它们的 "
1861+
":meth:`~object.__str__` 方法已被重置为其数据类型的 :meth:`~object.__str__` 方法。"
18561862

18571863
#: ../../howto/enum.rst:930
18581864
msgid "When to use :meth:`~object.__new__` vs. :meth:`~object.__init__`"
1859-
msgstr ""
1865+
msgstr "何时应使用 :meth:`~object.__new__` 或 :meth:`~object.__init__`"
18601866

18611867
#: ../../howto/enum.rst:932
18621868
msgid ""
@@ -1865,6 +1871,9 @@ msgid ""
18651871
" either :meth:`~object.__new__` or :meth:`~object.__init__`, with "
18661872
":meth:`~object.__init__` being preferred."
18671873
msgstr ""
1874+
"当你想要定制 :class:`Enum` 成员的实际值时你必须使用 :meth:`~object.__new__`。 任何其他修改则可使用 "
1875+
":meth:`~object.__new__` 或 :meth:`~object.__init__`,其中 "
1876+
":meth:`~object.__init__` 更为推荐。"
18681877

18691878
#: ../../howto/enum.rst:936
18701879
msgid ""
@@ -2033,6 +2042,8 @@ msgid ""
20332042
"attribute can be provided. It will be checked against the actual order of "
20342043
"the enumeration and raise an error if the two do not match::"
20352044
msgstr ""
2045+
"用于帮助 Python 2 / Python 3 代码保持同步以便提供 :attr:`~Enum._order_` 属性。 "
2046+
"它将与枚举的实际顺序进行检查并会在两者不匹配时引发错误::"
20362047

20372048
#: ../../howto/enum.rst:1017
20382049
msgid ""
@@ -2437,6 +2448,12 @@ msgid ""
24372448
"correct (such as :meth:`~object.__new__`, :meth:`~object.__getnewargs__`, "
24382449
":meth:`~object.__str__` and :meth:`~object.__repr__`)."
24392450
msgstr ""
2451+
":class:`EnumType` 元类负责提供 :meth:`~object.__contains__`, "
2452+
":meth:`~object.__dir__`, :meth:`~object.__iter__` 及其他方法来允许人们在 :class:`Enum` "
2453+
"类上做一些在常规类上会失败的事情,比如 ``list(Color)`` 或 ``some_enum_var in Color``。 "
2454+
":class:`EnumType` 负责确保最终的 :class:`Enum` 类上的各种其他方法是正确的(比如 "
2455+
":meth:`~object.__new__`, :meth:`~object.__getnewargs__`, "
2456+
":meth:`~object.__str__` 和 :meth:`~object.__repr__` 等)。"
24402457

24412458
#: ../../howto/enum.rst:1228
24422459
msgid "Flag Classes"
@@ -2465,6 +2482,8 @@ msgid ""
24652482
"that no new ones are ever instantiated by returning only the existing member"
24662483
" instances."
24672484
msgstr ""
2485+
"有关枚举成员的最有趣的一点在于它们都是单例。 :class:`EnumType` 会在创建枚举类本身时全部创建它们,然后放置一个自定义的 "
2486+
":meth:`~object.__new__` 以通过只返回现有的成员实例来确保没有新的成员被实例化。"
24682487

24692488
#: ../../howto/enum.rst:1244
24702489
msgid "Flag Members"
@@ -2976,6 +2995,7 @@ msgid ""
29762995
"If :meth:`~object.__new__` or :meth:`~object.__init__` is defined, the value"
29772996
" of the enum member will be passed to those methods::"
29782997
msgstr ""
2998+
"如果定义了 :meth:`~object.__new__` 或 :meth:`~object.__init__`,则枚举成员的值将被传给这些方法::"
29792999

29803000
#: ../../howto/enum.rst:1511
29813001
msgid ""
@@ -3031,7 +3051,7 @@ msgstr "TimePeriod"
30313051

30323052
#: ../../howto/enum.rst:1539
30333053
msgid "An example to show the :attr:`~Enum._ignore_` attribute in use::"
3034-
msgstr ""
3054+
msgstr "一个演示如何使用 :attr:`~Enum._ignore_` 属性的例子::"
30353055

30363056
#: ../../howto/enum.rst:1541
30373057
msgid ""

0 commit comments

Comments
 (0)
0