From ee829575af8ca4148c757bd1a92fa679957049ef Mon Sep 17 00:00:00 2001 From: linooohon Date: Mon, 14 Mar 2022 23:36:14 +0800 Subject: [PATCH 1/2] translate library/hmac.po --- library/hmac.po | 66 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 53 insertions(+), 13 deletions(-) diff --git a/library/hmac.po b/library/hmac.po index 10d9d27e7f..92da65d9ef 100644 --- a/library/hmac.po +++ b/library/hmac.po @@ -3,13 +3,15 @@ # This file is distributed under the same license as the Python package. # # Translators: +# Adrian Liaw , 2018 +# Phil Lin , 2022 msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" -"PO-Revision-Date: 2018-05-23 16:03+0000\n" -"Last-Translator: Adrian Liaw \n" +"PO-Revision-Date: 2022-03-14 23:58+0800\n" +"Last-Translator: Phil Lin \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -17,10 +19,11 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.0.1\n" #: ../../library/hmac.rst:2 msgid ":mod:`hmac` --- Keyed-Hashing for Message Authentication" -msgstr "" +msgstr ":mod:`hmac` --- 基於鍵散列的訊息驗證" #: ../../library/hmac.rst:10 msgid "**Source code:** :source:`Lib/hmac.py`" @@ -28,7 +31,7 @@ msgstr "**原始碼:**\\ :source:`Lib/hmac.py`" #: ../../library/hmac.rst:14 msgid "This module implements the HMAC algorithm as described by :rfc:`2104`." -msgstr "" +msgstr "此模組 (module) 實現了 :rfc:`2014` 所描述的 HMAC 演算法。" #: ../../library/hmac.rst:19 msgid "" @@ -38,6 +41,10 @@ msgid "" "object to use. It may be any name suitable to :func:`hashlib.new`. Despite " "its argument position, it is required." msgstr "" +"回傳一個新的 hmac 物件。*key* 是一個指定密鑰的 bytes(位元組)或 bytearray 物" +"件。如果提供了 *msg*,將會呼叫 ``update(msg)`` 方法。*digestmod* 為 HMAC 物件" +"所用的摘要名稱、摘要建構函式 (constructor) 或模組。它可以是適用於 :func:" +"`hashlib.new` 的任何名稱。儘管該引數的位置在後,但它卻是必須的。" #: ../../library/hmac.rst:25 msgid "" @@ -45,6 +52,8 @@ msgid "" "of any type supported by :mod:`hashlib`. Parameter *digestmod* can be the " "name of a hash algorithm." msgstr "" +"參數 *key* 可以為 bytes 或 bytearray 物件。參數 *msg* 可以為 :mod:`hashlib` " +"所支持的任意型別。參數 *digestmod* 可以為散列演算法的名稱。" #: ../../library/hmac.rst:33 msgid "" @@ -52,6 +61,8 @@ msgid "" "parameter is now required. Pass it as a keyword argument to avoid " "awkwardness when you do not have an initial msg." msgstr "" +"MD5 作為 *digestmod* 的隱式默認摘要已被棄用。digestmod 參數現在是必須的。請將" +"其作為關鍵字參數傳入以避免當你沒有初始化 msg 時導致的麻煩。" #: ../../library/hmac.rst:38 msgid "" @@ -61,6 +72,10 @@ msgid "" "The parameters *key*, *msg*, and *digest* have the same meaning as in :func:" "`~hmac.new`." msgstr "" +"基於給定密鑰 *key* 和 *digest* 回傳 *msg* 的摘要。此函式等價於 ``HMAC(key, " +"msg, digest).digest()``\\ ,但使用了優化的 C 或 行內實現,對放入記憶體的訊息" +"能處理得更快。參數 *key*、*msg* 和 *digest* 在 :func:`~hmac.new` 中具有相同含" +"義。" #: ../../library/hmac.rst:44 msgid "" @@ -68,10 +83,12 @@ msgid "" "when *digest* is a string and name of a digest algorithm, which is supported " "by OpenSSL." msgstr "" +"作為 CPython 的實現細節,優化的 C 實現只有當 *digest* 為字串並且是一個 " +"OpenSSL 所支持的摘要演算法的名稱時才會被使用。" #: ../../library/hmac.rst:51 msgid "An HMAC object has the following methods:" -msgstr "" +msgstr "HMAC 物件具有下列方法 (method):" #: ../../library/hmac.rst:55 msgid "" @@ -79,10 +96,12 @@ msgid "" "single call with the concatenation of all the arguments: ``m.update(a); m." "update(b)`` is equivalent to ``m.update(a + b)``." msgstr "" +"用 *msg* 來更新 hmac 物件。重複呼叫相當於單次呼叫並傳入所有引數的拼接結果:" +"``m.update(a); m.update(b)`` 等價於 ``m.update(a + b)``\\ 。" #: ../../library/hmac.rst:59 msgid "Parameter *msg* can be of any type supported by :mod:`hashlib`." -msgstr "" +msgstr "參數 *msg* 可以是 :mod:`hashlib` 所支持的任何類型。" #: ../../library/hmac.rst:65 msgid "" @@ -91,6 +110,9 @@ msgid "" "given to the constructor. It may contain non-ASCII bytes, including NUL " "bytes." msgstr "" +"回傳當前已傳給 :meth:`update` 方法的 bytes 摘要。這個 bytes 物件的長度會與傳" +"給建構函式的摘要 *digest_size* 的長度相同。它可以包含 NUL bytes 以及 non-" +"ASCII bytes。" #: ../../library/hmac.rst:72 msgid "" @@ -99,6 +121,9 @@ msgid "" "`compare_digest` function instead of the ``==`` operator to reduce the " "vulnerability to timing attacks." msgstr "" +"在一個例行的驗證事務運行期間,將 :meth:`digest` 的輸出與外部提供的摘要進行比" +"較時,建議使用 :func:`compare_digest` 函式而不是 ``==`` 運算子以減少被定時攻" +"擊時的漏洞。" #: ../../library/hmac.rst:80 msgid "" @@ -106,6 +131,8 @@ msgid "" "length containing only hexadecimal digits. This may be used to exchange the " "value safely in email or other non-binary environments." msgstr "" +"像是 :meth:`digest` 但摘要的回傳形式為兩倍長度的字串,且此字串只包含十六進位" +"數位。這可以被用於在電子郵件或其他非二進位制環境中安全地交換數據。" #: ../../library/hmac.rst:86 msgid "" @@ -114,6 +141,9 @@ msgid "" "`compare_digest` function instead of the ``==`` operator to reduce the " "vulnerability to timing attacks." msgstr "" +"在一個例行的驗證事務運行期間,將 :meth:`hexdigest` 的輸出與外部提供的摘要進行" +"比較時,建議使用 :func:`compare_digest` 函式而不是 ``==`` 運算子以減少被定時" +"攻擊時的漏洞。" #: ../../library/hmac.rst:94 msgid "" @@ -121,22 +151,24 @@ msgid "" "efficiently compute the digests of strings that share a common initial " "substring." msgstr "" +"回傳 hmac 物件的拷貝 (“clone”)。這可以被用來有效率地計算那些共享相同初始子字" +"串的字串的摘要。" #: ../../library/hmac.rst:98 msgid "A hash object has the following attributes:" -msgstr "" +msgstr "一個 hash 物件具有以下屬性:" #: ../../library/hmac.rst:102 msgid "The size of the resulting HMAC digest in bytes." -msgstr "" +msgstr "以 bytes 表示最終 HMAC 物件的大小。" #: ../../library/hmac.rst:106 msgid "The internal block size of the hash algorithm in bytes." -msgstr "" +msgstr "以 bytes 表示散列演算法的內部區塊大小。" #: ../../library/hmac.rst:112 msgid "The canonical name of this HMAC, always lowercase, e.g. ``hmac-md5``." -msgstr "" +msgstr "HMAC 的正準名稱總是為小寫形式,例如 ``hmac-md5``\\ 。" #: ../../library/hmac.rst:119 msgid "" @@ -144,10 +176,12 @@ msgid "" "outer`` are internal implementation details and will be removed in Python " "3.10." msgstr "" +"未寫入文件的屬性 ``HMAC.digest_cons``\\ ,``HMAC.inner`` 和 ``HMAC.outer`` 屬" +"於內部實現細節,將在 Python 3.10 中被移除。" #: ../../library/hmac.rst:123 msgid "This module also provides the following helper function:" -msgstr "" +msgstr "這個模組還提供了下列輔助函式:" #: ../../library/hmac.rst:127 msgid "" @@ -157,6 +191,10 @@ msgid "" "either :class:`str` (ASCII only, as e.g. returned by :meth:`HMAC." "hexdigest`), or a :term:`bytes-like object`." msgstr "" +"回傳 ``a == b``\\ 。此函式使用一種經專門設計的方式通過避免基於內容的短路行為" +"來防止定時分析,使得它適合處理密碼學。*a* 和 *b* 必須為相同的類型:可以是 :" +"class:`str`\\ (僅限 ASCII,如 :meth:`HMAC.hexdigest` 的回傳值),或者是 :" +"term:`bytes-like object`\\ 。" #: ../../library/hmac.rst:135 msgid "" @@ -164,11 +202,13 @@ msgid "" "attack could theoretically reveal information about the types and lengths of " "*a* and *b*—but not their values." msgstr "" +"如果 *a* 和 *b* 具有不同的長度,或者如果發生了錯誤,定時攻擊在理論上可以獲取" +"有關 *a* 和 *b* 的型別和長度的訊息 — 但不能獲取他們的值。" #: ../../library/hmac.rst:143 msgid "" "The function uses OpenSSL's ``CRYPTO_memcmp()`` internally when available." -msgstr "" +msgstr "此函式在可能的情況下會在內部使用 OpenSSL 的 ``CRYPTO_memcmp()``\\ 。" #: ../../library/hmac.rst:149 msgid "Module :mod:`hashlib`" @@ -176,4 +216,4 @@ msgstr ":mod:`hashlib` 模組" #: ../../library/hmac.rst:150 msgid "The Python module providing secure hash functions." -msgstr "" +msgstr "Python 模組提供安全的散列函式。" From 3663e6205d546d07612a20d1a2d3993c9bed3936 Mon Sep 17 00:00:00 2001 From: linooohon Date: Wed, 30 Mar 2022 02:05:28 +0800 Subject: [PATCH 2/2] fix: fix terms and wrong translation based on suggestion. --- library/hmac.po | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/library/hmac.po b/library/hmac.po index 92da65d9ef..9847f0496d 100644 --- a/library/hmac.po +++ b/library/hmac.po @@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" -"PO-Revision-Date: 2022-03-14 23:58+0800\n" +"PO-Revision-Date: 2022-03-30 00:16+0800\n" "Last-Translator: Phil Lin \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -23,7 +23,7 @@ msgstr "" #: ../../library/hmac.rst:2 msgid ":mod:`hmac` --- Keyed-Hashing for Message Authentication" -msgstr ":mod:`hmac` --- 基於鍵散列的訊息驗證" +msgstr ":mod:`hmac` --- 基於金鑰雜湊的訊息驗證" #: ../../library/hmac.rst:10 msgid "**Source code:** :source:`Lib/hmac.py`" @@ -53,7 +53,7 @@ msgid "" "name of a hash algorithm." msgstr "" "參數 *key* 可以為 bytes 或 bytearray 物件。參數 *msg* 可以為 :mod:`hashlib` " -"所支持的任意型別。參數 *digestmod* 可以為散列演算法的名稱。" +"所支援的任意型別。參數 *digestmod* 可以為雜湊演算法的名稱。" #: ../../library/hmac.rst:33 msgid "" @@ -61,8 +61,8 @@ msgid "" "parameter is now required. Pass it as a keyword argument to avoid " "awkwardness when you do not have an initial msg." msgstr "" -"MD5 作為 *digestmod* 的隱式默認摘要已被棄用。digestmod 參數現在是必須的。請將" -"其作為關鍵字參數傳入以避免當你沒有初始化 msg 時導致的麻煩。" +"MD5 作為 *digestmod* 的隱式預設摘要已被棄用。digestmod 參數現在是必須的。請將" +"其作為關鍵字引數傳入以避免當你沒有初始 msg 時導致的麻煩。" #: ../../library/hmac.rst:38 msgid "" @@ -73,9 +73,9 @@ msgid "" "`~hmac.new`." msgstr "" "基於給定密鑰 *key* 和 *digest* 回傳 *msg* 的摘要。此函式等價於 ``HMAC(key, " -"msg, digest).digest()``\\ ,但使用了優化的 C 或 行內實現,對放入記憶體的訊息" -"能處理得更快。參數 *key*、*msg* 和 *digest* 在 :func:`~hmac.new` 中具有相同含" -"義。" +"msg, digest).digest()``\\ ,但使用了優化的 C 或 行內實作(inline " +"implementation),對放入記憶體的訊息能處理得更快。參數 *key*、*msg* 和 " +"*digest* 在 :func:`~hmac.new` 中具有相同含義。" #: ../../library/hmac.rst:44 msgid "" @@ -83,7 +83,7 @@ msgid "" "when *digest* is a string and name of a digest algorithm, which is supported " "by OpenSSL." msgstr "" -"作為 CPython 的實現細節,優化的 C 實現只有當 *digest* 為字串並且是一個 " +"作為 CPython 的實現細節,C 的優化實作只有當 *digest* 為字串並且是一個 " "OpenSSL 所支持的摘要演算法的名稱時才會被使用。" #: ../../library/hmac.rst:51 @@ -101,7 +101,7 @@ msgstr "" #: ../../library/hmac.rst:59 msgid "Parameter *msg* can be of any type supported by :mod:`hashlib`." -msgstr "參數 *msg* 可以是 :mod:`hashlib` 所支持的任何類型。" +msgstr "參數 *msg* 可以是 :mod:`hashlib` 所支援的任何型別。" #: ../../library/hmac.rst:65 msgid "" @@ -151,8 +151,8 @@ msgid "" "efficiently compute the digests of strings that share a common initial " "substring." msgstr "" -"回傳 hmac 物件的拷貝 (“clone”)。這可以被用來有效率地計算那些共享相同初始子字" -"串的字串的摘要。" +"回傳 hmac 物件的拷貝 (\"clone\")。這可以被用來有效率地計算那些共享相同初始" +"子字串的字串的摘要。" #: ../../library/hmac.rst:98 msgid "A hash object has the following attributes:" @@ -160,11 +160,11 @@ msgstr "一個 hash 物件具有以下屬性:" #: ../../library/hmac.rst:102 msgid "The size of the resulting HMAC digest in bytes." -msgstr "以 bytes 表示最終 HMAC 物件的大小。" +msgstr "以 bytes 表示最終 HMAC 摘要的大小。" #: ../../library/hmac.rst:106 msgid "The internal block size of the hash algorithm in bytes." -msgstr "以 bytes 表示散列演算法的內部區塊大小。" +msgstr "以 bytes 表示雜湊演算法的內部區塊大小。" #: ../../library/hmac.rst:112 msgid "The canonical name of this HMAC, always lowercase, e.g. ``hmac-md5``." @@ -192,7 +192,7 @@ msgid "" "hexdigest`), or a :term:`bytes-like object`." msgstr "" "回傳 ``a == b``\\ 。此函式使用一種經專門設計的方式通過避免基於內容的短路行為" -"來防止定時分析,使得它適合處理密碼學。*a* 和 *b* 必須為相同的類型:可以是 :" +"來防止定時分析,使得它適合處理密碼學。*a* 和 *b* 必須為相同的型別:可以是 :" "class:`str`\\ (僅限 ASCII,如 :meth:`HMAC.hexdigest` 的回傳值),或者是 :" "term:`bytes-like object`\\ 。" @@ -216,4 +216,4 @@ msgstr ":mod:`hashlib` 模組" #: ../../library/hmac.rst:150 msgid "The Python module providing secure hash functions." -msgstr "Python 模組提供安全的散列函式。" +msgstr "Python 模組提供安全的雜湊函式。"