@@ -153,64 +153,64 @@ msgstr ""
153153msgid ""
154154"To simplify access to the various codec components, the module provides "
155155"these additional functions which use :func:`lookup` for the codec lookup:"
156- msgstr ""
156+ msgstr "为了简化对各种编解码器组件的访问,本模块提供了以下附加函数,它们使用 :func:`lookup` 来执行编解码器查找: "
157157
158158#: ../../library/codecs.rst:111
159159msgid ""
160160"Look up the codec for the given encoding and return its encoder function."
161- msgstr ""
161+ msgstr "查找给定编码的编解码器并返回其编码器函数。 "
162162
163163#: ../../library/codecs.rst:113 ../../library/codecs.rst:120
164164#: ../../library/codecs.rst:146 ../../library/codecs.rst:154
165165msgid "Raises a :exc:`LookupError` in case the encoding cannot be found."
166- msgstr ""
166+ msgstr "在编码无法找到时将引发 :exc:`LookupError`。 "
167167
168168#: ../../library/codecs.rst:118
169169msgid ""
170170"Look up the codec for the given encoding and return its decoder function."
171- msgstr ""
171+ msgstr "查找给定编码的编解码器并返回其解码器函数。 "
172172
173173#: ../../library/codecs.rst:125
174174msgid ""
175175"Look up the codec for the given encoding and return its incremental encoder "
176176"class or factory function."
177- msgstr ""
177+ msgstr "查找给定编码的编解码器并返回其增量式编码器类或工厂函数。 "
178178
179179#: ../../library/codecs.rst:128
180180msgid ""
181181"Raises a :exc:`LookupError` in case the encoding cannot be found or the "
182182"codec doesn't support an incremental encoder."
183- msgstr ""
183+ msgstr "在编码无法找到或编解码器不支持增量式编码器时将引发 :exc:`LookupError`。 "
184184
185185#: ../../library/codecs.rst:134
186186msgid ""
187187"Look up the codec for the given encoding and return its incremental decoder "
188188"class or factory function."
189- msgstr ""
189+ msgstr "查找给定编码的编解码器并返回其增量式解码器类或工厂函数。 "
190190
191191#: ../../library/codecs.rst:137
192192msgid ""
193193"Raises a :exc:`LookupError` in case the encoding cannot be found or the "
194194"codec doesn't support an incremental decoder."
195- msgstr ""
195+ msgstr "在编码无法找到或编解码器不支持增量式解码器时将引发 :exc:`LookupError`。 "
196196
197197#: ../../library/codecs.rst:143
198198msgid ""
199199"Look up the codec for the given encoding and return its "
200200":class:`StreamReader` class or factory function."
201- msgstr ""
201+ msgstr "查找给定编码的编解码器并返回其 :class:`StreamReader` 类或工厂函数。 "
202202
203203#: ../../library/codecs.rst:151
204204msgid ""
205205"Look up the codec for the given encoding and return its "
206206":class:`StreamWriter` class or factory function."
207- msgstr ""
207+ msgstr "查找给定编码的编解码器并返回其 :class:`StreamWriter` 类或工厂函数。 "
208208
209209#: ../../library/codecs.rst:156
210210msgid ""
211211"Custom codecs are made available by registering a suitable codec search "
212212"function:"
213- msgstr ""
213+ msgstr "自定义编解码器的启用是通过注册适当的编解码器搜索函数: "
214214
215215#: ../../library/codecs.rst:161
216216msgid ""
@@ -219,12 +219,14 @@ msgid ""
219219":class:`CodecInfo` object. In case a search function cannot find a given "
220220"encoding, it should return ``None``."
221221msgstr ""
222+ "注册一个编解码器搜索函数。 搜索函数预期接收一个参数,即全部以小写字母表示的编码名称,并返回一个 :class:`CodecInfo` 对象。 "
223+ "在搜索函数无法找到给定编码的情况下,它应当返回 ``None``。"
222224
223225#: ../../library/codecs.rst:168
224226msgid ""
225227"Search function registration is not currently reversible, which may cause "
226228"problems in some cases, such as unit testing or module reloading."
227- msgstr ""
229+ msgstr "搜索函数的注册目前是不可逆的,这在某些情况下可能导致问题,例如单元测试或模块重载等。 "
228230
229231#: ../../library/codecs.rst:172
230232msgid ""
@@ -233,6 +235,8 @@ msgid ""
233235"provides additional utility functions and classes that allow the use of a "
234236"wider range of codecs when working with binary files:"
235237msgstr ""
238+ "虽然内置的 :func:`open` 和相关联的 :mod:`io` "
239+ "模块是操作已编码文本文件的推荐方式,但本模块也提供了额外的工具函数和类,允许在操作二进制文件时使用更多各类的编解码器:"
236240
237241#: ../../library/codecs.rst:179
238242msgid ""
0 commit comments