Skip to content

Translate tutorial/inputoutput.po #74

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 8 commits into from
Jun 28, 2021
Merged

Conversation

StevenHsuYL
Copy link
Contributor

@StevenHsuYL StevenHsuYL commented May 26, 2021

This is the work continued from #53.

  1. The inputoutput.po was updated and fully translated.
  2. I fix a "一" (注音文) in datastructures.po

Reference: https://terms.naer.edu.tw/

1. rst:330 was not updated.
2. Fix a "一" (注音文) in datastructures.po
Only change 「」 marks. Thanks!
Update msgid of rst:330, 335.
Completed.
Copy link
Collaborator

@adrianliaw adrianliaw left a comment

Choose a reason for hiding this comment

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

目前看到 inputoutput.rst:302

@@ -64,6 +65,10 @@ msgid ""
"Inside this string, you can write a Python expression between ``{`` and ``}"
"`` characters that can refer to variables or literal values."
msgstr ""
"要使用\\ :ref:`格式化的字串文本 (formatted string literals) <tut-f-strings>`"
Copy link
Collaborator

Choose a reason for hiding this comment

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

「格式化字串文本」應該就可以了(格式化字串這個名詞感覺應該已經用很久了)

@@ -80,13 +88,18 @@ msgid ""
"string type has some methods that perform useful operations for padding "
"strings to a given column width."
msgstr ""
"最後,你還可以自己用字串切片 (slicing) 和序連 (concatenation) 運算,完成所有"
Copy link
Collaborator

Choose a reason for hiding this comment

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

序連?感覺可以說連接、串接、合併

@@ -80,13 +88,18 @@ msgid ""
"string type has some methods that perform useful operations for padding "
"strings to a given column width."
msgstr ""
"最後,你還可以自己用字串切片 (slicing) 和序連 (concatenation) 運算,完成所有"
Copy link
Collaborator

Choose a reason for hiding this comment

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

s/運算/操作

@@ -80,13 +88,18 @@ msgid ""
"string type has some methods that perform useful operations for padding "
"strings to a given column width."
msgstr ""
"最後,你還可以自己用字串切片 (slicing) 和序連 (concatenation) 運算,完成所有"
"的字串處理,建立任何你能想像的排版格式。字串類型有一些 method ,能以給定的欄"
Copy link
Collaborator

Choose a reason for hiding this comment

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

s/字串類型/字串型別

@@ -99,6 +112,11 @@ msgid ""
"structures like lists and dictionaries, have the same representation using "
"either function. Strings, in particular, have two distinct representations."
msgstr ""
":func:`str` 函式會將值以人類易讀的表示法回傳,而 :func:`repr` 則會產生直譯器"
Copy link
Collaborator

Choose a reason for hiding this comment

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

str 函式的用意是回傳一個人類易讀的表示法 / repr 的用意是產生....

原文會說「meant to return ...」而不是「returns ...」是有原因的,python 並沒有規定 __repr__ 一定要回傳直譯器可讀的程式碼,那只是一個慣例而已

"字串物件的 :meth:`str.rjust` method 透過在左側填補空格,使字串以給定的欄寬進"
"行靠右對齊。類似的 method 還有 :meth:`str.ljust` 和 :meth:`str.center`\\ 。這"
"些 method 不寫入任何內容,只回傳一個新字串,如果輸入的字串太長,它們不會截斷"
"字串,而是不做任何改變地回傳;雖然這樣會弄亂欄的布置,但這通常還是比另一種情"
Copy link
Collaborator

Choose a reason for hiding this comment

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

s/佈置/編排

@@ -254,21 +332,28 @@ msgid ""
"zero or more elements of ``values``. This operation is commonly known as "
"string interpolation. For example::"
msgstr ""
"% 運算子(modulo,模數)也可用於字串格式化。在 ``'string' % values`` 中,\\ "
"``string`` 的實例 ``%`` 會被 ``values`` 的零個或多個元素所取代。此運算常被稱"
"為字串內插 (string interpolation)。例如:\n"
Copy link
Collaborator

Choose a reason for hiding this comment

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

s/字串內插/字串插值

@@ -254,21 +332,28 @@ msgid ""
"zero or more elements of ``values``. This operation is commonly known as "
"string interpolation. For example::"
msgstr ""
"% 運算子(modulo,模數)也可用於字串格式化。在 ``'string' % values`` 中,\\ "
"``string`` 的實例 ``%`` 會被 ``values`` 的零個或多個元素所取代。此運算常被稱"
Copy link
Collaborator

Choose a reason for hiding this comment

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

string 中所有的 % 會被 values 的零個或...

@@ -281,6 +366,11 @@ msgid ""
"reading and writing. The *mode* argument is optional; ``'r'`` will be "
"assumed if it's omitted."
msgstr ""
"第一個引數是一個包含檔案名稱的字串。第二個引數是另一個字串,包含了描述檔案使"
"用方式的幾個字元。\\ *mode* 為 ``'r'`` 時,表示檔案唯讀;為 ``'w'`` 時,表示"
Copy link
Collaborator

Choose a reason for hiding this comment

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

s/表示檔案唯讀/表示以唯讀模式開啟檔案
s/表示檔案唯寫/表示以唯寫模式開啟檔案

"用方式的幾個字元。\\ *mode* 為 ``'r'`` 時,表示檔案唯讀;為 ``'w'`` 時,表示"
"檔案唯寫(已存在的同名檔案會被抹除);為 ``'a'`` 時,以附加內容為目的開啟檔"
"案,任何寫入檔案的資料會自動被加入到檔案的結尾。\\ ``'r+'`` 可以開啟檔案並進"
"行讀取和寫入。\\ *mode* 引數是可選的,若省略時會預設為 ``'r'``。"
Copy link
Collaborator

Choose a reason for hiding this comment

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

s/可選的/選擇性的

@@ -291,6 +387,11 @@ msgid ""
"`binary mode`: now the data is read and written in the form of bytes "
"objects. This mode should be used for all files that don't contain text."
msgstr ""
"通常,檔案以 :dfn:`text mode` 開啟,意即,從檔案中讀取或寫入字串時,都以特定"
"編碼方式進行編碼。如未指定編碼方式,則預設值會取決於平台 (platform dependent)"
Copy link
Collaborator

Choose a reason for hiding this comment

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

「取決於系統平台」就可以了,不需要加括弧註解,platform dependent 不算是術語

"通常,檔案以 :dfn:`text mode` 開啟,意即,從檔案中讀取或寫入字串時,都以特定"
"編碼方式進行編碼。如未指定編碼方式,則預設值會取決於平台 (platform dependent)"
"(見 :func:`open`\\ )。在 mode 加上 ``'b'`` 會以 :dfn:`binary mode` 開啟檔"
"案:此時,資料以位元組物件 (bytes object) 的形式被讀寫。此模式應該使用於所有"
Copy link
Collaborator

Choose a reason for hiding this comment

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

hmmmm 我們好像還沒有 bytes 的對應中文術語... 可以考慮位元組串?(位元組是指一個 byte,單數的)

@@ -302,6 +403,11 @@ msgid ""
"file:`JPEG` or :file:`EXE` files. Be very careful to use binary mode when "
"reading and writing such files."
msgstr ""
"在文字模式 (text mode) 下,讀取時會預設把平台指定的 (platform-specific) 行尾"
Copy link
Collaborator

Choose a reason for hiding this comment

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

s/平台指定的/平台特定的

然後感覺應該是不需要註釋 platform-specific

@@ -302,6 +403,11 @@ msgid ""
"file:`JPEG` or :file:`EXE` files. Be very careful to use binary mode when "
"reading and writing such files."
msgstr ""
"在文字模式 (text mode) 下,讀取時會預設把平台指定的 (platform-specific) 行尾"
"結束符號(Unix 上為 ``\\n``,Windows 上為 ``\\r\\n``)轉換為 ``\\n``。在文字"
Copy link
Collaborator

Choose a reason for hiding this comment

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

s/行尾結束符號/行尾符號

@@ -311,33 +417,51 @@ msgid ""
"keyword:`!with` is also much shorter than writing equivalent :keyword:`try`"
"\\ -\\ :keyword:`finally` blocks::"
msgstr ""
"在處理檔案物件時,使用 :keyword:`with` 關鍵字是個好習慣。優點是,當它的套件結"
"束後,即使在某個時刻引發了異常,檔案仍會正確地被關閉。使用 :keyword:`!with` "
Copy link
Collaborator

Choose a reason for hiding this comment

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

s/異常/例外

@@ -350,6 +474,14 @@ msgid ""
"binary mode) are read and returned. If the end of the file has been reached, "
"``f.read()`` will return an empty string (``''``). ::"
msgstr ""
"要讀取檔案的內容,可呼叫 ``f.read(size)``,它可讀取一部份的資料,並以字串(文"
"字模式)或位元組物件(二進制模式)形式回傳。\\ *size* 是個選擇性的數字引數。"
Copy link
Collaborator

Choose a reason for hiding this comment

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

s/位元組物件/位元組串物件 或是 bytes (不翻譯)


#: ../../tutorial/inputoutput.rst:394
msgid ""
"If you want to read all the lines of a file in a list you can also use "
"``list(f)`` or ``f.readlines()``."
msgstr ""
"如果你想要在一個 list 中讀取檔案的所有行,可以用 ``list(f)`` 或 ``f."
Copy link
Collaborator

Choose a reason for hiding this comment

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

如果你想把一個檔案的所有行讀進一個 list 裡


#: ../../tutorial/inputoutput.rst:403
msgid ""
"Other types of objects need to be converted -- either to a string (in text "
"mode) or a bytes object (in binary mode) -- before writing them::"
msgstr ""
"寫入其他類型的物件之前,要先把它們轉換為字串(文字模式)或位元組物件(二進制"
Copy link
Collaborator

Choose a reason for hiding this comment

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

bytes object 同上


#: ../../tutorial/inputoutput.rst:411
msgid ""
"``f.tell()`` returns an integer giving the file object's current position in "
"the file represented as number of bytes from the beginning of the file when "
"in binary mode and an opaque number when in text mode."
msgstr ""
"``f.tell()`` 回傳一個整數,它給出檔案物件在檔案中的當前位置,在二進制模式下表"
"示為檔案開始至今的位元組數,在文字模式下表示為一個意義不明的數字 (opaque "
Copy link
Collaborator

Choose a reason for hiding this comment

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

應該是不需要註釋 opaque number,它就真的是一個意義不明的數字XD


#: ../../tutorial/inputoutput.rst:498
msgid ":mod:`pickle` - the pickle module"
msgstr ""
msgstr ":mod:`pickle` - 泡菜模組"
Copy link
Collaborator

Choose a reason for hiding this comment

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

是醃黃瓜吧 這個應該直接用原文「pickle 模組」就可以了

Fixed as suggestion.
@StevenHsuYL
Copy link
Contributor Author

I prefer 「位元組串物件」,and above suggestions were all applied.
Thanks for review!

@adrianliaw adrianliaw merged commit 15b08a0 into python:3.9 Jun 28, 2021
@adrianliaw
Copy link
Collaborator

✨ 🍰 ✨

beccalzh pushed a commit to beccalzh/python-docs-zh-tw that referenced this pull request Sep 4, 2024
* Translate inputoutput.po

1. rst:330 was not updated.
2. Fix a "一" (注音文) in datastructures.po

* Add translator

* Update year of Copyright

* Update datastructures.po

Only change 「」 marks. Thanks!

* Update inputoutput.po

Update msgid of rst:330, 335.
Completed.
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