Skip to content

Commit 0533ee6

Browse files
Translate string.rst:777 to 786 (#717)
* Translate rst777:786. * fix(library/string): refine translation --------- Co-authored-by: Matt Wang <mattwang44@gmail.com>
1 parent bd5a3c6 commit 0533ee6

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

library/string.po

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ msgid ""
121121
"positional and keyword arguments. It is just a wrapper that calls :meth:"
122122
"`vformat`."
123123
msgstr ""
124-
"主要的 API method。它接收一個格式字串及一組任意的"
125-
"位置引數與關鍵字引數,是呼叫 :meth:`vformat` 的 wrapper。"
124+
"主要的 API method。它接收一個格式字串及一組任意的位置引數與關鍵字引數,是呼"
125+
" :meth:`vformat` 的 wrapper。"
126126

127127
#: ../../library/string.rst:98
128128
msgid ""
@@ -1017,6 +1017,9 @@ msgid ""
10171017
"keywords are the placeholders. When both *mapping* and *kwds* are given and "
10181018
"there are duplicates, the placeholders from *kwds* take precedence."
10191019
msgstr ""
1020+
"進行模板替換,並回傳一個新的字串。 *mapping* 是任何有金鑰並符合模板裡佔位符號"
1021+
"的字典型物件。或者如果關鍵字就是佔位符號時,你也可以改提供關鍵字引數。當 "
1022+
"*mapping* 跟 *kwds* 同時給定並存在重複時,*kwds* 的佔位符號會被優先使用。"
10201023

10211024
#: ../../library/string.rst:786
10221025
msgid ""
@@ -1026,6 +1029,10 @@ msgid ""
10261029
"unlike with :meth:`substitute`, any other appearances of the ``$`` will "
10271030
"simply return ``$`` instead of raising :exc:`ValueError`."
10281031
msgstr ""
1032+
"類似於 :meth:`substitute`,但如果 *mapping* 與 *kwds* 中缺少佔位符號的話,原"
1033+
"始的佔位符號會完整地出現在結果字串裡,而不會引發 :exc:`KeyError` 例外。此外,"
1034+
"與 :meth:`substitute` 不同的是,任何包含 ``$`` 的字句會直接回傳 ``$`` 而非引"
1035+
"發 :exc:`ValueError`。"
10291036

10301037
#: ../../library/string.rst:792
10311038
msgid ""
@@ -1039,15 +1046,15 @@ msgstr ""
10391046
"雖然仍可能發生其他異常,但這個方法被稱為「安全」,因為它總是試圖回傳一個有用"
10401047
"的字串而不是引發例外。從另一個角度來看,:meth:`safe_substitute` 可能並非完全"
10411048
"安全,因為它會默默忽略格式錯誤的模板,這些模板包含了未成對的括號、不匹配的括"
1042-
"號,或者不是有效的 Python 識別符的占位符。"
1049+
"號,或者不是有效的 Python 識別符的佔位符號。"
10431050

10441051
#: ../../library/string.rst:802
10451052
msgid ""
10461053
"Returns false if the template has invalid placeholders that will cause :meth:"
10471054
"`substitute` to raise :exc:`ValueError`."
10481055
msgstr ""
1049-
"如果模板有無效的占位符,將導致 :meth:`substitute` 引發 :exc:`ValueError`,"
1050-
"回傳 false。"
1056+
"如果模板有無效的佔位符號,將導致 :meth:`substitute` 引發 :exc:`ValueError`,"
1057+
"並回傳 false。"
10511058

10521059
#: ../../library/string.rst:810
10531060
msgid ""
@@ -1079,7 +1086,7 @@ msgid ""
10791086
"expression used to parse template strings. To do this, you can override "
10801087
"these class attributes:"
10811088
msgstr ""
1082-
"進階用法:你可以繼承 :class:`Template` 類別來自定義占位符號語法、分隔符號字"
1089+
"進階用法:你可以繼承 :class:`Template` 類別來自定義佔位符號語法、分隔符號字"
10831090
"元,或者用於剖析模板字串的正則表達式。你可以透過覆寫這些類別屬性來達成:"
10841091

10851092
#: ../../library/string.rst:845

0 commit comments

Comments
 (0)