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

Skip to content

Commit a1f3364

Browse files
[po] auto sync
1 parent 830bb04 commit a1f3364

File tree

13 files changed

+200
-24
lines changed

13 files changed

+200
-24
lines changed

.stat.json

Lines changed: 1 addition & 1 deletion
< 10000 /div>
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"translation": "80.84%", "updated_at": "2025-02-08T13:55:42Z"}
1+
{"translation": "80.88%", "updated_at": "2025-02-08T14:55:37Z"}

c-api/init.po

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# ProgramRipper, 2023
1515
# WH-2099 <wh2099@outlook.com>, 2023
1616
# Rafael Fontenelle <rffontenelle@gmail.com>, 2024
17-
# Freesand Leo <yuqinju@163.com>, 2024
17+
# Freesand Leo <yuqinju@163.com>, 2025
1818
#
1919
#, fuzzy
2020
msgid ""
@@ -23,7 +23,7 @@ msgstr ""
2323
"Report-Msgid-Bugs-To: \n"
2424
"POT-Creation-Date: 2025-02-07 14:17+0000\n"
2525
"PO-Revision-Date: 2021-06-28 00:49+0000\n"
26-
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2024\n"
26+
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2025\n"
2727
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
2828
"MIME-Version: 1.0\n"
2929
"Content-Type: text/plain; charset=UTF-8\n"
@@ -2071,6 +2071,8 @@ msgid ""
20712071
"Return a :term:`strong reference` to the ``__main__`` :ref:`module object "
20722072
"<moduleobjects>` for the given interpreter."
20732073
msgstr ""
2074+
"为给定的解释器返回一个指向 ``__main__`` :ref:`模块对象 <moduleobjects>` 的 :term:`strong "
2075+
"reference`。"
20742076

20752077
#: ../../c-api/init.rst:1461
20762078
msgid "Type of a frame evaluation function."

howto/descriptor.po

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ msgid ""
1818
msgstr ""
1919
"Project-Id-Version: Python 3.13\n"
2020
"Report-Msgid-Bugs-To: \n"
21-
"POT-Creation-Date: 2025-02-03 17:40+0000\n"
21+
"POT-Creation-Date: 2025-02-07 1 67ED 4:17+0000\n"
2222
"PO-Revision-Date: 2021-06-28 00:53+0000\n"
2323
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2025\n"
2424
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
@@ -1027,6 +1027,9 @@ msgid ""
10271027
"method with an exception raising placeholder is enough to make it a data "
10281028
"descriptor."
10291029
msgstr ""
1030+
"为了使一个数据描述器只读,应同时定义 :meth:`~object.__get__` 和 :meth:`~object.__set__` 并在调用 "
1031+
":meth:`~object.__set__` 时引发 :exc:`AttributeError`。 用引发异常的占位符定义 "
1032+
":meth:`~object.__set__` 方法就足以使其成为一个数据描述器。"
10301033

10311034
#: ../../howto/descriptor.rst:555
10321035
msgid "Overview of descriptor invocation"
@@ -1071,6 +1074,8 @@ msgid ""
10711074
"descriptors, then class variables, and lastly :meth:`~object.__getattr__` if"
10721075
" it is provided."
10731076
msgstr ""
1077+
"实例查找会扫描命名空间链并给予数据描述器最高的优先级,然后是实例变量,然后是非数据描述器,最后是 "
1078+
":meth:`~object.__getattr__`,如果有提供的话。"
10741079

10751080
#: ../../howto/descriptor.rst:580
10761081
msgid ""
@@ -1144,6 +1149,9 @@ msgid ""
11441149
"``super().__getattribute__`` will bypass :meth:`~object.__getattr__` "
11451150
"entirely."
11461151
msgstr ""
1152+
"注意,在 :meth:`~object.__getattribute__` 代码中没有 :meth:`~object.__getattr__` 钩子。 "
1153+
"这就是为什么直接调用 :meth:`~object.__getattribute__` 或用 ``super().__getattribute__`` "
1154+
"会彻底绕过 :meth:`~object.__getattr__`。"
11471155

11481156
#: ../../howto/descriptor.rst:726
11491157
msgid ""
@@ -1152,6 +1160,8 @@ msgid ""
11521160
":meth:`~object.__getattribute__` raises an :exc:`AttributeError`. Their "
11531161
"logic is encapsulated in a helper function:"
11541162
msgstr ""
1163+
"相反,一旦 :meth:`~object.__getattribute__` 引发 :exc:`AttributeError` 则将由点运算符和 "
1164+
":func:`getattr` 函数来负责唤起 :meth:`~object.__getattr__`。 它们的逻辑封装在一个辅助函数中:"
11551165

11561166
#: ../../howto/descriptor.rst:731
11571167
msgid ""
@@ -2385,7 +2395,7 @@ msgstr ""
23852395
msgid ""
23862396
"The :meth:`!type.__new__` method takes care of adding member objects to "
23872397
"class variables:"
2388-
msgstr ""
2398+
msgstr ":meth:`!type.__new__` 方法负责将成员对象添加到类变量:"
23892399

23902400
#: ../../howto/descriptor.rst:1673
23912401
msgid ""
@@ -2400,6 +2410,16 @@ msgid ""
24002410
" mapping[name] = Member(name, clsname, offset)\n"
24012411
" return type.__new__(mcls, clsname, bases, mapping, **kwargs)"
24022412
msgstr ""
2413+
"class Type(type):\n"
2414+
" 'Simulate how the type metaclass adds member objects for slots'\n"
2415+
"\n"
2416+
" def __new__(mcls, clsname, bases, mapping, **kwargs):\n"
2417+
" 'Emulate type_new() in Objects/typeobject.c'\n"
2418+
" # type_new() 将调用 PyTypeReady(),后者将调用 add_methods()\n"
2419+
" slot_names = mapping.get('slot_names', [])\n"
2420+
" for offset, name in enumerate(slot_names):\n"
2421+
" mapping[name] = Member(name, clsname, offset)\n"
2422+
" return type.__new__(mcls, clsname, bases, mapping, **kwargs)"
24032423

24042424
#: ../../howto/descriptor.rst:1686
24052425
msgid ""
@@ -2439,12 +2459,41 @@ msgid ""
24392459
" )\n"
24402460
" super().__delattr__(name)"
24412461
msgstr ""
2462+
"class Object:\n"
2463+
" 'Simulate how object.__new__() allocates memory for __slots__'\n"
2464+
"\n"
2465+
" def __new__(cls, *args, **kwargs):\n"
2466+
" 'Emulate object_new() in Objects/typeobject.c'\n"
2467+
" inst = super().__new__(cls)\n"
2468+
" if hasattr(cls, 'slot_names'):\n"
2469+
" empty_slots = [null] * len(cls.slot_names)\n"
2470+
" object.__setattr__(inst, '_slotvalues', empty_slots)\n"
2471+
" return inst\n"
2472+
"\n"
2473+
" def __setattr__(self, name, value):\n"
2474+
" 'Emulate _PyObject_GenericSetAttrWithDict() Objects/object.c'\n"
2475+
" cls = type(self)\n"
2476+
" if hasattr(cls, 'slot_names') and name not in cls.slot_names:\n"
2477+
" raise AttributeError(\n"
2478+
" f'{cls.__name__!r} object has no attribute {name!r}'\n"
2479+
" )\n"
2480+
" super().__setattr__(name, value)\n"
2481+
"\n"
2482+
" def __delattr__(self, name):\n"
2483+
" 'Emulate _PyObject_GenericSetAttrWithDict() Objects/object.c'\n"
2484+
" cls = type(self)\n"
2485+
" if hasattr(cls, 'slot_names') and name not in cls.slot_names:\n"
2486+
" raise AttributeError(\n"
2487+
" f'{cls.__name__!r} object has no attribute {name!r}'\n"
2488+
" )\n"
2489+
" super().__delattr__(name)"
24422490

24432491
#: ../../howto/descriptor.rst:1721
24442492
msgid ""
24452493
"To use the simulation in a real class, just inherit from :class:`!Object` "
24462494
"and set the :term:`metaclass` to :class:`Type`:"
24472495
msgstr ""
2496+
"要在真实的类中使用此模拟,只需从 :class:`!Object` 继承并将 :term:`metaclass` 设为 :class:`Type`:"
24482497

24492498
#: ../../howto/descriptor.rst:1724
24502499
msgid ""
@@ -2457,6 +2506,14 @@ msgid ""
24572506
" self.x = x\n"
24582507
" self.y = y"
24592508
msgstr ""
2509+
"class H(Object, metaclass=Type):\n"
2510+
" 'Instance variables stored in slots'\n"
2511+
"\n"
2512+
" slot_names = ['x', 'y']\n"
2513+
"\n"
2514+
" def __init__(self, x, y):\n"
2515+
" self.x = x\n"
2516+
" self.y = y"
24602517

24612518
#: ../../howto/descriptor.rst:1735
24622519
msgid ""
@@ -2474,6 +2531,14 @@ msgid ""
24742531
" 'x': <Member 'x' of 'H'>,\n"
24752532
" 'y': <Member 'y' of 'H'>}"
24762533
msgstr ""
2534+
">>> from pprint import pp\n"
2535+
">>> pp(dict(vars(H)))\n"
2536+
"{'__module__': '__main__',\n"
2537+
" '__doc__': 'Instance variables stored in slots',\n"
2538+
" 'slot_names': ['x', 'y'],\n"
2539+
" '__init__': <function H.__init__ at 0x7fb5d302f9d0>,\n"
2540+
" 'x': <Member 'x' of 'H'>,\n"
2541+
" 'y': <Member 'y' of 'H'>}"
24772542

24782543
#: ../../howto/descriptor.rst:1756
24792544
msgid ""

howto/free-threading-python.po

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
# Translators:
77
# nick <2330458484@qq.com>, 2024
88
# Alpha Du <alphanow@gmail.com>, 2024
9-
# Freesand Leo <yuqinju@163.com>, 2024
109
# Jiuh.star <jiuh.star@gmail.com>, 2024
10+
# Freesand Leo <yuqinju@163.com>, 2025
1111
#
1212
#, fuzzy
1313
msgid ""
@@ -16,7 +16,7 @@ msgstr ""
1616
"Report-Msgid-Bugs-To: \n"
1717
"POT-Creation-Date: 2025-02-07 14:17+0000\n"
1818
"PO-Revision-Date: 2024-10-04 14:19+0000\n"
19-
"Last-Translator: Jiuh.star <jiuh.star@gmail.com>, 2024\n"
19+
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2025\n"
2020
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
2121
"MIME-Version: 1.0\n"
2222
"Content-Type: text/plain; charset=UTF-8\n"
@@ -102,6 +102,9 @@ msgid ""
102102
"build\". The new :func:`sys._is_gil_enabled` function can be used to check "
103103
"whether the GIL is actually disabled in the running process."
104104
msgstr ""
105+
"要判断当前解释器是否支持自由线程,可检查 :option:`python -VV <-V>` 和 :data:`sys.version` 是否包含 "
106+
"\"experimental free-threading build\"。 新的 :func:`sys._is_gil_enabled` "
107+
"函数可用于检查在运行进程中 GIL 是否确实被关闭。"
105108

106109
#: ../../howto/free-threading-python.rst:50
107110
msgid ""

library/decimal.po

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# Naisen Xu <723648649@qq.com>, 2021
99
# Alpha Du <alphanow@gmail.com>, 2022
1010
# ProgramRipper, 2023
11-
# Freesand Leo <yuqinju@163.com>, 2024
11+
# Freesand Leo <yuqinju@163.com>, 2025
1212
#
1313
#, fuzzy
1414
msgid ""
@@ -17,7 +17,7 @@ msgstr ""
1717
"Report-Msgid-Bugs-To: \n"
1818
"POT-Creation-Date: 2025-02-07 14:17+0000\n"
1919
"PO-Revision-Date: 2021-06-28 01:04+0000\n"
20-
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2024\n"
20+
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2025\n"
2121
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
2222
"MIME-Version: 1.0\n"
2323
"Content-Type: text/plain; charset=UTF-8\n"
@@ -3315,7 +3315,7 @@ msgstr ""
33153315
msgid ""
33163316
"For inexact results, :const:`MAX_PREC` is far too large on 64-bit platforms "
33173317
"and the available memory will be insufficient::"
3318-
msgstr ""
3318+
msgstr "对于不精确的结果,在 64 位平台上 :const:`MAX_PREC` 的值太大因而会导致可用内存不足::"
33193319

33203320
#: ../../library/decimal.rst:2251
33213321
msgid ""

library/importlib.metadata.po

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# ProgramRipper, 2023
99
# Menghua Xiao <arieshout@gmail.com>, 2024
1010
# Nyuan Zhang, 2024
11-
# Freesand Leo <yuqinju@163.com>, 2024
11+
# Freesand Leo <yuqinju@163.com>, 2025
1212
#
1313
#, fuzzy
1414
msgid ""
@@ -17,7 +17,7 @@ msgstr ""
1717
"Report-Msgid-Bugs-To: \n"
1818
"POT-Creation-Date: 2025-02-07 14:17+0000\n"
1919
"PO-Revision-Date: 2021-06-28 01:08+0000\n"
20-
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2024\n"
20+
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2025\n"
2121
"Language-Team: 10000 Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
2222
"MIME-Version: 1.0\n"
2323
"Content-Type: text/plain; charset=UTF-8\n"
@@ -670,7 +670,7 @@ msgid ""
670670
"Return a mapping from the top level module and import package names found "
671671
"via :data:`sys.meta_path` to the names of the distribution packages (if any)"
672672
" that provide the corresponding files."
673-
msgstr ""
673+
msgstr "返回一个从最高层级模块和通过 :data:`sys.meta_path` 找到的导入包名称到提供相应文件的分发包名称(如果存在)的映射。"
674674

675675
#: ../../library/importlib.metadata.rst:381
676676
msgid ""

library/logging.po

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,8 @@ msgid ""
604604
"into account the relevant :attr:`Logger.propagate` attributes), the message "
605605
"will be sent to the handler set on :data:`lastResort`."
606606
msgstr ""
607+
"如果没有处理器附加到这个记录器(或它的任何上级,会将相关的 :attr:`Logger.propagate` 属性也纳入考虑),消息将被发送到在 "
608+
":data:`lastResort` 上设置的处理器。"
607609

608610
#: ../../library/logging.rst:347
609611
msgid "The *stack_info* parameter was added."

library/plistlib.po

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Translators:
77
# 叶浚安 <ye.pandaaaa906@gmail.com>, 2021
88
# nick <2330458484@qq.com>, 2021
9-
# Freesand Leo <yuqinju@163.com>, 2024
9+
# Freesand Leo <yuqinju@163.com>, 2025
1010
#
1111
#, fuzzy
1212
msgid ""
@@ -15,7 +15,7 @@ msgstr ""
1515
"Report-Msgid-Bugs-To: \n"
1616
"POT-Creation-Date: 2025-02-07 14:17+0000\n"
1717
"PO-Revision-Date: 2021-06-28 01:11+0000\n"
18-
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2024\n"
18+
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2025\n"
1919
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
2020
"MIME-Version: 1.0\n"
2121
"Content-Type: text/plain; charset=UTF-8\n"
@@ -137,6 +137,8 @@ msgid ""
137137
"be created as :ref:`aware object <datetime-naive-aware>`, with "
138138
":attr:`!tzinfo` as :const:`datetime.UTC`."
139139
msgstr ""
140+
"当 *aware_datetime* 为真值时,类型为 ``datetime.datetime`` 的字段将被创建为 :ref:`感知型对象 "
141+
"<datetime-naive-aware>`,其 :attr:`!tzinfo` 将设为 :const:`datetime.UTC`。"
140142

141143
#: ../../library/plistlib.rst:76
142144
msgid ""

library/site.po

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# helloworldSB <warningfor163@foxmail.com>, 2021
1010
# Dai Xu <daixu61@hotmail.com>, 2023
1111
# WH-2099 <wh2099@outlook.com>, 2024
12-
# Freesand Leo <yuqinju@163.com>, 2024
12+
# Freesand Leo <yuqinju@163.com>, 2025
1313
#
1414
#, fuzzy
1515
msgid ""
@@ -18,7 +18,7 @@ msgstr ""
1818
"Report-Msgid-Bugs-To: \n"
1919
"POT-Creation-Date: 2025-02-07 14:17+0000\n"
2020
"PO-Revision-Date: 2021-06-28 01:13+0000\n"
21-
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2024\n"
21+
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2025\n"
2222
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
2323
"MIME-Version: 1.0\n"
2424
"Content-Type: text/plain; charset=UTF-8\n"
@@ -74,6 +74,12 @@ msgid ""
7474
"directory, and if so, adds it to ``sys.path`` and also inspects the newly "
7575
"added path for configuration files."
7676
msgstr ""
77+
"它会以一个头部和尾部来构造至多四个目录作为起点。 对于头部,它将使用 ``sys.prefix`` 和 "
78+
"``sys.exec_prefix``;空的头部会被跳过。 对于尾部,它将使用空字符串然后是 :file:`lib/site-packages` (在 "
79+
"Windows 上) 或 :file:`lib/python{X.Y[t]}/site-packages` (在 Unix 和 macOS 上)。 "
80+
"(可选后缀 \"t\" 表示 :term:`free threading` 构建版,并会在 ``\"t\"`` 存在于 "
81+
":data:`sys.abiflags` 常量中时被添加。) 对于每个不同的头部-尾部组合,它会查看其是否指向现有的目录,如果确实如此,则将其添加到 "
82+
"``sys.path`` 并且还会检查新添加目录中的配置文件。"
7783

7884
#: ../../library/site.rst:44
7985
msgid "Support for the \"site-python\" directory has been removed."

0 commit comments

Comments
 (0)
0