Skip to content
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

Translate unittest.mock.po, from rst:17 to rst:201 #610

Merged
merged 12 commits into from
Aug 29, 2023

Conversation

ken71301
Copy link
Collaborator

@ken71301 ken71301 commented Aug 22, 2023

#565 related issue
translate till the end of Quick Guide part.

PayonAbyss and others added 4 commits August 15, 2023 16:51
翻譯rst:17與rst:21

可能需討論部分譯名(例如stub)
translate from rst:27 to rst:42
@ken71301 ken71301 closed this Aug 22, 2023
@mattwang44
Copy link
Collaborator

咦是誤關嗎?

@ken71301
Copy link
Collaborator Author

忘了先跑make確認,跑完晚點我再reopen吧

@mattwang44
Copy link
Collaborator

沒問題,也可以直接看 github action output 就好
image
image

@ken71301 ken71301 reopened this Aug 22, 2023
@ken71301
Copy link
Collaborator Author

有個地方要確定一下,就是斜體,例如 Python在翻譯中要視為rst語法使用/ ,還是當作正常英文留空就好?

@mattwang44
Copy link
Collaborator

有個地方要確定一下,就是斜體,例如 Python在翻譯中要視為rst語法使用/ ,還是當作正常英文留空就好?

沒有看懂是在指哪一句,可以請你直接在覺得有問題的地方留言嗎


#: ../../library/unittest.mock.rst:3
msgid ":mod:`unittest.mock` --- mock object library"
msgstr ""
msgstr ":mod:`unittest.mock` — 模擬物件函式庫"
Copy link
Collaborator

Choose a reason for hiding this comment

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

針對 mock 翻譯成「模擬」覺得還是有點疑慮:我自己認為意思比較接近「仿造」,和 simulation 相近但不完全一樣。不過既然 patch 不翻譯的話,mock 我覺得也可以不翻譯。你覺得呢?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

mock一方面是參照了樂詞網的 mock interviews (模擬面試)一詞,翻仿造又有跟 fake 搞混的可能性,好像也不太行。
mock整個不翻譯的話是一解,但我個人還是投模擬一票...,這邊看其他人有沒有想法吧。

Copy link
Collaborator

@mattwang44 mattwang44 Aug 22, 2023

Choose a reason for hiding this comment

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

認真探討 simulation 與 mock 的差異的話,兩者都是 (廣義的)模擬,但前者是追求更完整的模擬、後者只為特定目的而達成最低需求的模擬;我自己是覺得找不到中文詞彙可以呈現這種差異。
測試領域的 stub, fake, spy, mock, dummy 在口語溝通上也通常直接使用英文原文而沒有慣用翻譯,即便我們自己定義了一套對映翻譯,應也難以讓人理解這幾個詞彙間的差異。

Anyway, 如果想要徵得更多人意見的話,可以考慮在 channel 發文或者發一篇 discussion 做紀錄歐!

Copy link
Collaborator Author

@ken71301 ken71301 Aug 23, 2023

Choose a reason for hiding this comment

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

discussion at #613

Copy link
Collaborator

@mattwang44 mattwang44 left a comment

Choose a reason for hiding this comment

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

對於 \\ 的使用時機好像怪怪的,請參考這張圖再檢查一下目前的翻譯

image

Copy link
Collaborator

@mattwang44 mattwang44 left a comment

Choose a reason for hiding this comment

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

review round 1

@@ -89,6 +109,9 @@ msgid ""
"from another object. Attempting to access attributes or methods on the mock "
"that don't exist on the spec will fail with an :exc:`AttributeError`."
msgstr ""
"Mock 有許多其他方法可以讓你配置與控制它的行為。例如,\\ *spec*\\ 引數可以配"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

這裡的spec是斜體,照一般英文的處理方式就可以了嗎? 這邊翻譯當下有跟特殊語法搞混,輸出html後發現好像該+空格

Copy link
Collaborator

Choose a reason for hiding this comment

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

的確把它當成英文字詞就好,改成 例如,*spec* 引數 即可。

@ken71301
Copy link
Collaborator Author

對於 \\ 的使用時機好像怪怪的,請參考這張圖再檢查一下目前的翻譯

image

翻譯的時候是參考首頁的rST 語法注意事項
應該是我搞錯,我看一下你貼的圖,感謝~

@@ -50,23 +56,32 @@ msgid ""
"some examples of how to use :class:`Mock`, :class:`MagicMock` and :func:"
"`patch`."
msgstr ""
"此外,mock 還提供了一個 :func:`patch` 裝飾器,用於 patching 測試範圍內對 "
"module(模組)以及 class(類別)級別的屬性,以及用於建立唯一物件的 :const:"
"`sentinel`\\ 。有關如何使用 :class:`Mock`\\、\\ :class:`MagicMock` 和 :func:"
Copy link
Collaborator

@mattwang44 mattwang44 Aug 22, 2023

Choose a reason for hiding this comment

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

nit: rst/sphinx 特殊語法是能夠認得全形頓號、逗號和句號的(但認不得全形括號),這邊的 \\ 有加和沒加的 render 結果相同。可改可不改。

Suggested change
"`sentinel`\\ 。有關如何使用 :class:`Mock`\\、\\ :class:`MagicMock` 和 :func:"
"`sentinel`。有關如何使用 :class:`Mock`:class:`MagicMock` 和 :func:"

PayonAbyss and others added 3 commits August 23, 2023 10:10
修正半形冒號
修正錯用簡中用詞

#: ../../library/unittest.mock.rst:201
msgid "The Mock Class"
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.

這裡是不是要翻成 Mock 類別,下面是在介紹 Mock 這個 class

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

可能先決定要怎麼翻,到時候這邊翻成 Mock(mock的翻譯)類別 之類的吧?

Copy link
Contributor

Choose a reason for hiding this comment

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

我的意思是這裡 Mock 應該不用翻出來,因為下面都在說明 Mock() 相關的 methods、arguments

修正 mock 為不翻譯
@ken71301
Copy link
Collaborator Author

修正Mock於翻譯時維持原文

Copy link
Collaborator

@mattwang44 mattwang44 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 mattwang44 merged commit bcc8d40 into python:3.12 Aug 29, 2023
@ken71301 ken71301 deleted the translate-mock branch August 30, 2023 08:04
beccalzh pushed a commit to beccalzh/python-docs-zh-tw that referenced this pull request Sep 4, 2024
* docs(translate-mock): mock page翻譯

翻譯rst:17與rst:21

可能需討論部分譯名(例如stub)

* docs: mock translate

translate from rst:27 to rst:42

* docs(translate-mock): mock page翻譯

翻譯rst:60

* docs(translate-mock): mock page翻譯

翻譯rst:72至rst:201

* docs(translate-mock): mock page翻譯

fix rst error

* docs(translate-mock): mock page翻譯

fix format

* docs: mock translate

用詞修正

* docs: mock translate

space修正

* fix(translate-mock):

fix space

* fix(translate-mock):

修正半形冒號

* fix: 用詞修正

修正錯用簡中用詞

* fix(translate-mock):

修正 mock 為不翻譯

---------

Co-authored-by: 鄭宇辰 <ken71301@gmail.com>
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.

4 participants