Skip to content

Translate c-api/codec.po #503

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 49 additions & 23 deletions c-api/codec.po
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2022, Python Software Foundation
# Copyright (C) 2001-2023, Python Software Foundation
# This file is distributed under the same license as the Python package.
#
# Translators:
# Matt Wang <[email protected]>, 2023
msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-10-26 16:47+0000\n"
"PO-Revision-Date: 2015-12-09 17:51+0000\n"
"Last-Translator: Liang-Bo Wang <[email protected]>\n"
"PO-Revision-Date: 2023-07-24 17:51+0000\n"
"Last-Translator: Matt Wang <[email protected]>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
"tw)\n"
"Language: zh_TW\n"
Expand All @@ -20,34 +20,40 @@ msgstr ""

#: ../../c-api/codec.rst:4
msgid "Codec registry and support functions"
msgstr ""
msgstr "編解碼器註冊表和支援函式"

#: ../../c-api/codec.rst:8
msgid "Register a new codec search function."
msgstr ""
msgstr "註冊一個新的編解碼器搜索函式。"

#: ../../c-api/codec.rst:10
msgid ""
"As side effect, this tries to load the :mod:`encodings` package, if not yet "
"done, to make sure that it is always first in the list of search functions."
msgstr ""
"作為副作用 (side effect),這會嘗試載入 :mod:`encodings`\\ (如果尚未完成),"
"以確保它始終位於搜索函式列表中的第一個。"

#: ../../c-api/codec.rst:15
msgid ""
"Unregister a codec search function and clear the registry's cache. If the "
"search function is not registered, do nothing. Return 0 on success. Raise an "
"exception and return -1 on error."
msgstr ""
"取消註冊編解碼器搜索函式並清除註冊表 (registry) 的快取。如果搜索函式並未被註"
"冊,則不執行任何操作。成功回傳 0,發生錯誤時會引發例外並回傳 -1。"

#: ../../c-api/codec.rst:23
msgid ""
"Return ``1`` or ``0`` depending on whether there is a registered codec for "
"the given *encoding*. This function always succeeds."
msgstr ""
"回傳 ``1`` 或 ``0``,具體取決於是否有給定 *encoding* 的已註冊編解碼器。這個函"
"式總會成功。"

#: ../../c-api/codec.rst:28
msgid "Generic codec based encoding API."
msgstr ""
msgstr "基於泛用編解碼器的編碼 API。"

#: ../../c-api/codec.rst:30
msgid ""
Expand All @@ -56,10 +62,13 @@ msgid ""
"may be ``NULL`` to use the default method defined for the codec. Raises a :"
"exc:`LookupError` if no encoder can be found."
msgstr ""
"*object* 被傳遞給以給定 *encoding* 所查找到的編碼器函式,並使用以 *errors* 定"
"義的錯誤處理方法。*errors* 可以設為 ``NULL`` 來使用編解碼器定義的預設方法。如"
"果找不到編碼器,則引發 :exc:`LookupError`。"

#: ../../c-api/codec.rst:37
msgid "Generic codec based decoding API."
msgstr ""
msgstr "基於泛用編解碼器的解碼 API。"

#: ../../c-api/codec.rst:39
msgid ""
Expand All @@ -68,10 +77,13 @@ msgid ""
"may be ``NULL`` to use the default method defined for the codec. Raises a :"
"exc:`LookupError` if no encoder can be found."
msgstr ""
"*object* 被傳遞給以給定 *encoding* 所查找到的解碼器函式,並使用以 *errors* 定"
"義的錯誤處理方法。*errors* 可以設為 ``NULL`` 來使用編解碼器定義的預設方法。如"
"果找不到編碼器,則引發 :exc:`LookupError`。"

#: ../../c-api/codec.rst:46
msgid "Codec lookup API"
msgstr ""
msgstr "編解碼器查找 API"

#: ../../c-api/codec.rst:48
msgid ""
Expand All @@ -80,40 +92,43 @@ msgid ""
"mechanism effectively case-insensitive. If no codec is found, a :exc:"
"`KeyError` is set and ``NULL`` returned."
msgstr ""
"在以下函式中,查找的 *encoding* 字串的所有字元將轉換為小寫,這使得透過此機制"
"查找的編碼可以不區分大小寫而更有效率。如果未找到編解碼器,則會設定 :exc:"
"`KeyError` 並回傳 ``NULL``。"

#: ../../c-api/codec.rst:55
msgid "Get an encoder function for the given *encoding*."
msgstr ""
msgstr "取得給定 *encoding* 的編碼器函式。"

#: ../../c-api/codec.rst:59
msgid "Get a decoder function for the given *encoding*."
msgstr ""
msgstr "取得給定 *encoding* 的解碼器函式。"

#: ../../c-api/codec.rst:63
msgid ""
"Get an :class:`~codecs.IncrementalEncoder` object for the given *encoding*."
msgstr ""
msgstr "取得給定 *encoding* 的 :class:`~codecs.IncrementalEncoder` 物件。"

#: ../../c-api/codec.rst:67
msgid ""
"Get an :class:`~codecs.IncrementalDecoder` object for the given *encoding*."
msgstr ""
msgstr "取得給定 *encoding* 的 :class:`~codecs.IncrementalDecoder` 物件。"

#: ../../c-api/codec.rst:71
msgid ""
"Get a :class:`~codecs.StreamReader` factory function for the given "
"*encoding*."
msgstr ""
msgstr "取得給定 *encoding* 的 :class:`~codecs.StreamReader` 工廠函式。"

#: ../../c-api/codec.rst:75
msgid ""
"Get a :class:`~codecs.StreamWriter` factory function for the given "
"*encoding*."
msgstr ""
msgstr "取得給定 *encoding* 的 :class:`~codecs.StreamWriter` 工廠函式。"

#: ../../c-api/codec.rst:79
msgid "Registry API for Unicode encoding error handlers"
msgstr ""
msgstr "用於 Unicode 編碼錯誤處理程式的註冊 API"

#: ../../c-api/codec.rst:83
msgid ""
Expand All @@ -122,6 +137,9 @@ msgid ""
"unencodable characters/undecodable bytes and *name* is specified as the "
"error parameter in the call to the encode/decode function."
msgstr ""
"在給定的 *name* 下註冊錯誤處理回呼 (callback) 函式 *error*。當編解碼器遇到無"
"法編碼的字元/無法解碼的位元組並且 *name* 被指定為呼叫編碼/解碼函式時的錯誤參"
"數時,將呼叫此回呼函式。"

#: ../../c-api/codec.rst:88
msgid ""
Expand All @@ -135,40 +153,48 @@ msgid ""
"integer giving the offset in the original string at which encoding/decoding "
"should be resumed."
msgstr ""
"回呼取得單個引數,即 :exc:`UnicodeEncodeError`、:exc:`UnicodeDecodeError` "
"或 :exc:`UnicodeTranslateError` 的實例,其中包含關於有問題的字元或位元組序列"
"及其在原始字串中偏移量的資訊(有關取得此資訊的函式,請參閱 :ref:"
"`unicodeexceptions`)。回呼必須引發給定的例外,或者回傳一個包含有問題序列的替"
"換的二元組 (two-item tuple),以及一個代表原始字串中應該被恢復的編碼/解碼偏移"
"量的整數。"

#: ../../c-api/codec.rst:98
msgid "Return ``0`` on success, ``-1`` on error."
msgstr ""
msgstr "成功時回傳 ``0``,錯誤時回傳 ``-1``。"

#: ../../c-api/codec.rst:102
msgid ""
"Lookup the error handling callback function registered under *name*. As a "
"special case ``NULL`` can be passed, in which case the error handling "
"callback for \"strict\" will be returned."
msgstr ""
"查找 *name* 下已註冊的錯誤處理回呼函式。作為一種特殊情況,可以傳遞 ``NULL``,"
"在這種情況下,將回傳 \"strict\" 的錯誤處理回呼。"

#: ../../c-api/codec.rst:108
msgid "Raise *exc* as an exception."
msgstr ""
msgstr "引發 *exc* 作為例外。"

#: ../../c-api/codec.rst:112
msgid "Ignore the unicode error, skipping the faulty input."
msgstr ""
msgstr "忽略 unicode 錯誤,跳過錯誤的輸入。"

#: ../../c-api/codec.rst:116
msgid "Replace the unicode encode error with ``?`` or ``U+FFFD``."
msgstr ""
msgstr "將 unicode 編碼錯誤替換為 ``?`` 或 ``U+FFFD``。"

#: ../../c-api/codec.rst:120
msgid "Replace the unicode encode error with XML character references."
msgstr ""
msgstr "將 unicode 編碼錯誤替換為 XML 字元參照。"

#: ../../c-api/codec.rst:124
msgid ""
"Replace the unicode encode error with backslash escapes (``\\x``, ``\\u`` "
"and ``\\U``)."
msgstr ""
msgstr "將 unicode 編碼錯誤替換為反斜線跳脫(``\\x``、``\\u`` 和 ``\\U``)。"

#: ../../c-api/codec.rst:129
msgid "Replace the unicode encode error with ``\\N{...}`` escapes."
msgstr ""
msgstr "將 unicode 編碼錯誤替換為 ``\\N{...}`` 跳脫。"