-
-
Notifications
You must be signed in to change notification settings - Fork 214
Tutorial/datastructures #24
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
非常感謝你的幫忙!✨
這邊有一些東西希望你能幫忙改一下,主要是關於 fuzzy entry 的修改。Fuzzy entry 都是因為之前原文有一些微調而產生的,所以要麻煩多注意一些原文與原譯文用詞上的差異。
再麻煩你了,如果有不同意我的 review 的地方都歡迎提出來討論,如果有任何問題的話歡迎在聊天室裡發問!
tutorial/datastructures.po
Outdated
msgstr "" | ||
"搜尋 list 中值為 x 的項目,刪除 list 中第一個成功搜尋的結果(項目)。若 list " | ||
"中無此項目,這會是一個錯誤。" | ||
msgstr "刪除 list 中第一個值為 *x* 的元素。若 list 中無此元素則會產生錯誤。" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
這一系列的 fuzzy entries 主要的變更是 "is" 都改成了 "is equal to",我想是要強調在 Python 裡面 is
和 ==
的差別,我覺得在翻譯這邊我們也可以把「值為 x」改成「值等於 x」,這樣比較可以避免歧義。
tutorial/datastructures.po
Outdated
"搜尋 list 中值為 x 的項目,回傳第一個成功搜尋結果(項目)的位置(從零開始的索" | ||
"引值)。若 list 中無此項目,就丟出 :exc:`ValueError`。" | ||
"回傳 list 中第一個值為 *x* 的索引值(從零開始索引)。若 list 中無此項目,則丟" | ||
"出 :exc:`ValueError`錯誤。" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:exc:`ValueError`
後面少了一個空格,這樣 rST 語法會顯示不出來哦!
tutorial/datastructures.po
Outdated
msgid "" | ||
"Return zero-based index in the list of the first item whose value is equal " | ||
"to *x*. Raises a :exc:`ValueError` if there is no such item." | ||
msgstr "" | ||
"搜尋 list 中值為 x 的項目,回傳第一個成功搜尋結果(項目)的位置(從零開始的索" | ||
"引值)。若 list 中無此項目,就丟出 :exc:`ValueError`。" | ||
"回傳 list 中第一個值為 *x* 的索引值(從零開始索引)。若 list 中無此項目,則丟" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上面的 comment,「值為」應該改成「值等於」
另外,「索引值」在這邊我覺得直接略過 "item" 這個詞的翻譯會有點突兀,也許可以說是「第一個值為 x 的元素的索引值」
s/從零開始索引/從零開始的索引/ 「從零開始的」在這邊是作形容詞修飾索引,應該保留「的」
tutorial/datastructures.po
Outdated
"其中 key 必須是獨一無二的(在一個 dictionary 裡)。使用一對大括號可以創建一個" | ||
"空的 dict :``{}`` 。把一串由逗號分隔的鍵值對放置於大括號內可以為 dict 提供初" | ||
"始的鍵值對,這也是 dict 輸出時的樣子。" | ||
"思考 dict 最好的方式是把它想成是一組無序鍵值對 (*key: value* pair) 的集合,其" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
原文的上一個變更是把 "as an unordered set of key value pairs" 改成 "a set of key value pairs" [1](我覺得應該是因為 Python 3.7 的 dict
保留了 insertion order,並且已經納入 Python spec 中 [2],即非 CPython 特定的特性),所以這邊的「無序」應該要拿掉。
[1] 可以參考 $ git log -L 550,559:tutorial/datastructures.po
產生的這幾行翻譯的歷史紀錄
[2] https://mail.python.org/pipermail/python-dev/2017-December/151283.html
tutorial/datastructures.po
Outdated
"始的鍵值對,這也是 dict 輸出時的樣子。" | ||
"思考 dict 最好的方式是把它想成是一組無序鍵值對 (*key: value* pair) 的集合,其" | ||
"中 key 在同一個 dictionary(字典)裡必須是獨一無二的。使用一對大括號可創建一" | ||
"個空的字典 :``{}`` 。將一串由逗號分隔的鍵對值置於大括號則可初始化字典 。這" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
兩個句點前都多了一個空格
s/鍵對值/鍵值對/
tutorial/datastructures.po
Outdated
"對 dict 使用 ``list(d.keys())`` 會得到一個含有該 dict 所有鍵,順序為任意排列" | ||
"的 list 。(如果想要排序過的,使用 ``sorted(d.keys())`` 代替即可) [2]_ 要確" | ||
"認一個鍵是否已經存在於 dict 中,使用 :keyword:`in` 關鍵字。" | ||
"對字典使用 ``list(d.keys())`` 會得到一個包含該字典所有鍵 (key),順序為任意排" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
這邊原文是改成 list(d)
而非 list(d.keys())
,另外,順序是按照 insertion order。可以參考 $ git log -L 573,582:tutorial/datastructures.po
顯示的歷史紀錄
tutorial/datastructures.po
Outdated
"的 list 。(如果想要排序過的,使用 ``sorted(d.keys())`` 代替即可) [2]_ 要確" | ||
"認一個鍵是否已經存在於 dict 中,使用 :keyword:`in` 關鍵字。" | ||
"對字典使用 ``list(d.keys())`` 會得到一個包含該字典所有鍵 (key),順序為任意排" | ||
"列的 list 。(若想要排序,則使用 ``sorted(d.keys())`` 代替即可)。如果想確認一" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
第一個句點前多了一個空格
Hello 感謝你的建議,我已經根據你的建議做了一些修改。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感謝你的修改,這邊有兩個小小的細節再麻煩你了!
"對 dict 使用 ``list(d.keys())`` 會得到一個含有該 dict 所有鍵,順序為任意排列" | ||
"的 list 。(如果想要排序過的,使用 ``sorted(d.keys())`` 代替即可) [2]_ 要確" | ||
"認一個鍵是否已經存在於 dict 中,使用 :keyword:`in` 關鍵字。" | ||
"對字典使用 ``list(d)`` 會得到一個包含該字典所有鍵 (key),其排列順序為插入時的順序。" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
這邊要說的是「會得到一個包含該字典所有鍵(key)的 list」嗎?
msgid "" | ||
"Return zero-based index in the list of the first item whose value is equal " | ||
"to *x*. Raises a :exc:`ValueError` if there is no such item." | ||
msgstr "" | ||
"搜尋 list 中值為 x 的項目,回傳第一個成功搜尋結果(項目)的位置(從零開始的索" | ||
"引值)。若 list 中無此項目,就丟出 :exc:`ValueError`。" | ||
"回傳 list 中第一個值等於為 *x* 的項目之索引值(從零開始的索引)。若 list 中無此項目,則丟" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/值等於為/值等於/
@scTakt Thanks for your contribution! I've fixed the final two comments by myself and merged the PR. |
修正四則翻譯