Skip to content

[UPDATE] Translate library/os.path #492

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 10 commits into from
Jul 22, 2023
Merged

[UPDATE] Translate library/os.path #492

merged 10 commits into from
Jul 22, 2023

Conversation

jacksonchen1998
Copy link
Contributor

@jacksonchen1998 jacksonchen1998 commented Jul 19, 2023

#480
有針對上次 review 做更改,包括:

  • 函數」改為「函式」,文中仍有混用情形。
  • 「返回」改為「回傳」,文中仍有混用情形。
  • implement 請統一翻為「實作」,文中仍見「實作」與「實做」混用情形。
  • call 的繁體中文翻譯為「呼叫」(參考:國家教育研究院樂詞網)。
  • string 的繁體中文翻譯為「字串」(參考:國家教育研究院樂詞網),文中仍有部份地方為「字符串」。

目前維持原先「適用」的翻譯。Drive 目前暫翻驅動機,因為 drive letter (drive name) 在術語列表翻譯為驅動機字母 (驅動機名)

image

image

image

image

image

image

image

image

image

Copy link
Collaborator

@cschan1828 cschan1828 left a comment

Choose a reason for hiding this comment

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

Thanks for your commit!

這次的翻譯有點多,我沒有每句都很仔細讀,可能會需要更多的時間 review。
先給個初步的回饋給你參考修正。


#: ../../library/os.path.rst:280
msgid ""
"Return ``True`` if *path* refers to an :func:`existing <exists>` directory "
"entry that is a symbolic link. Always ``False`` if symbolic links are not "
"supported by the Python runtime."
msgstr ""
"如果 *path* 是指向\\ :func:`已存在的 <exists>`\\ 目錄項目且為符號連結,則回"
"傳 ``True``。如果 Python 執行時不支持符號連結,則始終回傳 ``False``。"
Copy link
Collaborator

Choose a reason for hiding this comment

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

前後一致,這邊請用「支援」。

@@ -348,10 +375,17 @@ msgid ""
"UNC are always mount points, and for any other path ``GetVolumePathName`` is "
"called to see if it is different from the input path."
msgstr ""
"如果路徑名 *path* 是一個掛載點 (:dfn:`mount point`),則回傳 ``True``。在 "
Copy link
Collaborator

Choose a reason for hiding this comment

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

"A point in a file system ..." 這句似乎沒有翻譯到。

@@ -361,6 +395,9 @@ msgid ""
"temporary build directories, package caches, and other IO-intensive "
"operations."
msgstr ""
"如果路徑名 *path* 位於 Windows Dev 驅動機上,則回傳 ``True``。Dev 驅動機針對"
"開發人員場景進行了優化,提供更快的讀寫檔案性能。建議將其用於原始程式碼、臨時"
"建置目錄、封包緩存和其他 I/O 密集型操作。"
Copy link
Collaborator

Choose a reason for hiding this comment

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

cache 繁體中文一般譯為 「快取」,或者不翻譯。

Comment on lines 410 to 411
"碟機的平台上返回 ``False``。請參閱 `Windows 文檔 <https://learn.microsoft."
"com/windows/dev-drive/>`_\\ 以了解有關啟用和建立 Dev 驅動機的信息。"
Copy link
Collaborator

Choose a reason for hiding this comment

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

document 繁體中文翻譯為「文件」
information 繁體中文翻譯為「資訊」

@@ -424,13 +479,20 @@ msgid ""
"interpreted in an implementation-defined manner, although more than two "
"leading characters shall be treated as a single character."
msgstr ""
"在 POSIX 系統中,根據 `IEEE Std 1003.1 2013 版; 4.13 Pathname Resolution "
"<https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04."
"html#tag_04_13>`_ 標準,如果一個路徑名以確切的兩個斜線開頭,則在前導字元後的"
Copy link
Collaborator

Choose a reason for hiding this comment

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

exactly two 為恰好兩個之意。

@@ -414,6 +465,10 @@ msgid ""
"that contains symbolic links. On Windows, it converts forward slashes to "
"backward slashes. To normalize case, use :func:`normcase`."
msgstr ""
"通過合併多餘的分隔符號和上層引用來規範化路徑名,使得 ``A//B``、``A/B/``、"
"``A/./B`` 和 ``A/foo/../B`` 都變成 ``A/B``。這種字串操作可能會改變包含符號連"
"結的路徑的含義。在 Windows 上,它將正斜線轉換為反斜線。要規範化大小寫,請使"
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
"結的路徑的含義。在 Windows 上,它將正斜線轉換為反斜線。要規範化大小寫,請使"
"結的路徑的含義。在 Windows 上,它將正斜線轉換為反斜線。要標準化大小寫,請使"


#: ../../library/os.path.rst:499
msgid ""
"If the path contains a UNC path, drive will contain the host name and share::"
msgstr ""
"如果路徑包含 UNC 路徑,則驅動機將包含主機名和共享名,不包括第四個分隔符:"
Copy link
Collaborator

Choose a reason for hiding this comment

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

原文沒有「不包括第四個分隔符」這句。
:: 是特殊符號,表示接下來會有 code block.

Suggested change
"如果路徑包含 UNC 路徑,則驅動機將包含主機名和共享名,不包括第四個分隔符:"
"如果路徑包含 UNC 路徑,則驅動機將包含主機名和共享名:\n"
"\n"
"::"


#: ../../library/os.path.rst:530
msgid ""
"On Windows, *drive* may be empty, a drive-letter name, a UNC share, or a "
"device name. The *root* may be empty, a forward slash, or a backward slash. "
"For example::"
msgstr ""
"在 Windows 上,*drive* 可能為空,是驅動機名稱,UNC 共享或設備名稱。*root* 可"
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
"在 Windows 上,*drive* 可能為空,是驅動機名稱,UNC 共享或設備名稱。*root* 可"
"在 Windows 上,*drive* 可能為空、驅動機名稱、UNC 共享或是設備名稱。*root* 可"

"在 POSIX 系統上,*drive* 始終為空。*root* 可能為空(如果 *path* 是相對路"
"徑),一個斜線(如果 *path* 是絕對路徑),或者兩個斜線(根據 `IEEE Std "
"1003.1-2017; 4.13 Pathname Resolution <https://pubs.opengroup.org/"
"onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>`_ 的實現定義)。例"
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
"onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>`_ 的實現定義)。例"
"onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>`_ 的實作定義)。例"


#: ../../library/os.path.rst:544
msgid ""
"Split the pathname *path* into a pair ``(root, ext)`` such that ``root + "
"ext == path``, and the extension, *ext*, is empty or begins with a period "
"and contains at most one period."
msgstr ""
"將路徑名 *path* 拆分為一對 ``(root, ext)``,使得 ``root + ext == path``,且副"
"檔名 *ext* 為空或以點開頭且最多包含一個點。"
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
"檔名 *ext* 為空或以點開頭且最多包含一個點。"
"檔名 *ext* 為空或以點開頭且最多包含一個點 (period)"

「點」在中文上語意很多,建議附上原文讓讀者知道是指英文句子結尾的那個 "."。

@cschan1828 cschan1828 requested a review from mattwang44 July 19, 2023 22:30
@jacksonchen1998
Copy link
Contributor Author

@cschan1828 Thanks. I have modified.

Copy link
Collaborator

@cschan1828 cschan1828 left a comment

Choose a reason for hiding this comment

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

Thanks for your modification! I've reviewed it. You've made some nice improvements.
There is some minor feedback that needs your attention.

@cschan1828
Copy link
Collaborator

cschan1828 commented Jul 20, 2023

剛剛發現前面也有不少誤用中文全形括號的部份,請參考

  • 翻譯守則 - 中英文交雜時要插入空白;符號英文間不用。
  • 括號的使用 - 如果括號中的文字包含中文,使用全形括號;如果括號中只有英文,使用半形括號並比照英文的形式加入前後文的空白。

自行檢查與修正。

@@ -558,42 +651,55 @@ msgid ""
"Pathname Resolution <https://pubs.opengroup.org/onlinepubs/9699919799/"
"basedefs/V1_chap04.html#tag_04_13>`_.) For example::"
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto.

你可以在這個 repo 中找到許多類似範例,基本上就是
":\n"
"\n"
"::"

這樣的模式。後續有 :: 的部份我就不一一列出了,請自行找出並修正。

@jacksonchen1998
Copy link
Contributor Author

@cschan1828 I have modified. Please check.

Copy link
Collaborator

@cschan1828 cschan1828 left a comment

Choose a reason for hiding this comment

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

Nice job done! Just request a small change then this commit is good to merge.

@cschan1828
Copy link
Collaborator

另外一個建議是,遇到 Python 內建的資料結構如 sequence, list, tuple 等,可以不必翻譯,直接比照原文即可。

@jacksonchen1998
Copy link
Contributor Author

@cschan1828 OK. Thanks for your review.

Copy link
Collaborator

@cschan1828 cschan1828 left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you for your efforts.

@cschan1828 cschan1828 merged commit 1e7e0fc into python:3.12 Jul 22, 2023
beccalzh pushed a commit to beccalzh/python-docs-zh-tw that referenced this pull request Sep 4, 2024
* [UPDATE] Translate `library/os.path`
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.

2 participants