Thanks to visit codestin.com
Credit goes to github.com

Skip to content

translate format specification rst:305-324 #716

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

Merged
merged 2 commits into from
Jan 3, 2024
Merged
Changes from all commits
Commits
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
12 changes: 10 additions & 2 deletions library/string.po
Original file line number Diff line number Diff line change
Expand Up @@ -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) 可以定"
"義格式規格如何被直譯。"
Expand All @@ -390,17 +390,20 @@ msgid ""
"specifications, although some of the formatting options are only supported "
"by the numeric types."
msgstr ""
"大部分內建型別為了格式規格實作了下列選項,不過有些選項只被數值型別支援。"

#: ../../library/string.rst:308
msgid ""
"A general convention is that an empty format specification produces the same "
"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 "*標準格式說明符號 (standard format specifier)* 的一般型式如下:"

#: ../../library/string.rst:324
msgid ""
Expand All @@ -412,6 +415,11 @@ msgid ""
"curly brace with a nested replacement field. This limitation doesn't affect "
"the :func:`format` function."
msgstr ""
"如果給定了一個有效的 *align* 值,則可以在它之前加一個 *fill* 字元,且該字元可"
"為任意字元,若不加的話預設為空格。使用\\ :ref:`格式字串 <f-strings>`\\ 或 :"
"meth:`str.format` 時是無法在其中使用大括號(\"``{``\" 或 \"``}``\")作為 "
"*fill* 字元的,但仍可透過巢狀替換的方式插入大括號。此限制不影響 :func:"
"`format` 函式。"

#: ../../library/string.rst:333
msgid "The meaning of the various alignment options is as follows:"
Expand Down