11# SOME DESCRIPTIVE TITLE.
2- # Copyright (C) 2001-2024 , Python Software Foundation
2+ # Copyright (C) 2001-2025 , Python Software Foundation
33# This file is distributed under the same license as the Python package.
44# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
55#
66# Translators:
7- # Rafael Fontenelle <rffontenelle@gmail.com>,2024
7+ # Rafael Fontenelle <rffontenelle@gmail.com>,2025
88#
99#, fuzzy
1010msgid ""
1111msgstr ""
1212"Project-Id-Version :Python 3.12\n "
1313"Report-Msgid-Bugs-To :\n "
14- "POT-Creation-Date :2024-07-19 14:50 +0000\n "
14+ "POT-Creation-Date :2025-04-11 14:54 +0000\n "
1515"PO-Revision-Date :2024-05-11 00:33+0000\n "
16- "Last-Translator :Rafael Fontenelle <rffontenelle@gmail.com>,2024 \n "
16+ "Last-Translator :Rafael Fontenelle <rffontenelle@gmail.com>,2025 \n "
1717"Language-Team :Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
1818"MIME-Version :1.0\n "
1919"Content-Type :text/plain; charset=UTF-8\n "
@@ -175,20 +175,17 @@ msgid "Added support for *traversable* representing a directory."
175175msgstr "增加了对代表目录的 *traversable* 的支持。"
176176
177177#: ../../library/importlib.resources.rst:103
178- msgid "Deprecated functions "
179- msgstr "弃用的函数 "
178+ msgid "Functional API "
179+ msgstr "函数式 API "
180180
181181#: ../../library/importlib.resources.rst:105
182182msgid ""
183- "An older, deprecated set of functions is still available, but is scheduled "
184- "for removal in a future version of Python. The main drawback of these "
185- "functions is that they do not support directories: they assume all resources"
186- " are located directly within a *package*."
183+ "An older, previously deprecated set of functions is still available. The "
184+ "main drawback of these functions is that they do not support directories: "
185+ "they assume all resources are located directly within a *package*."
187186msgstr ""
188- "一组旧式的,已被弃用的函数仍然可用,但预计会在未来的 Python 版本中被移除。 这些函数的主要缺点是它们不支持目录:它们假定所有资源都直接位于 "
189- "*package* 之下。"
190187
191- #: ../../library/importlib.resources.rst:112
188+ #: ../../library/importlib.resources.rst:111
192189msgid ""
193190"Whenever a function accepts a ``Package`` argument, you can pass in either a"
194191" :class:`module object <types.ModuleType>` or a module name as a string. "
@@ -198,25 +195,25 @@ msgstr ""
198195"只要一个函数接受 ``Package`` 参数,你就可以传入 :class:`模块对象 <types.ModuleType>` 或字符串形式的模块名称。"
199196" 你只能传入 ``__spec__.submodule_search_locations`` 不为 ``None`` 的模块对象。"
200197
201- #: ../../library/importlib.resources.rst:117
198+ #: ../../library/importlib.resources.rst:116
202199msgid "The ``Package`` type is defined as ``Union[str, ModuleType]``."
203200msgstr "``Package`` 类型是作为 ``Union[str, ModuleType]`` 定义的。"
204201
205- #: ../../library/importlib.resources.rst:124
202+ #: ../../library/importlib.resources.rst:121
206203msgid ""
207204"For *resource* arguments of the functions below, you can pass in the name of"
208205" a resource as a string or a :class:`path-like object <os.PathLike>`."
209206msgstr "对于下列函数的 *resource* 参数,你可以传入字符串形式的资源名称或 :class:`路径类对象 <os.PathLike>`。"
210207
211- #: ../../library/importlib.resources.rst:128
208+ #: ../../library/importlib.resources.rst:125
212209msgid "The ``Resource`` type is defined as ``Union[str, os.PathLike]``."
213210msgstr "``Resource`` 类型是作为 ``Union[str, os.PathLike]`` 定义的。"
214211
215- #: ../../library/importlib.resources.rst:133
212+ #: ../../library/importlib.resources.rst:130
216213msgid "Open for binary reading the *resource* within *package*."
217214msgstr "以二进制读方式打开 *package* 内的 *resource*。"
218215
219- #: ../../library/importlib.resources.rst:135
216+ #: ../../library/importlib.resources.rst:132
220217msgid ""
221218"*package* is either a name or a module object which conforms to the "
222219"``Package`` requirements. *resource* is the name of the resource to open "
@@ -228,22 +225,26 @@ msgstr ""
228225"内打开的资源名;不能包含路径分隔符,也不能有子资源(即不能为目录)。本函数将返回一个 ``typing.BinaryIO`` "
229226"实例以供读取,即一个已打开的二进制 I/O 流。"
230227
231- #: ../../library/importlib.resources.rst:143
232- #: ../../library/importlib.resources.rst:164
233- #: ../../library/importlib.resources.rst:182
234- #: ../../library/importlib.resources.rst:201
235- #: ../../library/importlib.resources.rst:237
236- #: ../../library/importlib.resources.rst:253
237- msgid "Calls to this functioncan be replaced by ::"
238- msgstr "对此函数的调用可以被替换为:: "
228+ #: ../../library/importlib.resources.rst:138
229+ #: ../../library/importlib.resources.rst:157
230+ #: ../../library/importlib.resources.rst:173
231+ #: ../../library/importlib.resources.rst:190
232+ #: ../../library/importlib.resources.rst:222
233+ #: ../../library/importlib.resources.rst:236
234+ msgid "This functionis roughly equivalent to ::"
235+ msgstr ""
239236
240- #: ../../library/importlib.resources.rst:150
237+ #: ../../library/importlib.resources.rst:140
238+ msgid "files(package).joinpath(resource).open('rb')"
239+ msgstr ""
240+
241+ #: ../../library/importlib.resources.rst:145
241242msgid ""
242243"Open for text reading the *resource* within *package*. By default, the "
243244"resource is opened for reading as UTF-8."
244245msgstr "以文本读方式打开 *package* 内的 *resource*。默认情况下,资源将以 UTF-8 格式打开以供读取。"
245246
246- #: ../../library/importlib.resources.rst:153
247+ #: ../../library/importlib.resources.rst:148
247248msgid ""
248249"*package* is either a name or a module object which conforms to the "
249250"``Package`` requirements. *resource* is the name of the resource to open "
@@ -255,19 +256,23 @@ msgstr ""
255256"内打开的资源名;不能包含路径分隔符,也不能有子资源(即不能是目录)。*encoding* 和 *errors* 的含义与内置 :func:`open` "
256257"的一样。"
257258
258- #: ../../library/importlib.resources.rst:159
259+ #: ../../library/importlib.resources.rst:154
259260msgid ""
260261"This function returns a ``typing.TextIO`` instance, a text I/O stream open "
261262"for reading."
262263msgstr "本函数返回一个 ``typing.TextIO`` 实例,即一个打开的文本 I/O 流对象以供读取。"
263264
264- #: ../../library/importlib.resources.rst:171
265+ #: ../../library/importlib.resources.rst:159
266+ msgid "files(package).joinpath(resource).open('r', encoding=encoding)"
267+ msgstr ""
268+
269+ #: ../../library/importlib.resources.rst:164
265270msgid ""
266271"Read and return the contents of the *resource* within *package* as "
267272"``bytes``."
268273msgstr "读取并返回 *package* 中的 *resource* 内容,格式为 ``bytes``。"
269274
270- #: ../../library/importlib.resources.rst:174
275+ #: ../../library/importlib.resources.rst:167
271276msgid ""
272277"*package* is either a name or a module object which conforms to the "
273278"``Package`` requirements. *resource* is the name of the resource to open "
@@ -278,14 +283,18 @@ msgstr ""
278283"*package* 是包名或符合 ``Package`` 要求的模块对象。 *resource* 是要在 *package* "
279284"内打开的资源名;不能包含路径分隔符,也不能有子资源(即不能是目录)。资源内容以 :class:`bytes` 的形式返回。"
280285
281- #: ../../library/importlib.resources.rst:189
286+ #: ../../library/importlib.resources.rst:175
287+ msgid "files(package).joinpath(resource).read_bytes()"
288+ msgstr ""
289+
290+ #: ../../library/importlib.resources.rst:180
282291msgid ""
283292"Read and return the contents of *resource* within *package* as a ``str``. By"
284293" default, the contents are read as strict UTF-8."
285294msgstr ""
286295"读取并返回 *package* 中 *resource* 的内容,格式为 ``str``。默认情况下,资源内容将以严格的 UTF-8 格式读取。"
287296
288- #: ../../library/importlib.resources.rst:192
297+ #: ../../library/importlib.resources.rst:183
289298msgid ""
290299"*package* is either a name or a module object which conforms to the "
291300"``Package`` requirements. *resource* is the name of the resource to open "
@@ -298,7 +307,11 @@ msgstr ""
298307"内打开的资源名;不能包含路径分隔符,也不能有子资源(即不能是目录)。*encoding* 和 *errors* 的含义与内置 :func:`open` "
299308"的一样。资源内容将以 :class:`str` 的形式返回。"
300309
301- #: ../../library/importlib.resources.rst:208
310+ #: ../../library/importlib.resources.rst:192
311+ msgid "files(package).joinpath(resource).read_text(encoding=encoding)"
312+ msgstr ""
313+
314+ #: ../../library/importlib.resources.rst:197
302315msgid ""
303316"Return the path to the *resource* as an actual file system path. This "
304317"function returns a context manager for use in a :keyword:`with` statement. "
@@ -307,13 +320,13 @@ msgstr ""
307320"返回 *resource* 实际的文件系统路径。本函数返回一个上下文管理器,以供 :keyword:`with` 语句中使用。上下文管理器提供一个 "
308321":class:`pathlib.Path` 对象。"
309322
310- #: ../../library/importlib.resources.rst:212
323+ #: ../../library/importlib.resources.rst:201
311324msgid ""
312325"Exiting the context manager cleans up any temporary file created when the "
313326"resource needs to be extracted from e.g. a zip file."
314327msgstr "退出上下文管理程序时,可以清理所有临时文件,比如从压缩文件中提取资源时创建的那些文件。"
315328
316- #: ../../library/importlib.resources.rst:215
329+ #: ../../library/importlib.resources.rst:204
317330msgid ""
318331"*package* is either a name or a module object which conforms to the "
319332"``Package`` requirements. *resource* is the name of the resource to open "
@@ -323,11 +336,15 @@ msgstr ""
323336"*package* 是包名或符合 ``Package`` 要求的模块对象。 *resource* 是要在 *package* "
324337"内打开的资源名;不能包含路径分隔符,也不能有子资源(即不能是目录)。"
325338
326- #: ../../library/importlib.resources.rst:222
327- msgid "Calls to this functioncan be replaced using :func:`as_file` ::"
328- msgstr "对此函数的调用可以使用 :func:`as_file` 来替换:: "
339+ #: ../../library/importlib.resources.rst:209
340+ msgid "This functionis roughly equivalent to ::"
341+ msgstr ""
329342
330- #: ../../library/importlib.resources.rst:229
343+ #: ../../library/importlib.resources.rst:211
344+ msgid "as_file(files(package).joinpath(resource))"
345+ msgstr ""
346+
347+ #: ../../library/importlib.resources.rst:216
331348msgid ""
332349"Return ``True`` if there is a resource named *name* in the package, "
333350"otherwise ``False``. This function does not consider directories to be "
@@ -337,16 +354,26 @@ msgstr ""
337354"如果包中存在名为 *name* 的资源则返回 ``True``,否则返回 ``False``。 此函数不会将目录视为资源。 *package* "
338355"是包名或符合 ``Package`` 要求的模块对象。"
339356
340- #: ../../library/importlib.resources.rst:244
357+ #: ../../library/importlib.resources.rst:224
358+ msgid "files(package).joinpath(resource).is_file()"
359+ msgstr ""
360+
361+ #: ../../library/importlib.resources.rst:229
341362msgid ""
342363"Return an iterable over the named items within the package. The iterable "
343364"returns :class:`str` resources (e.g. files) and non-resources (e.g. "
344365"directories). The iterable does not recurse into subdirectories."
345366msgstr ""
346367"返回一个用于遍历包内各命名项的可迭代对象。该可迭代对象将返回 :class:`str` 资源(如文件)及非资源(如目录)。该迭代器不会递归进入子目录。"
347368
348- #: ../../library/importlib.resources.rst:248
369+ #: ../../library/importlib.resources.rst:233
349370msgid ""
350371"*package* is either a name or a module object which conforms to the "
351372"``Package`` requirements."
352373msgstr "*package* 是包名或符合 ``Package`` 要求的模块对象。"
374+
375+ #: ../../library/importlib.resources.rst:238
376+ msgid ""
377+ "(resource.name for resource in files(package).iterdir() if "
378+ "resource.is_file())"
379+ msgstr ""