Repository navigation
Translate c-api/hash.po - #1259
Open
lilwad-0730 wants to merge 3 commits into
Open
lilwad-0730 wants to merge 3 commits into
lilwad-0730 wants to merge 3 commits into
Conversation
ken71301
reviewed
Nov 7, 2026
ken71301
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the translation! I rendered c-api/hash.po against 3.15 and checked the 6 new entries (Py_HASH_ALGORITHM, Py_HASH_FNV/SIPHASH*, Py_HASH_CUTOFF x2, Py_HashBuffer x2). They all render correctly, with the reST roles and links intact, and the terminology (雜湊, 緩衝區, 緩衝協定, 門檻值, 不可變物件) is consistent with the glossary. The meaning matches the English source.
Two suggestions:
- Stray space after
。— several paragraphs render with a space after a full-width period, e.g.…雜湊演算法。 雜湊演算法可透過…,…設為 7,…。 若在…and…一致。 此雜湊值…. This is probably a space left at a wrapped line join in the PO. Removing it (or runningmake wrap) should fix it. - Optional wording — the second
Py_HashBufferparagraph, 「對透過 tp_richcompare 函式與另一個物件的緩衝區進行比較的不可變物件實作其雜湊功能」, is a long chain of modifiers. Something like 「用於為不可變物件實作雜湊,其 tp_richcompare 函式會與另一個物件的緩衝區進行比較」 may read more easily.
Nothing blocking. I only checked how the changed entries render, not the rest of the file.
Remove literal newlines inside msgstr that rendered as a stray space after full-width periods, keep the :ref: role separated with "\ " now that the newline before it is gone, and reword the Py_HashBuffer paragraph to avoid a long chain of modifiers. Also fix the typo "演算式名稱" to "演算法名稱". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mattwang44
reviewed
Nov 7, 2026
Comment on lines
+43
to
+44
| "用一個數值,表示用於對 :class:`str`、:class:`bytes` 和 :class:`memoryview` 進" | ||
| "行雜湊的演算法。" |
Collaborator
There was a problem hiding this comment.
Suggested change
| "用一個數值,表示用於對 :class:`str`、:class:`bytes` 和 :class:`memoryview` 進" | |
| "行雜湊的演算法。" | |
| "一個用來表示是以何種演算法對 :class:`str`、:class:`bytes` 和 :class:`memoryview` " | |
| "進行雜湊的數值。" |
| "via the configure :option:`--with-hash-algorithm` option." | ||
| msgstr "" | ||
| "用來與 :c:macro:`Py_HASH_ALGORITHM` 比較的數值,以判斷使用哪一種雜湊演算法。" | ||
| "雜湊演算法可透過 configure 的 :option:`--with-hash-algorithm` 選項設定。" |
| "it is easier to create colliding strings. A cutoff of 7 on 64-bit platforms " | ||
| "and 5 on 32-bit platforms should provide a decent safety margin." | ||
| msgstr "" | ||
| "32 位元的平台應使用比 64 位元的平台更小的門檻值,因為在 32 位元平台上更容易建" |
Collaborator
There was a problem hiding this comment.
cutoff 翻譯成「門檻值」的緣由為何?不會被讀者誤解為 threshold 嗎?
| msgstr "" | ||
| "計算並回傳從位址 *ptr* 開始、長度為 *len* 位元組的緩衝區之雜湊值。此雜湊值會" | ||
| "保證與 :class:`bytes`、:class:`memoryview` 及其他實作\\ :ref:`緩衝協定 " | ||
| "<bufferobjects>` 的內建物件之雜湊值一致。" |
Collaborator
There was a problem hiding this comment.
Suggested change
| "<bufferobjects>` 的內建物件之雜湊值一致。" | |
| "<bufferobjects>`\\ 的內建物件之雜湊值一致。" |
| "implement the :ref:`buffer protocol <bufferobjects>`." | ||
| msgstr "" | ||
| "計算並回傳從位址 *ptr* 開始、長度為 *len* 位元組的緩衝區之雜湊值。此雜湊值會" | ||
| "保證與 :class:`bytes`、:class:`memoryview` 及其他實作\\ :ref:`緩衝協定 " |
Collaborator
There was a problem hiding this comment.
Suggested change
| "保證與 :class:`bytes`、:class:`memoryview` 及其他實作\\ :ref:`緩衝協定 " | |
| "保證與 :class:`bytes`、:class:`memoryview` 及其他有實作\\ :ref:`緩衝協定 " |
Comment on lines
+205
to
+206
| "使用此函式為不可變物件實作雜湊,這類物件的 " | ||
| ":c:member:`~PyTypeObject.tp_richcompare` 函式會與另一個物件的緩衝區進行比較。" |
Collaborator
There was a problem hiding this comment.
Suggested change
| "使用此函式為不可變物件實作雜湊,這類物件的 " | |
| ":c:member:`~PyTypeObject.tp_richcompare` 函式會與另一個物件的緩衝區進行比較。" | |
| "對於其 :c:member:`~PyTypeObject.tp_richcompare` 函式會與另一個物件之緩衝區進行比較的" | |
| "不可變物件,用此函式來為這類物件實作雜湊。" |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
完成
c-api/hash.po中原先未翻譯的 6 筆條目,涵蓋雜湊演算法識別值、短緩衝區最佳化,以及緩衝區雜湊函式的說明。保留 reST 引用標記並修正最後一筆譯文的成員引用格式。Closes #1257
驗證:
sphinx-lint c-api/hash.po通過。3.15比對,英文原文字串未變,所有行皆不超過 79 字元。git diff --check通過。