-
-
Notifications
You must be signed in to change notification settings - Fork 214
Translate tutorial/controlflow.po #283
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
commit history 有點嚇人XD 好像包含到一些非關 controlflow 的改動 |
已修復 ^^" |
in tutorial/controlflow.po
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Update match section after Sync with CPython 3.10
我有再整理了一下,現在應該是只留下需要的 commit |
tutorial/controlflow.po
Outdated
@@ -295,28 +297,45 @@ msgid "" | |||
"also extract components (sequence elements or object attributes) from the " | |||
"value into variables." | |||
msgstr "" | |||
":keyword:`match` 陳述式會拿取一個運算式,並將其值與多個連續的型樣 (pattern) " |
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.
還是比較希望 pattern 被翻成「模式」,感覺比較口語化?
tutorial/controlflow.po
Outdated
|
||
#: ../../tutorial/controlflow.rst:274 | ||
msgid "" | ||
"Note the last block: the \"variable name\" ``_`` acts as a *wildcard* and " | ||
"never fails to match. If no case matches, none of the branches is executed." | ||
msgstr "" | ||
"請注意最後一段:「變數名稱」\\ ``_`` 是作為\\ *通用字元*\\ 的角色,且永遠不會" |
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.
補一下原文好了
"請注意最後一段:「變數名稱」\\ ``_`` 是作為\\ *通用字元*\\ 的角色,且永遠不會" | |
"請注意最後一段:「變數名稱」\\ ``_`` 是作為\\ *通用字元 (wildcard)*\\ 的角色,且永遠不會" |
tutorial/controlflow.po
Outdated
@@ -327,13 +346,21 @@ msgid "" | |||
"which makes it conceptually similar to the unpacking assignment ``(x, y) = " | |||
"point``." | |||
msgstr "" | |||
"請仔細研究那個例子!第一個型樣有兩個字面值,可以想作是之前所述的字面值型樣的" | |||
"延伸。但是接下來的兩個型樣結合了一個字面值和一個變數,且該變數\\ *連結*\\ 了" |
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.
nit: 既有翻譯大多譯作「繫結」
"延伸。但是接下來的兩個型樣結合了一個字面值和一個變數,且該變數\\ *連結*\\ 了" | |
"延伸。但是接下來的兩個型樣結合了一個字面值和一個變數,且該變數\\ *繫結 (bind)*\\ 了" |
tutorial/controlflow.po
Outdated
@@ -344,6 +371,12 @@ msgid "" | |||
"\"y\"), the following patterns are all equivalent (and all bind the ``y`` " | |||
"attribute to the ``var`` variable)::" | |||
msgstr "" | |||
"你可以將位置參數 (positional parameter) 與一些能夠排序其屬性的內建 class(例" | |||
"如 dataclasses)一起使用。你也可以透過在 class 中設定特殊屬性 " | |||
"``__match_args__``,來定義型樣中屬性們的特定位置。如果它被設定為 (“x”, “y”)," |
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.
"``__match_args__``,來定義型樣中屬性們的特定位置。如果它被設定為 (“x”, “y”)," | |
"``__match_args__``,來定義型樣中屬性們的特定位置。如果它被設定為 (\"x\", \"y\")," |
tutorial/controlflow.po
Outdated
|
||
#: ../../tutorial/controlflow.rst:392 | ||
msgid "" | ||
"Most literals are compared by equality, however the singletons ``True``, " | ||
"``False`` and ``None`` are compared by identity." | ||
msgstr "" | ||
"大部分的字面值是藉由相等性 (equality) 來比較,但是單例物件 (singleton) " | ||
"``True``\\ 、\\ ``False`` 和 ``None`` 是藉由身份 (identity) 來比較。" |
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.
https://docs.python.org/zh-tw/3/library/functions.html#id
"``True``\\ 、\\ ``False`` 和 ``None`` 是藉由身份 (identity) 來比較。" | |
"``True``\\ 、\\ ``False`` 和 ``None`` 是藉由標識值 (identity) 來比較。" |
All suggestions were applied.
* translate match statement in tutorial/controlflow.po * Apply suggestions from code review Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com> * Update controlflow.po Update match section after Sync with CPython 3.10 * Apply suggestions from code review All suggestions were applied. Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Complete
match
statement part in controlflow.poAny suggestion would be welcomed. Thanks for the review!
Reference: pattern, guard.