Skip to content

Translate howto/sorting from section 'Decorate-Sort-Undecorate' to end #580

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 3 commits into from
Aug 18, 2023

Conversation

mindihx
Copy link
Collaborator

@mindihx mindihx commented Aug 12, 2023

issue #569
後半段 Decorate-Sort-Undecorate 到結尾

howto/sorting.po Outdated
@@ -309,17 +324,23 @@ msgid ""
"part of their API. For example, :func:`locale.strcoll` is a comparison "
"function."
msgstr ""
"當從其它語言翻譯演算法的時候常看到比較函式。有些函式庫也會提供比較函式作為其 "
"API 的一部份,例如 :func:`locale.strcoll` 就是一個比較函式。"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

啊這邊多一個空白我下次一起改

howto/sorting.po Outdated

#: ../../howto/sorting.rst:253
msgid "Odds and Ends"
msgstr ""
msgstr "零星雜事"
Copy link
Collaborator Author

@mindihx mindihx Aug 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這不知道怎麼翻比較適合,很不像文件的用詞 :p

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改成 雜項說明 如何?

howto/sorting.po Outdated

#: ../../howto/sorting.rst:274
msgid ""
"The sort routines use ``<`` when making comparisons between two objects. So, "
"it is easy to add a standard sort order to a class by defining an :meth:"
"`~object.__lt__` method:"
msgstr ""
"排序時會使用 ``<`` 來比較兩個物件,因此要在類別裡面加入順序比較基準是簡單的,"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這個 standard sort order 不確定怎麼翻比較好

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

翻成 因此要在類別裡面加入排序順序比較規則是簡單的 如何?

@mindihx
Copy link
Collaborator Author

mindihx commented Aug 12, 2023

對了可以把這個 pr 跟前面那個 pr assign 給我嗎
#571
這樣之後比較好搜尋~ 謝謝

@mattwang44
Copy link
Collaborator

對了可以把這個 pr 跟前面那個 pr assign 給我嗎 #571 這樣之後比較好搜尋~ 謝謝

已 assign,不過感覺可以直接搜尋 author 就好?

@mattwang44
Copy link
Collaborator

@weijay0804 想請你來 review 這個 PR 🙏🏽

@weijay0804
Copy link
Contributor

OK 沒問題,我有空就開始~

@mindihx
Copy link
Collaborator Author

mindihx commented Aug 14, 2023

對了可以把這個 pr 跟前面那個 pr assign 給我嗎 #571 這樣之後比較好搜尋~ 謝謝

已 assign,不過感覺可以直接搜尋 author 就好?

喔喔我本來以為只能搜尋 assignee
感謝告知 :p

@mattwang44 mattwang44 requested a review from weijay0804 August 14, 2023 02:18
howto/sorting.po Outdated

#: ../../howto/sorting.rst:208
msgid ""
"This idiom works because tuples are compared lexicographically; the first "
"items are compared; if they are the same then the second items are compared, "
"and so on."
msgstr ""
"這個方式會有效是因為元組是依照字典順序來比較;先比較第一個項目;如果一樣再比"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這邊感覺可以把原文加上去
依照字典順序 (lexicographically) 來比較
因為怕會跟 Python 中的 dictionary 搞混

howto/sorting.po Outdated

#: ../../howto/sorting.rst:215
msgid ""
"The sort is stable -- if two items have the same key, their order will be "
"preserved in the sorted list."
msgstr ""
"排序會是穩定的——如果兩個項目有相同的鍵,它們在排序好的串列中會保持原來的順"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這邊改成
排序會是穩定的 - 如果兩個項目有相同的鍵
感覺會比較清楚一點

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

確認一下是指把破折號改成 hyphen 嗎

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯嗯
因為原本的會是這樣
截圖 2023-08-15 下午5 09 14

改成 hyphen 會是這樣
截圖 2023-08-15 下午5 22 59

看起來比較清楚一點

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這邊想順便問一下~
原文裡面會出現一個、兩個或三個 hyphen
什麼情況下要翻成破折號,什麼情況下要翻成一個 hyphen
什麼情況下要維持跟原文一樣的 hyphen 數
這個有一個規則嗎,還是就是每次遇到就看情況?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm 我好像也沒有特別注意過這件事,幾乎都是看原文有幾個譯文就放幾個

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我習慣是遇到 一一 就翻譯成 - ,不過如果要翻譯成 -- 應該也沒問題

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果不翻破折號的,這邊我先照原文的 hyphen 數量

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯嗯 沒問題~
再麻煩你了🙏

howto/sorting.po Outdated

#: ../../howto/sorting.rst:227
msgid ""
"Now that Python sorting provides key-functions, this technique is not often "
"needed."
msgstr ""
msgstr "而因為 Python 的排序提供了鍵函式,已經不太常需要這個方法了。"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這邊把原文也放上去比較好
而因為 Python 的排序提供了鍵函式 (key-functions)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

因為上半部的翻譯已經出現過鍵函式的原文
所以這裡就不放了~

howto/sorting.po Outdated

#: ../../howto/sorting.rst:227
msgid ""
"Now that Python sorting provides key-functions, this technique is not often "
"needed."
msgstr ""
msgstr "而因為 Python 的排序提供了鍵函式,已經不太常需要這個方法了。"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這邊改成 已經不太需要這個方法了。 感覺比較通順一點

howto/sorting.po Outdated
@@ -301,6 +312,10 @@ msgid ""
"function such as ``cmp(a, b)`` will return a negative value for less-than, "
"zero if the inputs are equal, or a positive value for greater-than."
msgstr ""
"例如\\ `天秤 <https://upload.wikimedia.org/wikipedia/commons/1/17/"
"Balance_à_tabac_1850.JPG>`_\\ 比較兩邊樣本並給出相對的順序:較輕、相同、或較"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

較輕、相同或較重

howto/sorting.po Outdated
"例如\\ `天秤 <https://upload.wikimedia.org/wikipedia/commons/1/17/"
"Balance_à_tabac_1850.JPG>`_\\ 比較兩邊樣本並給出相對的順序:較輕、相同、或較"
"重。同樣地,像是 ``cmp(a, b)`` 這樣的比較函式會回傳負數代表小於、0 代表輸入相"
"同、或正數代表大於。"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同,或正數代表大於。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

還是說跟上面 較輕、相同或較重 一樣改成 同或正數代表大於?
或者前面的 負數代表小於 後面也要一起改成逗號?

howto/sorting.po Outdated

#: ../../howto/sorting.rst:253
msgid "Odds and Ends"
msgstr ""
msgstr "零星雜事"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改成 雜項說明 如何?

howto/sorting.po Outdated
@@ -328,6 +349,9 @@ msgid ""
"\"alphabetical\" sort orderings can vary across cultures even if the "
"underlying alphabet is the same."
msgstr ""
"要處理能理解本地語系 (locale aware) 的排序可以使用 :func:`locale.strxfrm` 當"
"作鍵函式,或 :func:`locale.strcoll` 當作比較函式。這樣做是必要的,因為在不同"
"文化中就算是相同的字母,按「字母順序」排序的結果也各不相同。"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這邊要改成全形引號
按「字母順序」排序的結果也各不相同。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原來我打出來的不是全形,就想說怎麼看起來有點窄...

howto/sorting.po Outdated

#: ../../howto/sorting.rst:274
msgid ""
"The sort routines use ``<`` when making comparisons between two objects. So, "
"it is easy to add a standard sort order to a class by defining an :meth:"
"`~object.__lt__` method:"
msgstr ""
"排序時會使用 ``<`` 來比較兩個物件,因此要在類別裡面加入順序比較基準是簡單的,"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

翻成 因此要在類別裡面加入排序順序比較規則是簡單的 如何?

@mattwang44 mattwang44 linked an issue Aug 14, 2023 that may be closed by this pull request
@mindihx mindihx requested a review from weijay0804 August 15, 2023 01:19
howto/sorting.po Outdated

#: ../../howto/sorting.rst:215
msgid ""
"The sort is stable -- if two items have the same key, their order will be "
"preserved in the sorted list."
msgstr ""
"排序會是穩定的——如果兩個項目有相同的鍵,它們在排序好的串列中會保持原來的順"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我習慣是遇到 一一 就翻譯成 - ,不過如果要翻譯成 -- 應該也沒問題

howto/sorting.po Outdated
Comment on lines 337 to 339
"讓其可以當作鍵函式來使用:\n"
"\n"
"::"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我也要把陷阱卡的效果轉嫁給你了

可以參考這些討論

Suggested change
"讓其可以當作鍵函式來使用:\n"
"\n"
"::"
"讓其可以當作鍵函式來使用: ::"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改,我之前看的 pr 也有一樣的用法 (line 96, 436) 有需要改嗎
https://github.com/python/python-docs-zh-tw/pull/572/files

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

之前的 PR 你有空再改也可以,因為這種寫法只是更簡潔方便而已, render 出來的效果是一樣的。

howto/sorting.po Outdated

#: ../../howto/sorting.rst:208
msgid ""
"This idiom works because tuples are compared lexicographically; the first "
"items are compared; if they are the same then the second items are compared, "
"and so on."
msgstr ""
"這個方式會有效是因為元組是依照字典順序 (lexicographically) 來比較;先比較第"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這裡改成逗號會不會比較好

Suggested change
"這個方式會有效是因為元組是依照字典順序 (lexicographically) 來比較先比較第"
"這個方式會有效是因為元組是依照字典順序 (lexicographically) 來比較先比較第"

Copy link
Contributor

@weijay0804 weijay0804 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
辛苦了~~

@mattwang44
Copy link
Collaborator

Thanks for the efforts!

@mattwang44 mattwang44 merged commit bbc8024 into python:3.12 Aug 18, 2023
beccalzh pushed a commit to beccalzh/python-docs-zh-tw that referenced this pull request Sep 4, 2024
python#580)

* Translate howto/sorting from section 'Decorate-Sort-Undecorate' to end

* Refine translation of howto/sorting

* Refine translation for howto/sorting
@mindihx mindihx deleted the howto_sorting_part2 branch September 11, 2024 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Translate howto/sorting
3 participants