Skip to content

Translate library/string.po---rst:265-283 #719

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 7 commits into from
Dec 18, 2023
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
69 changes: 51 additions & 18 deletions library/string.po
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ msgstr ""

#: ../../library/string.rst:90
msgid "The :class:`Formatter` class has the following public methods:"
msgstr ""
msgstr ":class:`Formatter` 類別有以下的公開方法:"

#: ../../library/string.rst:94
msgid ""
Expand Down Expand Up @@ -323,6 +323,8 @@ msgid ""
"`str` on the value, ``'!r'`` which calls :func:`repr` and ``'!a'`` which "
"calls :func:`ascii`."
msgstr ""
"目前支援三種轉換旗標:``'!s'`` 會對該值呼叫 :func:`str`,``'!r'`` 會對該值"
"呼叫 :func:`repr`,而 ``'!a'`` 則會對該值呼叫 :func:`ascii`。"

#: ../../library/string.rst:269
msgid "Some examples::"
Expand All @@ -338,12 +340,15 @@ msgid ""
"decimal precision and so on. Each value type can define its own "
"\"formatting mini-language\" or interpretation of the *format_spec*."
msgstr ""
"*format_spec* 欄位描述了值的呈現規格,例如欄位寬度、對齊、填充、小"
"數精度等細節資訊。每種值類型都可以定義自己的「格式化迷你語言」或對 "
"*format_spec* 的解釋。"

#: ../../library/string.rst:280
msgid ""
"Most built-in types support a common formatting mini-language, which is "
"described in the next section."
msgstr ""
msgstr "大多數內建型別都支援常見的格式化迷你語言,下一節將會詳細說明。"

#: ../../library/string.rst:283
msgid ""
Expand All @@ -354,6 +359,9 @@ msgid ""
"*format_spec* string is interpreted. This allows the formatting of a value "
"to be dynamically specified."
msgstr ""
"*format_spec* 欄位還可以在其內部包含巢狀的替換字段。這些巢狀的替換字段包含字"
"段名稱、轉換旗標、格式規格描述,但是不允許再更深層的巢狀。format_spec 内部的"
"替換字段會在解讀 *format_spec* 字符串之前先被解讀。這允許動態地指定值的格式。"
Comment on lines +362 to +364
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感覺 Field 翻譯成「字段」有點奇怪,好像不是繁體中文的使用慣例

召喚 @ken71301, @cschan1828 幫我一下XD

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

翻譯參考了這個檔案還有參考了簡體中文的翻譯!
我也是有點模糊要寫字段還是欄位XD ...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

「欄位」應該比較適合(樂詞網上也是這樣用居多)。

Copy link
Collaborator

@mattwang44 mattwang44 Nov 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Yanni0923 截圖那份 script 的功能是將 google translate 內容中的簡中用詞替換成繁中用詞(即字段會被改成欄位)。若想查看 project 目前慣用翻譯為何的話,可以使用 pogrep 這項工具 (wiki)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原來如此!謝謝提醒與建議,晚點來研究一下這些 CLI 小工具> <


#: ../../library/string.rst:290
msgid "See the :ref:`formatexamples` section for some examples."
Expand Down Expand Up @@ -843,75 +851,100 @@ msgstr ""

#: ../../library/string.rst:595
msgid "Format examples"
msgstr ""
msgstr "格式範例"

#: ../../library/string.rst:597
msgid ""
"This section contains examples of the :meth:`str.format` syntax and "
"comparison with the old ``%``-formatting."
msgstr ""
msgstr "本節包含 :meth:`str.format` 語法以及與舊式 ``%`` 格式的比較。"

#: ../../library/string.rst:600
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 "
"example, ``'%03.2f'`` can be translated to ``'{:03.2f}'``."
msgstr ""
msgstr "此語法在大多情況下與舊式的 ``%`` 格式類似,只是增加了 ``{}`` 和 ``:`` 來取代 ``%``。"
"例如, ``'%03.2f'`` 可以改寫為 ``'{:03.2f}'`` 。"

#: ../../library/string.rst:604
msgid ""
"The new format syntax also supports new and different options, shown in the "
"following examples."
msgstr ""
msgstr "新的語法還支援新的選項,將在以下的範例中說明。"

#: ../../library/string.rst:607
msgid "Accessing arguments by position::"
msgstr ""
msgstr "按位置取得引數:\n"
"\n"
"::"

#: ../../library/string.rst:620
msgid "Accessing arguments by name::"
msgstr ""
msgstr "按名稱取得引數:\n"
"\n"
"::"

#: ../../library/string.rst:628
msgid "Accessing arguments' attributes::"
msgstr ""
msgstr "取得引數的屬性:\n"
"\n"
"::"

#: ../../library/string.rst:643
msgid "Accessing arguments' items::"
msgstr ""
msgstr "取得引數的內容:\n"
"\n"
"::"

#: ../../library/string.rst:649
msgid "Replacing ``%s`` and ``%r``::"
msgstr ""
msgstr "替換 ``%s`` 和 ``%r``:\n"
"\n"
"::"

#: ../../library/string.rst:654
msgid "Aligning the text and specifying a width::"
msgstr ""
msgstr "對齊文字以及指定寬度:\n"
"\n"
"::"

#: ../../library/string.rst:665
msgid "Replacing ``%+f``, ``%-f``, and ``% f`` and specifying a sign::"
msgstr ""
msgstr "替換 ``%+f``,``%-f`` 和 ``% f`` 以及指定正負號:\n"
"\n"
"::"

#: ../../library/string.rst:674
msgid ""
"Replacing ``%x`` and ``%o`` and converting the value to different bases::"
msgstr ""
msgstr "替換 ``%x`` 或 ``%o`` 用來根據不同的進制轉換其值:\n"
"\n"
"::"

#: ../../library/string.rst:683
msgid "Using the comma as a thousands separator::"
msgstr ""
msgstr "使用逗號作為千位分隔符:\n"
"\n"
"::"

#: ../../library/string.rst:688
msgid "Expressing a percentage::"
msgstr ""
msgstr "表示為百分比:\n"
"\n"
"::"

#: ../../library/string.rst:695
msgid "Using type-specific formatting::"
msgstr ""
msgstr "作為特定類型格式:\n"
"\n"
"::"

#: ../../library/string.rst:702
msgid "Nesting arguments and more complex examples::"
msgstr ""
msgstr "巢狀引數及更多複雜範例:\n"
"\n"
"::"

#: ../../library/string.rst:736
msgid "Template strings"
Expand Down