From 6bc891b59b8a999a9ce92982f03244b0c7afb4b0 Mon Sep 17 00:00:00 2001 From: Justin Bear Date: Sat, 25 Nov 2023 15:59:32 +0800 Subject: [PATCH 1/2] translate format specification rst:305-324 --- library/string.po | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/library/string.po b/library/string.po index ea8969a03a..1ecd0b71a9 100644 --- a/library/string.po +++ b/library/string.po @@ -389,7 +389,7 @@ msgid "" "Most built-in types implement the following options for format " "specifications, although some of the formatting options are only supported " "by the numeric types." -msgstr "" +msgstr "大部分內建型別為了格式規格實作了下列選項,不過有些選項只支援數值型別。" #: ../../library/string.rst:308 msgid "" @@ -397,10 +397,12 @@ msgid "" "result as if you had called :func:`str` on the value. A non-empty format " "specification typically modifies the result." msgstr "" +"一般來說,輸入空格式規格會產生和呼叫 :func:`str` 函式相同的結果,非空的格式規" +"格才會修改結果。" #: ../../library/string.rst:312 msgid "The general form of a *standard format specifier* is:" -msgstr "" +msgstr "*標準格式規範*的一般型如下:" #: ../../library/string.rst:324 msgid "" @@ -412,6 +414,10 @@ msgid "" "curly brace with a nested replacement field. This limitation doesn't affect " "the :func:`format` function." msgstr "" +"如果給定了一個有效的 *align* 值,則可以在它之前加一個 *fill* 字元,且該字元可" +"為任意值,若不加的話預設為空格。使用 :ref:`格式字串 ` 或 :meth:" +"`str.format` 時是無法使用大括號(\"``{``\" 或 \"``}``\")作為 *fill* 字元,但" +"仍可透過巢狀替換的方式插入大括號,並且不影響 :func:`format` 函式。" #: ../../library/string.rst:333 msgid "The meaning of the various alignment options is as follows:" From 4f55f478ac76421d70bdcc4384a069762f23c67c Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Wed, 3 Jan 2024 18:48:21 +0800 Subject: [PATCH 2/2] fix(library/string): refine translation --- library/string.po | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/library/string.po b/library/string.po index 1ecd0b71a9..c666c1c1c3 100644 --- a/library/string.po +++ b/library/string.po @@ -379,7 +379,7 @@ msgid "" "to the built-in :func:`format` function. Each formattable type may define " "how the format specification is to be interpreted." msgstr "" -"“格式規格” 在格式字串 (format string) 中包含的替換欄位中使用,以定義各個值如" +"「格式規格」在格式字串 (format string) 中包含的替換欄位中使用,以定義各個值如" "何被呈現(請參考 :ref:`formatstrings` and :ref:`f-strings` )。它們也能夠直接" "傳遞給內建的 :func:`format` 函式。每個可格式化型別 (formattable type) 可以定" "義格式規格如何被直譯。" @@ -389,7 +389,8 @@ msgid "" "Most built-in types implement the following options for format " "specifications, although some of the formatting options are only supported " "by the numeric types." -msgstr "大部分內建型別為了格式規格實作了下列選項,不過有些選項只支援數值型別。" +msgstr "" +"大部分內建型別為了格式規格實作了下列選項,不過有些選項只被數值型別支援。" #: ../../library/string.rst:308 msgid "" @@ -402,7 +403,7 @@ msgstr "" #: ../../library/string.rst:312 msgid "The general form of a *standard format specifier* is:" -msgstr "*標準格式規範*的一般型如下:" +msgstr "*標準格式說明符號 (standard format specifier)* 的一般型式如下:" #: ../../library/string.rst:324 msgid "" @@ -415,9 +416,10 @@ msgid "" "the :func:`format` function." msgstr "" "如果給定了一個有效的 *align* 值,則可以在它之前加一個 *fill* 字元,且該字元可" -"為任意值,若不加的話預設為空格。使用 :ref:`格式字串 ` 或 :meth:" -"`str.format` 時是無法使用大括號(\"``{``\" 或 \"``}``\")作為 *fill* 字元,但" -"仍可透過巢狀替換的方式插入大括號,並且不影響 :func:`format` 函式。" +"為任意字元,若不加的話預設為空格。使用\\ :ref:`格式字串 `\\ 或 :" +"meth:`str.format` 時是無法在其中使用大括號(\"``{``\" 或 \"``}``\")作為 " +"*fill* 字元的,但仍可透過巢狀替換的方式插入大括號。此限制不影響 :func:" +"`format` 函式。" #: ../../library/string.rst:333 msgid "The meaning of the various alignment options is as follows:"