@@ -24,7 +24,7 @@ msgstr ""
2424
2525#: ../../library/mimetypes.rst:2
2626msgid ":mod:`mimetypes` --- Map filenames to MIME types"
27- msgstr ":mod:`mimetypes` --- 映射文件夹到 MIME 类型"
27+ msgstr ":mod:`mimetypes` --- 映射文件名到 MIME 类型"
2828
2929#: ../../library/mimetypes.rst:9
3030msgid "**Source code:** :source:`Lib/mimetypes.py`"
@@ -37,26 +37,31 @@ msgid ""
3737"filename to MIME type and from MIME type to filename extension; encodings "
3838"are not supported for the latter conversion."
3939msgstr ""
40+ ":mod:`mimetypes` 模块可以在文件名或 URL 和关联到文件扩展名的 MIME 类型之间执行转换。 所提供的转换包括从文件名到 MIME "
41+ "类型和从 MIME 类型到文件扩展名;后一种转换不支持编码格式。"
4042
4143#: ../../library/mimetypes.rst:20
4244msgid ""
4345"The module provides one class and a number of convenience functions. The "
4446"functions are the normal interface to this module, but some applications may"
4547" be interested in the class as well."
46- msgstr ""
48+ msgstr "该模块提供了一个类和一些便捷函数。 这些函数是该模块通常的接口,但某些应用程序可能也会希望使用类。 "
4749
4850#: ../../library/mimetypes.rst:24
4951msgid ""
5052"The functions described below provide the primary interface for this module."
5153" If the module has not been initialized, they will call :func:`init` if "
5254"they rely on the information :func:`init` sets up."
5355msgstr ""
56+ "下列函数提供了此模块的主要接口。 如果此模块尚未被初始化,它们将会调用 :func:`init`,如果它们依赖于 :func:`init` "
57+ "所设置的信息的话。"
5458
5559#: ../../library/mimetypes.rst:33
5660msgid ""
5761"Guess the type of a file based on its filename, path or URL, given by *url*."
5862" URL can be a string or a :term:`path-like object`."
5963msgstr ""
64+ "根据 *url* 给出的文件名、路径或 URL 来猜测文件的类型,URL 可以为字符串或 :term:`path-like object`。"
6065
6166#: ../../library/mimetypes.rst:36
6267msgid ""
@@ -65,6 +70,8 @@ msgid ""
6570"form ``'type/subtype'``, usable for a MIME :mailheader:`content-type` "
6671"header."
6772msgstr ""
73+ "返回值是一个元组 ``(type, encoding)`` 其中 *type* 在无法猜测(后缀不存在或者未知)时为 ``None``,或者为 "
74+ "``'type/subtype'`` 形式的字符串,可以作为 MIME :mailheader:`content-type` 标头。"
6875
6976#: ../../library/mimetypes.rst:40
7077msgid ""
@@ -75,6 +82,10 @@ msgid ""
7582"driven. Encoding suffixes are case sensitive; type suffixes are first tried "
7683"case sensitively, then case insensitively."
7784msgstr ""
85+ "*encoding* 在无编码格式时为 ``None``,或者为程序所用的编码格式 (例如 :program:`compress` 或 "
86+ ":program:`gzip`)。 它可以作为 :mailheader:`Content-Encoding` 标头,但 **不可** 作为 "
87+ ":mailheader:`Content-Transfer-Encoding` 标头。 映射是表格驱动的。 "
88+ "编码格式前缀对大小写敏感;类型前缀会先以大小写敏感方式检测再以大小写不敏感方式检测。"
7889
7990#: ../../library/mimetypes.rst:47
8091msgid ""
@@ -85,10 +96,14 @@ msgid ""
8596"*strict* is ``False``, some additional non-standard but commonly used MIME "
8697"types are also recognized."
8798msgstr ""
99+ "可选的 *strict* 参数是一个旗标,指明要将已知 MIME 类型限制在 `IANA 已注册 "
100+ "<https://www.iana.org/assignments/media-types/media-types.xhtml>`_ 的官方类型之内。 "
101+ "当 *strict* 为 ``True`` 时(默认值),则仅支持 IANA 类型;当 *strict* 为 ``False`` "
102+ "时,则还支持某些附加的非标准但常用的 MIME 类型。"
88103
89104#: ../../library/mimetypes.rst:54
90105msgid "Added support for url being a :term:`path-like object`."
91- msgstr ""
106+ msgstr "增加了 :term:`path-like object` 作为 url 的支持。 "
92107
93108#: ../../library/mimetypes.rst:60
94109msgid ""
0 commit comments