Skip to content

Translate library/decimal.po - Complete translation of all major sections #1102

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

Open
wants to merge 17 commits into
base: 3.13
Choose a base branch
from
Open
Changes from 2 commits
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
45 changes: 43 additions & 2 deletions library/decimal.po
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,16 @@ msgstr ""

#: ../../library/decimal.rst:125
msgid "Quick-start tutorial"
msgstr ""
msgstr "快速入門教學"

#: ../../library/decimal.rst:127
msgid ""
"The usual start to using decimals is importing the module, viewing the "
"current context with :func:`getcontext` and, if necessary, setting new "
"values for precision, rounding, or enabled traps::"
msgstr ""
"使用 decimal 的通常起始步驟是匯入模組、使用 :func:`getcontext` 檢視目前的上下文,"
"以及若有必要的話,設定精度、捨入方式或啟用陷阱的新值::"

#: ../../library/decimal.rst:131
msgid ""
Expand All @@ -166,6 +168,13 @@ msgid ""
"\n"
">>> getcontext().prec = 7 # Set a new precision"
msgstr ""
">>> from decimal import *\n"
">>> getcontext()\n"
"Context(prec=28, rounding=ROUND_HALF_EVEN, Emin=-999999, Emax=999999,\n"
" capitals=1, clamp=0, flags=[], traps=[Overflow, DivisionByZero,\n"
" InvalidOperation])\n"
"\n"
">>> getcontext().prec = 7 # 設定新的精度"

#: ../../library/decimal.rst:139
msgid ""
Expand All @@ -175,6 +184,9 @@ msgid ""
"values such as ``NaN`` which stands for \"Not a number\", positive and "
"negative ``Infinity``, and ``-0``::"
msgstr ""
"Decimal 實例可以從整數、字串、浮點數或元組建構。從整數或浮點數建構會執行該整數"
"或浮點數值的精確轉換。Decimal 數字包含特殊值,例如代表「非數字」的 ``NaN``、"
"正負 ``Infinity``,以及 ``-0``::"

#: ../../library/decimal.rst:145
msgid ""
Expand Down Expand Up @@ -213,13 +225,32 @@ msgstr ""
"Decimal('NaN')\n"
">>> Decimal('-Infinity')\n"
"Decimal('-Infinity')"
">>> getcontext().prec = 28\n"
">>> Decimal(10)\n"
"Decimal('10')\n"
">>> Decimal('3.14')\n"
"Decimal('3.14')\n"
">>> Decimal(3.14)\n"
"Decimal('3.140000000000000124344978758017532527446746826171875')\n"
">>> Decimal((0, (3, 1, 4), -2))\n"
"Decimal('3.14')\n"
">>> Decimal(str(2.0 ** 0.5))\n"
"Decimal('1.4142135623730951')\n"
">>> Decimal(2) ** Decimal('0.5')\n"
"Decimal('1.414213562373095048801688724')\n"
">>> Decimal('NaN')\n"
"Decimal('NaN')\n"
">>> Decimal('-Infinity')\n"
"Decimal('-Infinity')"

#: ../../library/decimal.rst:163
msgid ""
"If the :exc:`FloatOperation` signal is trapped, accidental mixing of "
"decimals and floats in constructors or ordering comparisons raises an "
"exception::"
msgstr ""
"如果 :exc:`FloatOperation` 信號被捕捉,在建構函式或排序比較中意外混用 decimal "
"和 float 會引發例外::"

#: ../../library/decimal.rst:167
msgid ""
Expand Down Expand Up @@ -255,6 +286,8 @@ msgid ""
"digits input. Context precision and rounding only come into play during "
"arithmetic operations."
msgstr ""
"新 Decimal 的精度僅由輸入的數字位數決定。上下文精度和捨入只會在算術運算期間"
"發揮作用。"

#: ../../library/decimal.rst:186
msgid ""
Expand Down Expand Up @@ -285,6 +318,7 @@ msgid ""
"If the internal limits of the C version are exceeded, constructing a decimal "
"raises :class:`InvalidOperation`::"
msgstr ""
"如果超過 C 版本的內部限制,建構 decimal 會引發 :class:`InvalidOperation`::"

#: ../../library/decimal.rst:202
msgid ""
Expand All @@ -303,6 +337,7 @@ msgid ""
"Decimals interact well with much of the rest of Python. Here is a small "
"decimal floating-point flying circus:"
msgstr ""
"Decimal 與 Python 的其他部分互動良好。以下是一個小小的 decimal 浮點數展示:"

#: ../../library/decimal.rst:212
msgid ""
Expand Down Expand Up @@ -360,28 +395,34 @@ msgstr ""

#: ../../library/decimal.rst:241
msgid "And some mathematical functions are also available to Decimal:"
msgstr ""
msgstr "而且 Decimal 也提供一些數學函式:"

#: ../../library/decimal.rst:253
msgid ""
"The :meth:`~Decimal.quantize` method rounds a number to a fixed exponent. "
"This method is useful for monetary applications that often round results to "
"a fixed number of places:"
msgstr ""
":meth:`~Decimal.quantize` 方法將數字捨入到固定的指數。此方法對於經常將結果捨入"
"到固定位數的金融應用程式很有用:"

#: ../../library/decimal.rst:262
msgid ""
"As shown above, the :func:`getcontext` function accesses the current context "
"and allows the settings to be changed. This approach meets the needs of "
"most applications."
msgstr ""
"如上所示,:func:`getcontext` 函式存取目前的上下文並允許變更設定。這種方法滿足"
"大多數應用程式的需求。"

#: ../../library/decimal.rst:266
msgid ""
"For more advanced work, it may be useful to create alternate contexts using "
"the Context() constructor. To make an alternate active, use the :func:"
"`setcontext` function."
msgstr ""
"對於更進階的工作,使用 Context() 建構函式建立替代上下文可能會很有用。要使替代"
"上下文作用,請使用 :func:`setcontext` 函式。"

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