@@ -121,8 +121,8 @@ msgid ""
121
121
"positional and keyword arguments. It is just a wrapper that calls :meth:"
122
122
"`vformat`."
123
123
msgstr ""
124
- "主要的 API method。它接收一個格式字串及一組任意的 "
125
- "位置引數與關鍵字引數,是呼叫 :meth:`vformat` 的 wrapper。"
124
+ "主要的 API method。它接收一個格式字串及一組任意的位置引數與關鍵字引數,是呼 "
125
+ "叫 :meth:`vformat` 的 wrapper。"
126
126
127
127
#: ../../library/string.rst:98
128
128
msgid ""
@@ -1017,6 +1017,9 @@ msgid ""
1017
1017
"keywords are the placeholders. When both *mapping* and *kwds* are given and "
1018
1018
"there are duplicates, the placeholders from *kwds* take precedence."
1019
1019
msgstr ""
1020
+ "進行模板替換,並回傳一個新的字串。 *mapping* 是任何有金鑰並符合模板裡佔位符號"
1021
+ "的字典型物件。或者如果關鍵字就是佔位符號時,你也可以改提供關鍵字引數。當 "
1022
+ "*mapping* 跟 *kwds* 同時給定並存在重複時,*kwds* 的佔位符號會被優先使用。"
1020
1023
1021
1024
#: ../../library/string.rst:786
1022
1025
msgid ""
@@ -1026,6 +1029,10 @@ msgid ""
1026
1029
"unlike with :meth:`substitute`, any other appearances of the ``$`` will "
1027
1030
"simply return ``$`` instead of raising :exc:`ValueError`."
1028
1031
msgstr ""
1032
+ "類似於 :meth:`substitute`,但如果 *mapping* 與 *kwds* 中缺少佔位符號的話,原"
1033
+ "始的佔位符號會完整地出現在結果字串裡,而不會引發 :exc:`KeyError` 例外。此外,"
1034
+ "與 :meth:`substitute` 不同的是,任何包含 ``$`` 的字句會直接回傳 ``$`` 而非引"
1035
+ "發 :exc:`ValueError`。"
1029
1036
1030
1037
#: ../../library/string.rst:792
1031
1038
msgid ""
@@ -1039,15 +1046,15 @@ msgstr ""
1039
1046
"雖然仍可能發生其他異常,但這個方法被稱為「安全」,因為它總是試圖回傳一個有用"
1040
1047
"的字串而不是引發例外。從另一個角度來看,:meth:`safe_substitute` 可能並非完全"
1041
1048
"安全,因為它會默默忽略格式錯誤的模板,這些模板包含了未成對的括號、不匹配的括"
1042
- "號,或者不是有效的 Python識別符的占位符 。"
1049
+ "號,或者不是有效的 Python識別符的佔位符號 。"
1043
1050
1044
1051
#: ../../library/string.rst:802
1045
1052
msgid ""
1046
1053
"Returns false if the template has invalid placeholders that will cause :meth:"
1047
1054
"`substitute` to raise :exc:`ValueError`."
1048
1055
msgstr ""
1049
- "如果模板有無效的占位符 ,將導致 :meth:`substitute` 引發 :exc:`ValueError`,並 "
1050
- "回傳 false。"
1056
+ "如果模板有無效的佔位符號 ,將導致 :meth:`substitute` 引發 :exc:`ValueError`,"
1057
+ "並回傳 false。"
1051
1058
1052
1059
#: ../../library/string.rst:810
1053
1060
msgid ""
@@ -1079,7 +1086,7 @@ msgid ""
1079
1086
"expression used to parse template strings. To do this, you can override "
1080
1087
"these class attributes:"
1081
1088
msgstr ""
1082
- "進階用法:你可以繼承 :class:`Template`類別來自定義占位符號語法 、分隔符號字"
1089
+ "進階用法:你可以繼承 :class:`Template`類別來自定義佔位符號語法 、分隔符號字"
1083
1090
"元,或者用於剖析模板字串的正則表達式。你可以透過覆寫這些類別屬性來達成:"
1084
1091
1085
1092
#: ../../library/string.rst:845