Skip to content
Open
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Complete translation of all major decimal.po sections
Co-authored-by: josix <[email protected]>
  • Loading branch information
Copilot and josix committed Jul 12, 2025
commit 13de57fed86d75f963e30c5c1a3290684acec6bf
39 changes: 30 additions & 9 deletions library/decimal.po
Original file line number Diff line number Diff line change
Expand Up @@ -1394,28 +1394,32 @@ msgstr ""

#: ../../library/decimal.rst:962
msgid "Context objects"
msgstr ""
msgstr "Context 物件"

#: ../../library/decimal.rst:964
msgid ""
"Contexts are environments for arithmetic operations. They govern precision, "
"set rules for rounding, determine which signals are treated as exceptions, "
"and limit the range for exponents."
msgstr ""
"Context 是算術運算的環境。它們控制精度、設定捨入規則、決定哪些信號被視為例外,"
"並限制指數的範圍。"

#: ../../library/decimal.rst:968
msgid ""
"Each thread has its own current context which is accessed or changed using "
"the :func:`getcontext` and :func:`setcontext` functions:"
msgstr ""
"每個執行緒都有自己的目前上下文,可以使用 :func:`getcontext` 和 :func:"
"`setcontext` 函式來存取或變更:"

#: ../../library/decimal.rst:974
msgid "Return the current context for the active thread."
msgstr ""
msgstr "回傳作用中執行緒的目前上下文。"

#: ../../library/decimal.rst:979
msgid "Set the current context for the active thread to *c*."
msgstr ""
msgstr "將作用中執行緒的目前上下文設定為 *c*。"

#: ../../library/decimal.rst:981
msgid ""
Expand Down Expand Up @@ -2030,6 +2034,7 @@ msgid ""
"The constants in this section are only relevant for the C module. They are "
"also included in the pure Python version for compatibility."
msgstr ""
"本節中的常數僅與 C 模組相關。為了相容性,它們也包含在純 Python 版本中。"

#: ../../library/decimal.rst:1551
msgid "32-bit"
Expand Down Expand Up @@ -2117,13 +2122,15 @@ msgstr ""

#: ../../library/decimal.rst:1619
msgid "Signals"
msgstr ""
msgstr "信號"

#: ../../library/decimal.rst:1621
msgid ""
"Signals represent conditions that arise during computation. Each corresponds "
"to one context flag and one context trap enabler."
msgstr ""
"信號代表在計算過程中產生的條件。每個信號對應一個上下文旗標和一個上下文陷阱"
"啟用器。"

#: ../../library/decimal.rst:1624
msgid ""
Expand All @@ -2132,6 +2139,8 @@ msgid ""
"to determine whether a computation was exact). After checking the flags, be "
"sure to clear all flags before starting the next computation."
msgstr ""
"每當遇到條件時,上下文旗標就會被設定。計算後,可以檢查旗標以獲取資訊(例如,"
"確定計算是否精確)。檢查旗標後,請確保在開始下一次計算之前清除所有旗標。"

#: ../../library/decimal.rst:1629
msgid ""
Expand All @@ -2140,6 +2149,9 @@ msgid ""
"`DivisionByZero` trap is set, then a :exc:`DivisionByZero` exception is "
"raised upon encountering the condition."
msgstr ""
"如果為信號設定了上下文的陷阱啟用器,那麼條件會導致引發 Python 例外。例如,"
"如果設定了 :class:`DivisionByZero` 陷阱,那麼在遇到條件時會引發 :exc:"
"`DivisionByZero` 例外。"

#: ../../library/decimal.rst:1637
msgid "Altered an exponent to fit representation constraints."
Expand Down Expand Up @@ -2308,11 +2320,11 @@ msgstr ""

#: ../../library/decimal.rst:1759
msgid "Floating-point notes"
msgstr ""
msgstr "浮點數注意事項"

#: ../../library/decimal.rst:1763
msgid "Mitigating round-off error with increased precision"
msgstr ""
msgstr "透過增加精度來減輕捨入誤差"

#: ../../library/decimal.rst:1765
msgid ""
Expand All @@ -2321,6 +2333,8 @@ msgid ""
"can still incur round-off error when non-zero digits exceed the fixed "
"precision."
msgstr ""
"使用十進位浮點數消除了十進位表示誤差(使得可以精確表示 ``0.1``);然而,當"
"非零數字超過固定精度時,某些運算仍然可能產生捨入誤差。"

#: ../../library/decimal.rst:1769
msgid ""
Expand Down Expand Up @@ -2453,7 +2467,7 @@ msgstr ""

#: ../../library/decimal.rst:1873
msgid "Working with threads"
msgstr ""
msgstr "與執行緒協作"

#: ../../library/decimal.rst:1875
msgid ""
Expand All @@ -2462,19 +2476,25 @@ msgid ""
"make changes (such as ``getcontext().prec=10``) without interfering with "
"other threads."
msgstr ""
":func:`getcontext` 函式為每個執行緒存取不同的 :class:`Context` 物件。擁有獨立"
"的執行緒上下文意味著執行緒可以進行變更(如 ``getcontext().prec=10``)而不會"
"干擾其他執行緒。"

#: ../../library/decimal.rst:1879
msgid ""
"Likewise, the :func:`setcontext` function automatically assigns its target "
"to the current thread."
msgstr ""
"同樣地,:func:`setcontext` 函式會自動將其目標指派給目前執行緒。"

#: ../../library/decimal.rst:1882
msgid ""
"If :func:`setcontext` has not been called before :func:`getcontext`, then :"
"func:`getcontext` will automatically create a new context for use in the "
"current thread."
msgstr ""
"如果在 :func:`getcontext` 之前沒有呼叫 :func:`setcontext`,那麼 :func:"
"`getcontext` 會自動建立一個新的上下文供目前執行緒使用。"

#: ../../library/decimal.rst:1886
msgid ""
Expand Down Expand Up @@ -2503,13 +2523,14 @@ msgstr ""

#: ../../library/decimal.rst:1911
msgid "Recipes"
msgstr ""
msgstr "實用範例"

#: ../../library/decimal.rst:1913
msgid ""
"Here are a few recipes that serve as utility functions and that demonstrate "
"ways to work with the :class:`Decimal` class::"
msgstr ""
"以下是一些實用範例,作為工具函式並展示與 :class:`Decimal` 類別協作的方法::"

#: ../../library/decimal.rst:1916
msgid ""
Expand Down Expand Up @@ -2662,7 +2683,7 @@ msgstr ""

#: ../../library/decimal.rst:2068
msgid "Decimal FAQ"
msgstr ""
msgstr "Decimal 常見問題"

#: ../../library/decimal.rst:2070
msgid ""
Expand Down