@@ -783,7 +783,8 @@ msgid ""
783783"All incremental encoders must provide this constructor interface. They are "
784784"free to add additional keyword arguments, but only the ones defined here are"
785785" used by the Python codec registry."
786- msgstr "增量式编码器必须提供此构造器接口。 它们可以自由地添加额外的关键字参数,但只有在这里定义的参数才会被 Python 编解码器注册表所使用。"
786+ msgstr ""
787+ "所有增量式编码器必须提供此构造器接口。 它们可以自由地添加额外的关键字参数,但只有在这里定义的参数才会被 Python 编解码器注册表所使用。"
787788
788789#: ../../library/codecs.rst:541
789790msgid ""
@@ -801,7 +802,7 @@ msgid ""
801802"error handling strategies during the lifetime of the "
802803":class:`IncrementalEncoder` object."
803804msgstr ""
804- "*errors* 参数必须被赋值给一个同名的属性 。 通过对此属性赋值就可以在 :class:`IncrementalEncoder` "
805+ "*errors* 参数将被赋值给一个同名的属性 。 通过对此属性赋值就可以在 :class:`IncrementalEncoder` "
805806"对象的生命期内在不同的错误处理策略之间进行切换。"
806807
807808#: ../../library/codecs.rst:553
@@ -810,13 +811,17 @@ msgid ""
810811"returns the resulting encoded object. If this is the last call to "
811812":meth:`encode` *final* must be true (the default is false)."
812813msgstr ""
814+ "编码 *object* (会将编码器的当前状态纳入考虑) 并返回已编码的结果对象。 如果这是对 :meth:`encode` 的最终调用则 "
815+ "*final* 必须为真值(默认为假值)。"
813816
814817#: ../../library/codecs.rst:560
815818msgid ""
816819"Reset the encoder to the initial state. The output is discarded: call "
817820"``.encode(object, final=True)``, passing an empty byte or text string if "
818821"necessary, to reset the encoder and to get the output."
819822msgstr ""
823+ "将编码器重置为初始状态。 输出将被丢弃:调用 ``.encode(object, "
824+ "final=True)``,在必要时传入一个空字节串或字符串,重置编码器并得到输出。"
820825
821826#: ../../library/codecs.rst:567
822827msgid ""
@@ -826,16 +831,18 @@ msgid ""
826831" marshaling/pickling the state and encoding the bytes of the resulting "
827832"string into an integer)."
828833msgstr ""
834+ "返回编码器的当前状态,该值必须为一个整数。 实现应当确保 ``0`` 是最常见的状态。 "
835+ "(比整数更复杂的状态表示可以通过编组/选择状态并将结果字符串的字节数据编码为整数来转换为一个整数值)。"
829836
830837#: ../../library/codecs.rst:576
831838msgid ""
832839"Set the state of the encoder to *state*. *state* must be an encoder state "
833840"returned by :meth:`getstate`."
834- msgstr ""
841+ msgstr "将编码器的状态设为 *state*。 *state* 必须为 :meth:`getstate` 所返回的一个编码器状态。 "
835842
836843#: ../../library/codecs.rst:583
837844msgid "IncrementalDecoder Objects"
838- msgstr ""
845+ msgstr "IncrementalDecoder 对象 "
839846
840847#: ../../library/codecs.rst:585
841848msgid ""
@@ -844,24 +851,29 @@ msgid ""
844851"decoder must define in order to be compatible with the Python codec "
845852"registry."
846853msgstr ""
854+ ":class:`IncrementalDecoder` 类用来对一个输入进行分步解码。 它定义了以下方法,每个增量式解码器都必须定义这些方法以便与 "
855+ "Python 编解码器注册表相兼容。"
847856
848857#: ../../library/codecs.rst:592
849858msgid "Constructor for an :class:`IncrementalDecoder` instance."
850- msgstr ""
859+ msgstr ":class:`IncrementalDecoder` 实际的构造器。 "
851860
852861#: ../../library/codecs.rst:594
853862msgid ""
854863"All incremental decoders must provide this constructor interface. They are "
855864"free to add additional keyword arguments, but only the ones defined here are"
856865" used by the Python codec registry."
857866msgstr ""
867+ "所有增量式解码器必须提供此构造器接口。 它们可以自由地添加额外的关键字参数,但只有在这里定义的参数才会被 Python 编解码器注册表所使用。"
858868
859869#: ../../library/codecs.rst:598
860870msgid ""
861871"The :class:`IncrementalDecoder` may implement different error handling "
862872"schemes by providing the *errors* keyword argument. See :ref:`error-"
863873"handlers` for possible values."
864874msgstr ""
875+ ":class:`IncrementalDecoder` 可以通过提供 *errors* 关键字参数来实现不同的错误处理方案。 可用的值请参阅 :ref"
876+ ":`error-handlers`。"
865877
866878#: ../../library/codecs.rst:602
867879msgid ""
@@ -870,6 +882,8 @@ msgid ""
870882"error handling strategies during the lifetime of the "
871883":class:`IncrementalDecoder` object."
872884msgstr ""
885+ "*errors* 参数将被赋值给一个同名的属性。 通过对此属性赋值就可以在 :class:`IncrementalDecoder` "
886+ "对象的生命期内在不同的错误处理策略之间进行切换。"
873887
874888#: ../../library/codecs.rst:610
875889msgid ""
@@ -881,6 +895,9 @@ msgid ""
881895"at the end of the input) it must initiate error handling just like in the "
882896"stateless case (which might raise an exception)."
883897msgstr ""
898+ "解码 *object* (会将解码器的当前状态纳入考虑) 并返回已解码的结果对象。 如果这是对 :meth:`decode` 的最终调用则 "
899+ "*final* 必须为真值(默认为假值)。 如果 *final* 为真值则解码器必须对输入进行完全解码并且必须 刷新所有缓冲区。 "
900+ "如果这无法做到(例如由于在输入结束时字节串序列不完整)则它必须像在无状态的情况下那样初始化错误处理(这可能引发一个异常)。"
884901
885902#: ../../library/codecs.rst:621
886903msgid "Reset the decoder to the initial state."
0 commit comments