Skip to content

Commit

Permalink
resolve fuzzy entries and add simple translation
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwang44 committed Feb 22, 2025
1 parent 9a24bb9 commit bc3c310
Show file tree
Hide file tree
Showing 17 changed files with 1,235 additions and 1,109 deletions.
129 changes: 66 additions & 63 deletions faq/design.po
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,18 @@ msgstr ""

#: ../../faq/design.rst:65
msgid ""
"The :class:`float` type in CPython uses a C ``double`` for storage. A :"
"class:`float` object's value is stored in binary floating-point with a fixed "
"precision (typically 53 bits) and Python uses C operations, which in turn "
"rely on the hardware implementation in the processor, to perform floating-"
"point operations. This means that as far as floating-point operations are "
"concerned, Python behaves like many popular languages including C and Java."
msgstr ""
"CPython 的 :class:`float` 型別使用了 C 的 ``double`` 型別來儲存。一個 :class:"
"`float` 物件的值會以固定的精度(通常為 53 位元)存為二進制浮點數,Python 使"
"用 C 來運算浮點數,而他的結果會依處理器中的硬體實作方式來決定。這表示就浮點數"
"運算來說,Python 和 C、Java 等很多受歡迎的語言有一樣的行為。"
"The :class:`float` type in CPython uses a C ``double`` for storage. "
"A :class:`float` object's value is stored in binary floating-point with a "
"fixed precision (typically 53 bits) and Python uses C operations, which in "
"turn rely on the hardware implementation in the processor, to perform "
"floating-point operations. This means that as far as floating-point "
"operations are concerned, Python behaves like many popular languages "
"including C and Java."
msgstr ""
"CPython 的 :class:`float` 型別使用了 C 的 ``double`` 型別來儲存。一"
"個 :class:`float` 物件的值會以固定的精度(通常為 53 位元)存為二進制浮點數,"
"Python 使用 C 來運算浮點數,而他的結果會依處理器中的硬體實作方式來決定。這表"
"示就浮點數運算來說,Python 和 C、Java 等很多受歡迎的語言有一樣的行為。"

#: ../../faq/design.rst:72
msgid ""
Expand Down Expand Up @@ -249,11 +250,11 @@ msgid ""
"``m_`` prefix, so this explicitness is still useful in those languages, too."
msgstr ""
"第一,這樣可以更明顯表現出你在用方法 (method) 或是實例 (instance) 的屬性,而"
"非一個區域變數。即使不知道類別 (class) 的定義,當看到 ``self.x`` 或 ``self."
"meth()``,就會很清楚地知道是正在使用實例的變數或是方法。在 C++ 裡,你可以藉由"
"沒有區域變數宣告來判斷這件事 ── 但在 Python 裡沒有區域變數宣告,所以你必須去"
"看類別的定義來確定。有些 C++ 和 Java 的程式碼規格要求要在實例屬性的名稱加上前"
" ``m_``,所以這種明確性在那些語言也是很好用的。"
"非一個區域變數。即使不知道類別 (class) 的定義,當看到 ``self.x`` 或 "
"``self.meth()``,就會很清楚地知道是正在使用實例的變數或是方法。在 C++ 裡,"
"可以藉由沒有區域變數宣告來判斷這件事 ── 但在 Python 裡沒有區域變數宣告,所以"
"你必須去看類別的定義來確定。有些 C++ 和 Java 的程式碼規格要求要在實例屬性的名"
"稱加上前綴 ``m_``,所以這種明確性在那些語言也是很好用的。"

#: ../../faq/design.rst:127
msgid ""
Expand Down Expand Up @@ -353,12 +354,12 @@ msgstr ""
msgid ""
"(b) When I read code that says len(x) I *know* that it is asking for the "
"length of something. This tells me two things: the result is an integer, and "
"the argument is some kind of container. To the contrary, when I read x."
"len(), I have to already know that x is some kind of container implementing "
"an interface or inheriting from a class that has a standard len(). Witness "
"the confusion we occasionally have when a class that is not implementing a "
"mapping has a get() or keys() method, or something that isn't a file has a "
"write() method."
"the argument is some kind of container. To the contrary, when I read "
"x.len(), I have to already know that x is some kind of container "
"implementing an interface or inheriting from a class that has a standard "
"len(). Witness the confusion we occasionally have when a class that is not "
"implementing a mapping has a get() or keys() method, or something that isn't "
"a file has a write() method."
msgstr ""
"(二) 當我看到一段程式碼寫著 len(x),我\\ *知道*\\ 他要找某個東西的長度。這"
"告訴了我兩件事:結果是一個整數、參數是某種容器。相對地,當我看到 x.len(),我"
Expand Down Expand Up @@ -419,8 +420,9 @@ msgstr ""
msgid ""
"The second objection is typically cast as: \"I am really telling a sequence "
"to join its members together with a string constant\". Sadly, you aren't. "
"For some reason there seems to be much less difficulty with having :meth:"
"`~str.split` as a string method, since in that case it is easy to see that ::"
"For some reason there seems to be much less difficulty with "
"having :meth:`~str.split` as a string method, since in that case it is easy "
"to see that ::"
msgstr ""
"第二個反對意見通常是:「我是在叫一個序列把它的成員用一個字串常數連接起來」。"
"但很遺憾地,你並不是在這樣做。因為某種原因,把 :meth:`~str.split` 當成字串方"
Expand Down Expand Up @@ -544,8 +546,8 @@ msgstr ""

#: ../../faq/design.rst:279
msgid ""
"For calling methods on objects, you can simplify yet further by using the :"
"func:`getattr` built-in to retrieve methods with a particular name::"
"For calling methods on objects, you can simplify yet further by using "
"the :func:`getattr` built-in to retrieve methods with a particular name::"
msgstr ""
"對於呼叫物件裡的方法,你可以利用內建用來找尋特定方法的函式 :func:`getattr` 來"
"做進一步的簡化: ::"
Expand Down Expand Up @@ -818,10 +820,10 @@ msgstr ""
msgid ""
"Lists, on the other hand, are more like arrays in other languages. They "
"tend to hold a varying number of objects all of which have the same type and "
"which are operated on one-by-one. For example, :func:`os.listdir('.') <os."
"listdir>` returns a list of strings representing the files in the current "
"directory. Functions which operate on this output would generally not break "
"if you added another file or two to the directory."
"which are operated on one-by-one. For example, :func:`os.listdir('.') "
"<os.listdir>` returns a list of strings representing the files in the "
"current directory. Functions which operate on this output would generally "
"not break if you added another file or two to the directory."
msgstr ""
"另一方面,串列更像是其他語言的陣列 (array)。他可以有不固定個同類別物件,且為"
"逐項操作。舉例來說,:func:`os.listdir('.') <os.listdir>` 回傳當下目錄裡的檔"
Expand Down Expand Up @@ -960,8 +962,8 @@ msgstr ""
msgid ""
"would raise a :exc:`KeyError` exception because the id of the ``[1, 2]`` "
"used in the second line differs from that in the first line. In other "
"words, dictionary keys should be compared using ``==``, not using :keyword:"
"`is`."
"words, dictionary keys should be compared using ``==``, not "
"using :keyword:`is`."
msgstr ""
"這將會導致 :exc:`KeyError` 例外,因為 ``[1, 2]`` 的 id 在第一行和第二行是不同"
"的。換句話說,字典的鍵應該要用 ``==`` 來做比較,而不是用 :keyword:`is`。"
Expand Down Expand Up @@ -1062,16 +1064,16 @@ msgstr ""

#: ../../faq/design.rst:534
msgid ""
"Furthermore it must always be the case that if ``o1 == o2`` (ie ``o1."
"__eq__(o2) is True``) then ``hash(o1) == hash(o2)`` (ie, ``o1.__hash__() == "
"o2.__hash__()``), regardless of whether the object is in a dictionary or "
"not. If you fail to meet these restrictions dictionaries and other hash "
"based structures will misbehave."
"Furthermore it must always be the case that if ``o1 == o2`` (ie "
"``o1.__eq__(o2) is True``) then ``hash(o1) == hash(o2)`` (ie, "
"``o1.__hash__() == o2.__hash__()``), regardless of whether the object is in "
"a dictionary or not. If you fail to meet these restrictions dictionaries "
"and other hash based structures will misbehave."
msgstr ""
"此外,不管物件是否在字典中,如果 ``o1 == o2``\\ (即 ``o1.__eq__(o2) is "
"True``),則 ``hash(o1) == hash(o2)``\\ (即 ``o1.__hash__() == o2."
"__hash__()``),這個事實必須要成立。如果無法滿足這項限制,那字典和其他用雜湊"
"為基底的結構會出現不正常的行為。"
"True``),則 ``hash(o1) == hash(o2)``\\ (即 ``o1.__hash__() == "
"o2.__hash__()``),這個事實必須要成立。如果無法滿足這項限制,那字典和其他用雜"
"湊為基底的結構會出現不正常的行為。"

#: ../../faq/design.rst:539
msgid ""
Expand Down Expand Up @@ -1136,16 +1138,17 @@ msgstr ""
msgid ""
"Python 2.6 adds an :mod:`abc` module that lets you define Abstract Base "
"Classes (ABCs). You can then use :func:`isinstance` and :func:`issubclass` "
"to check whether an instance or a class implements a particular ABC. The :"
"mod:`collections.abc` module defines a set of useful ABCs such as :class:"
"`~collections.abc.Iterable`, :class:`~collections.abc.Container`, and :class:"
"`~collections.abc.MutableMapping`."
"to check whether an instance or a class implements a particular ABC. "
"The :mod:`collections.abc` module defines a set of useful ABCs such "
"as :class:`~collections.abc.Iterable`, :class:`~collections.abc.Container`, "
"and :class:`~collections.abc.MutableMapping`."
msgstr ""
"Python 2.6 加入了 :mod:`abc` 模組,讓你可以定義抽象基底類別 (Abstract Base "
"Class, ABC)。你可以使用 :func:`isinstance` 和 :func:`issubclass` 來確認一個實"
"例或是類別是否實作了某個抽象基底類別。而 :mod:`collections.abc` 模組定義了一"
"系列好用的抽象基底類別,像是 :class:`~collections.abc.Iterable`、:class:"
"`~collections.abc.Container` 和 :class:`~collections.abc.MutableMapping`。"
"系列好用的抽象基底類別,像"
"是 :class:`~collections.abc.Iterable`、:class:`~collections.abc.Container` "
"和 :class:`~collections.abc.MutableMapping`。"

#: ../../faq/design.rst:578
msgid ""
Expand All @@ -1159,12 +1162,12 @@ msgid ""
"as a module interface specification and a set of examples. Many Python "
"modules can be run as a script to provide a simple \"self test.\" Even "
"modules which use complex external interfaces can often be tested in "
"isolation using trivial \"stub\" emulations of the external interface. The :"
"mod:`doctest` and :mod:`unittest` modules or third-party test frameworks can "
"be used to construct exhaustive test suites that exercise every line of code "
"in a module."
"isolation using trivial \"stub\" emulations of the external interface. "
"The :mod:`doctest` and :mod:`unittest` modules or third-party test "
"frameworks can be used to construct exhaustive test suites that exercise "
"every line of code in a module."
msgstr ""
"一個針對模組的好測試套件提供了回歸測試 (regression testing),並作為模組介面規"
"一個針對模組的好測試套件提供了迴歸測試 (regression testing),並作為模組介面規"
"範和一組範例。許多 Python 模組可以直接當成腳本執行,並提供簡單的「自我測"
"試」。即便模組使用了複雜的外部介面,他依然可以用外部介面的簡單的「樁」(stub) "
"模擬來獨立測試。:mod:`doctest` 和 :mod:`unittest` 模組或第三方的測試框架可以"
Expand Down Expand Up @@ -1209,16 +1212,16 @@ msgid ""
"\"spaghetti\" code that was hard to understand and revise. In a high-level "
"language, it is also unneeded as long as there are ways to branch (in "
"Python, with :keyword:`if` statements and :keyword:`or`, :keyword:`and`, "
"and :keyword:`if`/:keyword:`else` expressions) and loop (with :keyword:"
"`while` and :keyword:`for` statements, possibly containing :keyword:"
"`continue` and :keyword:`break`)."
"and :keyword:`if`/:keyword:`else` expressions) and loop "
"(with :keyword:`while` and :keyword:`for` statements, possibly "
"containing :keyword:`continue` and :keyword:`break`)."
msgstr ""
"在 1970 年代,人們了解到沒有限制的 goto 會導致混亂、難以理解和修改的「義大利"
"麵」程式碼 (\"spaghetti\" code)。在高階語言裡,這也是不需要的,因為有方法可以"
"做邏輯分支(以 Python 來說,用 :keyword:`if` 陳述式和 :keyword:`or`、:"
"keyword:`and` 及 :keyword:`if`/:keyword:`else` 運算式)和迴圈(用 :keyword:"
"`while` 和 :keyword:`for` 陳述式,可能會有 :keyword:`continue` 和 :keyword:"
"`break`)。"
"做邏輯分支(以 Python 來說,用 :keyword:`if` 陳述式"
"和 :keyword:`or`、:keyword:`and` 及 :keyword:`if`/:keyword:`else` 運算式)"
"迴圈(用 :keyword:`while` 和 :keyword:`for` 陳述式,可能會"
"有 :keyword:`continue` 和 :keyword:`break`)。"

#: ../../faq/design.rst:614
msgid ""
Expand Down Expand Up @@ -1437,14 +1440,14 @@ msgstr "為何產生器 (generator) 不支援 with 陳述式?"
msgid ""
"For technical reasons, a generator used directly as a context manager would "
"not work correctly. When, as is most common, a generator is used as an "
"iterator run to completion, no closing is needed. When it is, wrap it as :"
"func:`contextlib.closing(generator) <contextlib.closing>` in the :keyword:"
"`with` statement."
"iterator run to completion, no closing is needed. When it is, wrap it "
"as :func:`contextlib.closing(generator) <contextlib.closing>` in "
"the :keyword:`with` statement."
msgstr ""
"出於技術原因,把產生器直接用作情境 (context) 管理器會無法正常運作。因為通常來"
"說,產生器是被當成疊代器 (iterator),到最後完成時不需要被手動關閉。但如果你需"
"要的話,你可以在 :keyword:`with` 陳述式裡用 :func:`contextlib."
"closing(generator) <contextlib.closing>` 來包裝他。"
"要的話,你可以在 :keyword:`with` 陳述式裡"
"用 :func:`contextlib.closing(generator) <contextlib.closing>` 來包裝他。"

#: ../../faq/design.rst:730
msgid "Why are colons required for the if/while/def/class statements?"
Expand Down
2 changes: 1 addition & 1 deletion library/calendar.po
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ msgid ""
"Aliases for the months of the year, where ``JANUARY`` is ``1`` and "
"``DECEMBER`` is ``12``."
msgstr ""
"一年內每個月的別名,其中 ``JANUARY`` 是 ```` 而 ``DECEMBER`` 是 ``12``。"
"一年內每個月的別名,其中 ``JANUARY`` 是 ``1`` 而 ``DECEMBER`` 是 ``12``。"

#: ../../library/calendar.rst:531
msgid ""
Expand Down
2 changes: 1 addition & 1 deletion library/doctest.po
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ msgstr ""
msgid ""
"To perform regression testing by verifying that interactive examples from a "
"test file or a test object work as expected."
msgstr ""
msgstr "透過驗證測試檔案或測試物件中的互動式範例是否按預期運作來執行迴歸測試。"

#: ../../library/doctest.rst:26
msgid ""
Expand Down
2 changes: 1 addition & 1 deletion library/functions.po
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ msgstr ""
"(或兩者都為零),則會呼叫與 :func:`compile` 相同旗標的程式碼來編譯。如果給"
"定 *flags* 引數而未給定 *dont_inherit*(或為零)則無論如何都會使用由 *flags* "
"引數所指定的編譯器選項和未來陳述式。如果 *dont_inherit* 是一個非零整數,則使"
"用 *flags* 引數 -- 周圍程式碼中的旗標(未來功能和編譯器選項)將被忽略。"
"用 *flags* 引數 -- 周圍程式碼中的旗標(未來功能和編譯器選項)將被忽略。"

#: ../../library/functions.rst:325
msgid ""
Expand Down
2 changes: 1 addition & 1 deletion library/pickle.po
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ msgstr ""
"``pickle.find_class``。"

# SkyLull: [T]
# 參見 729
# 參見 #729
# wrapper -> 包裝器
#: ../../library/pickle.rst:472
msgid ""
Expand Down
Loading

0 comments on commit bc3c310

Please sign in to comment.