From 15e4f5bd351f74db2349417276c40714fe97bfec Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 15 Dec 2024 00:18:28 +0000 Subject: [PATCH] sync with cpython 9c6bd272 --- library/string.po | 260 ++++++++++++++++++++++++---------------------- 1 file changed, 133 insertions(+), 127 deletions(-) diff --git a/library/string.po b/library/string.po index 51e4f57db7..3a49d913a8 100644 --- a/library/string.po +++ b/library/string.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-03 00:15+0000\n" +"POT-Creation-Date: 2024-12-15 00:17+0000\n" "PO-Revision-Date: 2024-03-10 15:57+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -462,8 +462,8 @@ msgid "Option" msgstr "選項" #: ../../library/string.rst:342 ../../library/string.rst:374 -#: ../../library/string.rst:457 ../../library/string.rst:468 -#: ../../library/string.rst:503 +#: ../../library/string.rst:459 ../../library/string.rst:470 +#: ../../library/string.rst:505 msgid "Meaning" msgstr "含義" @@ -579,16 +579,22 @@ msgid "" msgstr "" #: ../../library/string.rst:412 +#, fuzzy msgid "" -"The ``','`` option signals the use of a comma for a thousands separator. For " -"a locale aware separator, use the ``'n'`` integer presentation type instead." +"The ``','`` option signals the use of a comma for a thousands separator for " +"floating-point presentation types and for integer presentation type ``'d'``. " +"For other presentation types, this option is an error. For a locale aware " +"separator, use the ``'n'`` integer presentation type instead." msgstr "" +"``'_'`` 選項表示對於浮點表示型別和整數表示型別 ``'d'`` 使用底線作為千位分隔符" +"號。對於整數表示型別 ``'b'``,``'o'``,``'x'`` 和 ``'X'``,每 4 位數字會插入" +"底線。對於其他表示型別,指定此選項會出錯。" -#: ../../library/string.rst:416 +#: ../../library/string.rst:418 msgid "Added the ``','`` option (see also :pep:`378`)." msgstr "新增 ``','`` 選項(請見 :pep:`378`\\ )。" -#: ../../library/string.rst:421 +#: ../../library/string.rst:423 msgid "" "The ``'_'`` option signals the use of an underscore for a thousands " "separator for floating-point presentation types and for integer presentation " @@ -600,11 +606,11 @@ msgstr "" "號。對於整數表示型別 ``'b'``,``'o'``,``'x'`` 和 ``'X'``,每 4 位數字會插入" "底線。對於其他表示型別,指定此選項會出錯。" -#: ../../library/string.rst:428 +#: ../../library/string.rst:430 msgid "Added the ``'_'`` option (see also :pep:`515`)." msgstr "新增 ``'_'`` 選項(請見 :pep:`515`\\ )。" -#: ../../library/string.rst:431 +#: ../../library/string.rst:433 msgid "" "*width* is a decimal integer defining the minimum total field width, " "including any prefixes, separators, and other formatting characters. If not " @@ -613,7 +619,7 @@ msgstr "" "*width* 是一個十進位整數,定義了最小總欄位寬度,包括任何前綴、分隔符號和其他" "格式字元。如果未指定,則欄位寬度將由內容決定。" -#: ../../library/string.rst:435 +#: ../../library/string.rst:437 msgid "" "When no explicit alignment is given, preceding the *width* field by a zero " "(``'0'``) character enables sign-aware zero-padding for numeric types, " @@ -624,13 +630,13 @@ msgstr "" "class:`complex` 以外的數值型別啟用有符號察覺的零填充 (sign-aware zero-" "padding)。這相當於使用 ``'0'`` 為 *fill* 字元且對齊類型為 ``'='``。" -#: ../../library/string.rst:440 +#: ../../library/string.rst:442 msgid "" "Preceding the *width* field by ``'0'`` no longer affects the default " "alignment for strings." msgstr "在 *width* 欄位前面加上 ``'0'`` 不再影響字串的預設對齊方式。" -#: ../../library/string.rst:444 +#: ../../library/string.rst:446 msgid "" "The *precision* is a decimal integer indicating how many digits should be " "displayed after the decimal point for presentation types ``'f'`` and " @@ -645,89 +651,89 @@ msgstr "" "示類型,該欄位指定最大欄位大小 - 換言之,將使用欄位中的多少字元。整數表示類型" "不允許使用 *precision*。" -#: ../../library/string.rst:452 +#: ../../library/string.rst:454 msgid "Finally, the *type* determines how the data should be presented." msgstr "最終,型別決定了資料將會如何呈現" -#: ../../library/string.rst:454 +#: ../../library/string.rst:456 msgid "The available string presentation types are:" msgstr "可用的字串表示型別有:" -#: ../../library/string.rst:457 ../../library/string.rst:468 -#: ../../library/string.rst:503 +#: ../../library/string.rst:459 ../../library/string.rst:470 +#: ../../library/string.rst:505 msgid "Type" msgstr "型別" -#: ../../library/string.rst:459 +#: ../../library/string.rst:461 msgid "``'s'``" msgstr "``'s'``" -#: ../../library/string.rst:459 +#: ../../library/string.rst:461 msgid "String format. This is the default type for strings and may be omitted." msgstr "" -#: ../../library/string.rst:462 ../../library/string.rst:491 -#: ../../library/string.rst:576 +#: ../../library/string.rst:464 ../../library/string.rst:493 +#: ../../library/string.rst:578 msgid "None" msgstr "None" -#: ../../library/string.rst:462 +#: ../../library/string.rst:464 msgid "The same as ``'s'``." msgstr "" -#: ../../library/string.rst:465 +#: ../../library/string.rst:467 msgid "The available integer presentation types are:" msgstr "" -#: ../../library/string.rst:470 +#: ../../library/string.rst:472 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/string.rst:470 +#: ../../library/string.rst:472 msgid "Binary format. Outputs the number in base 2." msgstr "" -#: ../../library/string.rst:472 +#: ../../library/string.rst:474 msgid "``'c'``" msgstr "``'c'``" -#: ../../library/string.rst:472 +#: ../../library/string.rst:474 msgid "" "Character. Converts the integer to the corresponding unicode character " "before printing." msgstr "" -#: ../../library/string.rst:475 +#: ../../library/string.rst:477 msgid "``'d'``" msgstr "``'d'``" -#: ../../library/string.rst:475 +#: ../../library/string.rst:477 msgid "Decimal Integer. Outputs the number in base 10." msgstr "" -#: ../../library/string.rst:477 +#: ../../library/string.rst:479 msgid "``'o'``" msgstr "``'o'``" -#: ../../library/string.rst:477 +#: ../../library/string.rst:479 msgid "Octal format. Outputs the number in base 8." msgstr "" -#: ../../library/string.rst:479 +#: ../../library/string.rst:481 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/string.rst:479 +#: ../../library/string.rst:481 msgid "" "Hex format. Outputs the number in base 16, using lower-case letters for the " "digits above 9." msgstr "十六進位格式。輸出以 16 為基數的數字,9 以上的數字使用小寫字母。" -#: ../../library/string.rst:482 +#: ../../library/string.rst:484 msgid "``'X'``" msgstr "``'X'``" -#: ../../library/string.rst:482 +#: ../../library/string.rst:484 msgid "" "Hex format. Outputs the number in base 16, using upper-case letters for the " "digits above 9. In case ``'#'`` is specified, the prefix ``'0x'`` will be " @@ -736,21 +742,21 @@ msgstr "" "十六進位格式。輸出以 16 為基數的數字,9 以上的數字使用大寫字母。如果指定了 " "``'#'``,則前綴 ``'0x'`` 也會被轉成大寫的 ``'0X'``。" -#: ../../library/string.rst:487 ../../library/string.rst:569 +#: ../../library/string.rst:489 ../../library/string.rst:571 msgid "``'n'``" msgstr "``'n'``" -#: ../../library/string.rst:487 +#: ../../library/string.rst:489 msgid "" "Number. This is the same as ``'d'``, except that it uses the current locale " "setting to insert the appropriate number separator characters." msgstr "" -#: ../../library/string.rst:491 +#: ../../library/string.rst:493 msgid "The same as ``'d'``." msgstr "" -#: ../../library/string.rst:494 +#: ../../library/string.rst:496 msgid "" "In addition to the above presentation types, integers can be formatted with " "the floating-point presentation types listed below (except ``'n'`` and " @@ -758,17 +764,17 @@ msgid "" "floating-point number before formatting." msgstr "" -#: ../../library/string.rst:499 +#: ../../library/string.rst:501 msgid "" "The available presentation types for :class:`float` and :class:`~decimal." "Decimal` values are:" msgstr "" -#: ../../library/string.rst:505 +#: ../../library/string.rst:507 msgid "``'e'``" msgstr "``'e'``" -#: ../../library/string.rst:505 +#: ../../library/string.rst:507 msgid "" "Scientific notation. For a given precision ``p``, formats the number in " "scientific notation with the letter 'e' separating the coefficient from the " @@ -780,21 +786,21 @@ msgid "" "is used." msgstr "" -#: ../../library/string.rst:516 +#: ../../library/string.rst:518 msgid "``'E'``" msgstr "``'E'``" -#: ../../library/string.rst:516 +#: ../../library/string.rst:518 msgid "" "Scientific notation. Same as ``'e'`` except it uses an upper case 'E' as the " "separator character." msgstr "" -#: ../../library/string.rst:519 +#: ../../library/string.rst:521 msgid "``'f'``" msgstr "``'f'``" -#: ../../library/string.rst:519 +#: ../../library/string.rst:521 msgid "" "Fixed-point notation. For a given precision ``p``, formats the number as a " "decimal number with exactly ``p`` digits following the decimal point. With " @@ -804,21 +810,21 @@ msgid "" "point is omitted unless the ``#`` option is used." msgstr "" -#: ../../library/string.rst:528 +#: ../../library/string.rst:530 msgid "``'F'``" msgstr "``'F'``" -#: ../../library/string.rst:528 +#: ../../library/string.rst:530 msgid "" "Fixed-point notation. Same as ``'f'``, but converts ``nan`` to ``NAN`` and " "``inf`` to ``INF``." msgstr "" -#: ../../library/string.rst:531 +#: ../../library/string.rst:533 msgid "``'g'``" msgstr "``'g'``" -#: ../../library/string.rst:531 +#: ../../library/string.rst:533 msgid "" "General format. For a given precision ``p >= 1``, this rounds the number to " "``p`` significant digits and then formats the result in either fixed-point " @@ -826,7 +832,7 @@ msgid "" "``0`` is treated as equivalent to a precision of ``1``." msgstr "" -#: ../../library/string.rst:538 +#: ../../library/string.rst:540 msgid "" "The precise rules are as follows: suppose that the result formatted with " "presentation type ``'e'`` and precision ``p-1`` would have exponent " @@ -839,7 +845,7 @@ msgid "" "unless the ``'#'`` option is used." msgstr "" -#: ../../library/string.rst:551 +#: ../../library/string.rst:553 msgid "" "With no precision given, uses a precision of ``6`` significant digits for :" "class:`float`. For :class:`~decimal.Decimal`, the coefficient of the result " @@ -849,40 +855,40 @@ msgid "" "notation is used otherwise." msgstr "" -#: ../../library/string.rst:560 +#: ../../library/string.rst:562 msgid "" "Positive and negative infinity, positive and negative zero, and nans, are " "formatted as ``inf``, ``-inf``, ``0``, ``-0`` and ``nan`` respectively, " "regardless of the precision." msgstr "" -#: ../../library/string.rst:565 +#: ../../library/string.rst:567 msgid "``'G'``" msgstr "``'G'``" -#: ../../library/string.rst:565 +#: ../../library/string.rst:567 msgid "" "General format. Same as ``'g'`` except switches to ``'E'`` if the number " "gets too large. The representations of infinity and NaN are uppercased, too." msgstr "" -#: ../../library/string.rst:569 +#: ../../library/string.rst:571 msgid "" "Number. This is the same as ``'g'``, except that it uses the current locale " "setting to insert the appropriate number separator characters." msgstr "" -#: ../../library/string.rst:573 +#: ../../library/string.rst:575 msgid "``'%'``" msgstr "``'%'``" -#: ../../library/string.rst:573 +#: ../../library/string.rst:575 msgid "" "Percentage. Multiplies the number by 100 and displays in fixed (``'f'``) " "format, followed by a percent sign." msgstr "" -#: ../../library/string.rst:576 +#: ../../library/string.rst:578 msgid "" "For :class:`float` this is like the ``'g'`` type, except that when fixed-" "point notation is used to format the result, it always includes at least one " @@ -891,20 +897,20 @@ msgid "" "as large as needed to represent the given value faithfully." msgstr "" -#: ../../library/string.rst:584 +#: ../../library/string.rst:586 msgid "" "For :class:`~decimal.Decimal`, this is the same as either ``'g'`` or ``'G'`` " "depending on the value of ``context.capitals`` for the current decimal " "context." msgstr "" -#: ../../library/string.rst:588 +#: ../../library/string.rst:590 msgid "" "The overall effect is to match the output of :func:`str` as altered by the " "other format modifiers." msgstr "" -#: ../../library/string.rst:592 +#: ../../library/string.rst:594 msgid "" "The result should be correctly rounded to a given precision ``p`` of digits " "after the decimal point. The rounding mode for :class:`float` matches that " @@ -912,7 +918,7 @@ msgid "" "mode of the current :ref:`context ` will be used." msgstr "" -#: ../../library/string.rst:597 +#: ../../library/string.rst:599 msgid "" "The available presentation types for :class:`complex` are the same as those " "for :class:`float` (``'%'`` is not allowed). Both the real and imaginary " @@ -924,17 +930,17 @@ msgid "" "surrounded by parentheses), possibly altered by other format modifiers." msgstr "" -#: ../../library/string.rst:610 +#: ../../library/string.rst:612 msgid "Format examples" msgstr "格式範例" -#: ../../library/string.rst:612 +#: ../../library/string.rst:614 msgid "" "This section contains examples of the :meth:`str.format` syntax and " "comparison with the old ``%``-formatting." msgstr "本節包含 :meth:`str.format` 語法以及與舊式 ``%`` 格式的比較。" -#: ../../library/string.rst:615 +#: ../../library/string.rst:617 msgid "" "In most of the cases the syntax is similar to the old ``%``-formatting, with " "the addition of the ``{}`` and with ``:`` used instead of ``%``. For " @@ -943,17 +949,17 @@ msgstr "" "此語法在大多情況下與舊式的 ``%`` 格式類似,只是增加了 ``{}`` 和 ``:`` 來取代 " "``%``。例如,``'%03.2f'`` 可以改寫為 ``'{:03.2f}'``。" -#: ../../library/string.rst:619 +#: ../../library/string.rst:621 msgid "" "The new format syntax also supports new and different options, shown in the " "following examples." msgstr "新的語法還支援新的選項,將在以下的範例中說明。" -#: ../../library/string.rst:622 +#: ../../library/string.rst:624 msgid "Accessing arguments by position::" msgstr "按位置存取引數: ::" -#: ../../library/string.rst:624 +#: ../../library/string.rst:626 msgid "" ">>> '{0}, {1}, {2}'.format('a', 'b', 'c')\n" "'a, b, c'\n" @@ -968,11 +974,11 @@ msgid "" "'abracadabra'" msgstr "" -#: ../../library/string.rst:635 +#: ../../library/string.rst:637 msgid "Accessing arguments by name::" msgstr "按名稱存取引數: ::" -#: ../../library/string.rst:637 +#: ../../library/string.rst:639 msgid "" ">>> 'Coordinates: {latitude}, {longitude}'.format(latitude='37.24N', " "longitude='-115.81W')\n" @@ -982,11 +988,11 @@ msgid "" "'Coordinates: 37.24N, -115.81W'" msgstr "" -#: ../../library/string.rst:643 +#: ../../library/string.rst:645 msgid "Accessing arguments' attributes::" msgstr "存取引數的屬性: ::" -#: ../../library/string.rst:645 +#: ../../library/string.rst:647 msgid "" ">>> c = 3-5j\n" ">>> ('The complex number {0} is formed from the real part {0.real} '\n" @@ -1003,22 +1009,22 @@ msgid "" "'Point(4, 2)'" msgstr "" -#: ../../library/string.rst:658 +#: ../../library/string.rst:660 msgid "Accessing arguments' items::" msgstr "存取引數的內容: ::" -#: ../../library/string.rst:660 +#: ../../library/string.rst:662 msgid "" ">>> coord = (3, 5)\n" ">>> 'X: {0[0]}; Y: {0[1]}'.format(coord)\n" "'X: 3; Y: 5'" msgstr "" -#: ../../library/string.rst:664 +#: ../../library/string.rst:666 msgid "Replacing ``%s`` and ``%r``::" msgstr "替換 ``%s`` 和 ``%r``: ::" -#: ../../library/string.rst:666 +#: ../../library/string.rst:668 msgid "" ">>> \"repr() shows quotes: {!r}; str() doesn't: {!s}\".format('test1', " "'test2')\n" @@ -1028,11 +1034,11 @@ msgstr "" "'test2')\n" "\"repr() shows quotes: 'test1'; str() doesn't: test2\"" -#: ../../library/string.rst:669 +#: ../../library/string.rst:671 msgid "Aligning the text and specifying a width::" msgstr "對齊文字以及指定寬度: ::" -#: ../../library/string.rst:671 +#: ../../library/string.rst:673 msgid "" ">>> '{:<30}'.format('left aligned')\n" "'left aligned '\n" @@ -1044,11 +1050,11 @@ msgid "" "'***********centered***********'" msgstr "" -#: ../../library/string.rst:680 +#: ../../library/string.rst:682 msgid "Replacing ``%+f``, ``%-f``, and ``% f`` and specifying a sign::" msgstr "替換 ``%+f``、``%-f`` 和 ``% f`` 以及指定正負號: ::" -#: ../../library/string.rst:682 +#: ../../library/string.rst:684 msgid "" ">>> '{:+f}; {:+f}'.format(3.14, -3.14) # show it always\n" "'+3.140000; -3.140000'\n" @@ -1059,12 +1065,12 @@ msgid "" "'3.140000; -3.140000'" msgstr "" -#: ../../library/string.rst:689 +#: ../../library/string.rst:691 msgid "" "Replacing ``%x`` and ``%o`` and converting the value to different bases::" msgstr "替換 ``%x`` 和 ``%o`` 並將其值轉換為不同的進位制: ::" -#: ../../library/string.rst:691 +#: ../../library/string.rst:693 msgid "" ">>> # format also supports binary numbers\n" ">>> \"int: {0:d}; hex: {0:x}; oct: {0:o}; bin: {0:b}\".format(42)\n" @@ -1074,11 +1080,11 @@ msgid "" "'int: 42; hex: 0x2a; oct: 0o52; bin: 0b101010'" msgstr "" -#: ../../library/string.rst:698 +#: ../../library/string.rst:700 msgid "Using the comma as a thousands separator::" msgstr "使用逗號作為千位分隔符: ::" -#: ../../library/string.rst:700 +#: ../../library/string.rst:702 msgid "" ">>> '{:,}'.format(1234567890)\n" "'1,234,567,890'" @@ -1086,11 +1092,11 @@ msgstr "" ">>> '{:,}'.format(1234567890)\n" "'1,234,567,890'" -#: ../../library/string.rst:703 +#: ../../library/string.rst:705 msgid "Expressing a percentage::" msgstr "表示為百分比: ::" -#: ../../library/string.rst:705 +#: ../../library/string.rst:707 msgid "" ">>> points = 19\n" ">>> total = 22\n" @@ -1102,11 +1108,11 @@ msgstr "" ">>> 'Correct answers: {:.2%}'.format(points/total)\n" "'Correct answers: 86.36%'" -#: ../../library/string.rst:710 +#: ../../library/string.rst:712 msgid "Using type-specific formatting::" msgstr "作為特定型別格式: ::" -#: ../../library/string.rst:712 +#: ../../library/string.rst:714 msgid "" ">>> import datetime\n" ">>> d = datetime.datetime(2010, 7, 4, 12, 15, 58)\n" @@ -1118,11 +1124,11 @@ msgstr "" ">>> '{:%Y-%m-%d %H:%M:%S}'.format(d)\n" "'2010-07-04 12:15:58'" -#: ../../library/string.rst:717 +#: ../../library/string.rst:719 msgid "Nesting arguments and more complex examples::" msgstr "巢狀引數及更多複雜範例: ::" -#: ../../library/string.rst:719 +#: ../../library/string.rst:721 msgid "" ">>> for align, text in zip('<^>', ['left', 'center', 'right']):\n" "... '{0:{fill}{align}16}'.format(text, fill=align, align=align)\n" @@ -1180,11 +1186,11 @@ msgstr "" " 10 A 12 1010\n" " 11 B 13 1011" -#: ../../library/string.rst:751 +#: ../../library/string.rst:753 msgid "Template strings" msgstr "模板字串" -#: ../../library/string.rst:753 +#: ../../library/string.rst:755 msgid "" "Template strings provide simpler string substitutions as described in :pep:" "`292`. A primary use case for template strings is for internationalization " @@ -1198,17 +1204,17 @@ msgstr "" "化工具更容易翻譯。基於模板字串建構的 i18n 函式庫範例,請參閱 `flufl.i18n " "`_ 套件。" -#: ../../library/string.rst:763 +#: ../../library/string.rst:765 msgid "" "Template strings support ``$``-based substitutions, using the following " "rules:" msgstr "" -#: ../../library/string.rst:765 +#: ../../library/string.rst:767 msgid "``$$`` is an escape; it is replaced with a single ``$``." msgstr "" -#: ../../library/string.rst:767 +#: ../../library/string.rst:769 msgid "" "``$identifier`` names a substitution placeholder matching a mapping key of " "``\"identifier\"``. By default, ``\"identifier\"`` is restricted to any " @@ -1218,30 +1224,30 @@ msgid "" "specification." msgstr "" -#: ../../library/string.rst:774 +#: ../../library/string.rst:776 msgid "" "``${identifier}`` is equivalent to ``$identifier``. It is required when " "valid identifier characters follow the placeholder but are not part of the " "placeholder, such as ``\"${noun}ification\"``." msgstr "" -#: ../../library/string.rst:778 +#: ../../library/string.rst:780 msgid "" "Any other appearance of ``$`` in the string will result in a :exc:" "`ValueError` being raised." msgstr "" -#: ../../library/string.rst:781 +#: ../../library/string.rst:783 msgid "" "The :mod:`string` module provides a :class:`Template` class that implements " "these rules. The methods of :class:`Template` are:" msgstr "" -#: ../../library/string.rst:787 +#: ../../library/string.rst:789 msgid "The constructor takes a single argument which is the template string." msgstr "" -#: ../../library/string.rst:792 +#: ../../library/string.rst:794 msgid "" "Performs the template substitution, returning a new string. *mapping* is " "any dictionary-like object with keys that match the placeholders in the " @@ -1253,7 +1259,7 @@ msgstr "" "的字典型物件。或者如果關鍵字就是佔位符號時,你也可以改提供關鍵字引數。當 " "*mapping* 跟 *kwds* 同時給定並存在重複時,*kwds* 的佔位符號會被優先使用。" -#: ../../library/string.rst:801 +#: ../../library/string.rst:803 msgid "" "Like :meth:`substitute`, except that if placeholders are missing from " "*mapping* and *kwds*, instead of raising a :exc:`KeyError` exception, the " @@ -1266,7 +1272,7 @@ msgstr "" "與 :meth:`substitute` 不同的是,任何包含 ``$`` 的字句會直接回傳 ``$`` 而非引" "發 :exc:`ValueError`。" -#: ../../library/string.rst:807 +#: ../../library/string.rst:809 msgid "" "While other exceptions may still occur, this method is called \"safe\" " "because it always tries to return a usable string instead of raising an " @@ -1280,7 +1286,7 @@ msgstr "" "完全安全,因為它會默默忽略格式錯誤的模板,這些模板包含了多餘的左右定界符、不" "匹配的括號,或者不是有效的 Python 識別字的佔位符號。" -#: ../../library/string.rst:817 +#: ../../library/string.rst:819 msgid "" "Returns false if the template has invalid placeholders that will cause :meth:" "`substitute` to raise :exc:`ValueError`." @@ -1288,18 +1294,18 @@ msgstr "" "如果模板有將導致 :meth:`substitute` 引發 :exc:`ValueError` 的無效佔位符號,就" "會回傳 false。" -#: ../../library/string.rst:825 +#: ../../library/string.rst:827 msgid "" "Returns a list of the valid identifiers in the template, in the order they " "first appear, ignoring any invalid identifiers." msgstr "" "回傳模板中有效識別字的串列,按照它們首次出現的順序,並忽略任何無效的識別字。" -#: ../../library/string.rst:830 +#: ../../library/string.rst:832 msgid ":class:`Template` instances also provide one public data attribute:" msgstr ":class:`Template` 實例也提供一個公開的資料屬性:" -#: ../../library/string.rst:834 +#: ../../library/string.rst:836 msgid "" "This is the object passed to the constructor's *template* argument. In " "general, you shouldn't change it, but read-only access is not enforced." @@ -1307,11 +1313,11 @@ msgstr "" "這是傳遞給建構函式 *template* 引數的物件。一般來說,你不應該改變它,但並沒有" "強制設定成唯讀。" -#: ../../library/string.rst:837 +#: ../../library/string.rst:839 msgid "Here is an example of how to use a Template::" msgstr "以下是如何使用 Template 的一個範例: ::" -#: ../../library/string.rst:839 +#: ../../library/string.rst:841 msgid "" ">>> from string import Template\n" ">>> s = Template('$who likes $what')\n" @@ -1345,7 +1351,7 @@ msgstr "" ">>> Template('$who likes $what').safe_substitute(d)\n" "'tim likes $what'" -#: ../../library/string.rst:855 +#: ../../library/string.rst:857 msgid "" "Advanced usage: you can derive subclasses of :class:`Template` to customize " "the placeholder syntax, delimiter character, or the entire regular " @@ -1355,7 +1361,7 @@ msgstr "" "進階用法:你可以衍生 :class:`Template` 類別來自定義佔位符號語法、左右定界符字" "元,或者用於剖析模板字串的正規表示式。你可以透過覆寫這些類別屬性來達成:" -#: ../../library/string.rst:860 +#: ../../library/string.rst:862 msgid "" "*delimiter* -- This is the literal string describing a placeholder " "introducing delimiter. The default value is ``$``. Note that this should " @@ -1369,7 +1375,7 @@ msgstr "" "注意你不能在建立類別後修改左右定界符。(意即在子類別的命名空間中必須設置不同" "的左右定界符)" -#: ../../library/string.rst:867 +#: ../../library/string.rst:869 msgid "" "*idpattern* -- This is the regular expression describing the pattern for non-" "braced placeholders. The default value is the regular expression ``(?a:[_a-" @@ -1377,19 +1383,19 @@ msgid "" "pattern will also apply to braced placeholders." msgstr "" -#: ../../library/string.rst:874 +#: ../../library/string.rst:876 msgid "" "Since default *flags* is ``re.IGNORECASE``, pattern ``[a-z]`` can match with " "some non-ASCII characters. That's why we use the local ``a`` flag here." msgstr "" -#: ../../library/string.rst:878 +#: ../../library/string.rst:880 msgid "" "*braceidpattern* can be used to define separate patterns used inside and " "outside the braces." msgstr "" -#: ../../library/string.rst:882 +#: ../../library/string.rst:884 msgid "" "*braceidpattern* -- This is like *idpattern* but describes the pattern for " "braced placeholders. Defaults to ``None`` which means to fall back to " @@ -1398,7 +1404,7 @@ msgid "" "unbraced placeholders." msgstr "" -#: ../../library/string.rst:890 +#: ../../library/string.rst:892 msgid "" "*flags* -- The regular expression flags that will be applied when compiling " "the regular expression used for recognizing substitutions. The default " @@ -1407,7 +1413,7 @@ msgid "" "regular expressions." msgstr "" -#: ../../library/string.rst:898 +#: ../../library/string.rst:900 msgid "" "Alternatively, you can provide the entire regular expression pattern by " "overriding the class attribute *pattern*. If you do this, the value must be " @@ -1416,13 +1422,13 @@ msgid "" "placeholder rule:" msgstr "" -#: ../../library/string.rst:904 +#: ../../library/string.rst:906 msgid "" "*escaped* -- This group matches the escape sequence, e.g. ``$$``, in the " "default pattern." msgstr "*escaped* -- 此群組與跳脫序列匹配,例如在預設模式下為 ``$$``。" -#: ../../library/string.rst:907 +#: ../../library/string.rst:909 msgid "" "*named* -- This group matches the unbraced placeholder name; it should not " "include the delimiter in capturing group." @@ -1430,7 +1436,7 @@ msgstr "" "*named* -- 此群組與不帶大括號的佔位符號名稱匹配;它不應包含擷取群組中的左右定" "界符號。" -#: ../../library/string.rst:910 +#: ../../library/string.rst:912 msgid "" "*braced* -- This group matches the brace enclosed placeholder name; it " "should not include either the delimiter or braces in the capturing group." @@ -1438,7 +1444,7 @@ msgstr "" "*braced* -- 此群組與大括號括起來的佔位符號名稱匹配;它不應在擷取群組中包含左" "右定界符或大括號。" -#: ../../library/string.rst:913 +#: ../../library/string.rst:915 msgid "" "*invalid* -- This group matches any other delimiter pattern (usually a " "single delimiter), and it should appear last in the regular expression." @@ -1446,7 +1452,7 @@ msgstr "" "*invalid* -- 此群組與任何其他左右定界符模式(通常是單一左右定界符)匹配,且它" "應該出現在正規表示式的最後。" -#: ../../library/string.rst:916 +#: ../../library/string.rst:918 msgid "" "The methods on this class will raise :exc:`ValueError` if the pattern " "matches the template without one of these named groups matching." @@ -1454,11 +1460,11 @@ msgstr "" "當此模式有匹配於模板但這些命名組中卻有任一個不匹配,此類別的方法將引發 :exc:" "`ValueError`。" -#: ../../library/string.rst:921 +#: ../../library/string.rst:923 msgid "Helper functions" msgstr "輔助函式" -#: ../../library/string.rst:925 +#: ../../library/string.rst:927 msgid "" "Split the argument into words using :meth:`str.split`, capitalize each word " "using :meth:`str.capitalize`, and join the capitalized words using :meth:" @@ -1479,7 +1485,7 @@ msgstr "{} (花括號)" #: ../../library/string.rst:195 ../../library/string.rst:335 #: ../../library/string.rst:368 ../../library/string.rst:387 #: ../../library/string.rst:396 ../../library/string.rst:410 -#: ../../library/string.rst:419 +#: ../../library/string.rst:421 msgid "in string formatting" msgstr "於字串格式化" @@ -1535,14 +1541,14 @@ msgstr "# (井字號)" msgid ", (comma)" msgstr ", (逗號)" -#: ../../library/string.rst:419 +#: ../../library/string.rst:421 msgid "_ (underscore)" msgstr "_ (底線)" -#: ../../library/string.rst:761 +#: ../../library/string.rst:763 msgid "$ (dollar)" msgstr "$ (金錢符號)" -#: ../../library/string.rst:761 +#: ../../library/string.rst:763 msgid "in template strings" msgstr "於 template strings(模板字串)"