Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mattwang44 merged 5 commits intopython:3.10fromStevenHsuYL:controlflow
Jul 24, 2022

Conversation

StevenHsuYL
Copy link
Contributor

Completematch statement part in controlflow.po

Any suggestion would be welcomed. Thanks for the review!

Reference:pattern,guard.

@mattwang44mattwang44 self-requested a reviewJune 11, 2022 07:16
@StevenHsuYL
Copy link
ContributorAuthor

Updatematch section.

Preview:
controlflow match

@mattwang44
Copy link
Collaborator

commit history 有點嚇人XD 好像包含到一些非關 controlflow 的改動
@StevenHsuYL 可以幫忙 rebase 一下嗎 🙏🏽

@StevenHsuYL
Copy link
ContributorAuthor

已修復 ^^"
會變這樣好像是因為上週 CPython 有更新此檔,我 merge3.10 branch 更新原文檔,
之後就跑出一大堆 commit history...
目前已還原到只有更改 tutorial/controlflow.po,再麻煩確認,謝謝!

StevenHsuYLand others added3 commitsJuly 7, 2022 00:48
in tutorial/controlflow.po
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Update match section after Sync with CPython 3.10
@mattwang44
Copy link
Collaborator

我有再整理了一下,現在應該是只留下需要的 commit
會再找時間 review 🙏🏽

StevenHsuYL reacted with thumbs up emoji

@@ -295,28 +297,45 @@ msgid ""
"also extract components (sequence elements or object attributes) from the "
"value into variables."
msgstr ""
":keyword:`match` 陳述式會拿取一個運算式,並將其值與多個連續的型樣 (pattern) "
Copy link
Collaborator

Choose a reason for hiding this comment

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

還是比較希望 pattern 被翻成「模式」,感覺比較口語化?


#: ../../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 ""
"請注意最後一段:「變數名稱」\\ ``_`` 是作為\\ *通用字元*\\ 的角色,且永遠不會"
Copy link
Collaborator

Choose a reason for hiding this comment

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

補一下原文好了

Suggested change
"請注意最後一段:「變數名稱」\\ ``_`` 是作為\\ *通用字元*\\ 的角色,且永遠不會"
"請注意最後一段:「變數名稱」\\ ``_`` 是作為\\ *通用字元 (wildcard)*\\ 的角色,且永遠不會"

@@ -327,13 +346,21 @@ msgid ""
"which makes it conceptually similar to the unpacking assignment ``(x, y) = "
"point``."
msgstr ""
"請仔細研究那個例子!第一個型樣有兩個字面值,可以想作是之前所述的字面值型樣的"
"延伸。但是接下來的兩個型樣結合了一個字面值和一個變數,且該變數\\ *連結*\\ 了"
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: 既有翻譯大多譯作「繫結」

Suggested change
"延伸。但是接下來的兩個型樣結合了一個字面值和一個變數,且該變數\\ *連結*\\ 了"
"延伸。但是接下來的兩個型樣結合了一個字面值和一個變數,且該變數\\ *繫結 (bind)*\\ 了"

@@ -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”),"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"``__match_args__``,來定義型樣中屬性們的特定位置。如果它被設定為 (“x”, “y”),"
"``__match_args__``,來定義型樣中屬性們的特定位置。如果它被設定為 (\"x\", \"y\"),"


#: ../../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) 來比較。"
Copy link
Collaborator

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

Suggested change
"``True``\\ 、\\ ``False`` 和 ``None``是藉由身份 (identity) 來比較。"
"``True``\\ 、\\ ``False`` 和 ``None``是藉由標識值 (identity) 來比較。"

@mattwang44mattwang44 merged commit3868ede intopython:3.10Jul 24, 2022
@StevenHsuYLStevenHsuYL deleted the controlflow branchJuly 27, 2022 02:56
beccalzh pushed a commit to beccalzh/python-docs-zh-tw that referenced this pull requestSep 4, 2024
* translate match statementin tutorial/controlflow.po* Apply suggestions from code reviewCo-authored-by: Ezio Melotti <ezio.melotti@gmail.com>* Update controlflow.poUpdate match section after Sync with CPython 3.10* Apply suggestions from code reviewAll suggestions were applied.Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ezio-melottiezio-melottiezio-melotti left review comments

@mattwang44mattwang44mattwang44 approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@StevenHsuYL@mattwang44@ezio-melotti

[8]ページ先頭

©2009-2025 Movatter.jp