Skip to content

Commit c47256d

Browse files
committed
Fix RST escaping bugs causing --fail-on-warning build failure
CI builds with sphinx-build --fail-on-warning, so the 56 warnings from the previous push were hard failures. Root cause: two escaping bugs introduced across the large tkinter.po translation batch. 1. A role/literal close (`` ` `` or ``` `` ```) directly followed by a full-width ( with no `\ ` separator confuses docutils' inline markup boundary detection, which can silently swallow or merge adjacent role references in the same paragraph -- surfacing as Sphinx's i18n.inconsistent_references warnings (dropped or merged :class:/ :meth:/:attr:/:term: references) in tkinter.po, tkinter.ttk.po, http.cookiejar.po, and c-api/unicode.po. 2. The same applies to *emphasis*( with no space/separator before the parenthesis, which docutils reports as "Inline emphasis start-string without end-string" since the closing `*` isn't followed by a recognized boundary character. Fixed by adding the space that's already the established convention elsewhere in this file. Also fixes a review comment on PR #1239: removes a stray literal space that rendered as a visible gap between adjacent Chinese text and a role's Chinese display text in c-api/dict.po. Co-authored-by: Claude <noreply@anthropic.com>
1 parent 03424c0 commit c47256d

6 files changed

Lines changed: 110 additions & 108 deletions

File tree

c-api/dict.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ msgid ""
110110
"on success or ``-1`` on failure. This function *does not* \":term:`steal`\" "
111111
"a reference to *val*."
112112
msgstr ""
113-
"以 *key* 為鍵,將 *val* 插入至字典 *p* 中。*key* 必須是 :term:`可雜湊的 "
113+
"以 *key* 為鍵,將 *val* 插入至字典 *p* 中。*key* 必須是\\ :term:`可雜湊的 "
114114
"<hashable>`,否則將引發 :exc:`TypeError`。成功時回傳 ``0``,失敗時回傳 "
115115
"``-1``。此函式\\ *不會*\\ 「:term:`竊取 <steal>`」對 *val* 的參照。"
116116

c-api/unicode.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -926,8 +926,8 @@ msgid ""
926926
"releases (\":term:`steals <steal>`\") this reference."
927927
msgstr ""
928928
"將字串 *right* 附加到 *p_left* 的結尾。*p_left* 必須指向一個 Unicode 物件的 :"
929-
"term:`強參照 <strong reference>`;:c:func:`!PyUnicode_Append` 會釋放(「"
930-
"」)此參照。"
929+
"term:`強參照 <strong reference>`;:c:func:`!PyUnicode_Append` 會釋放(「:"
930+
"term:`竊取 <steal>`」)此參照。"
931931

932932
#: ../../c-api/unicode.rst:669
933933
msgid "On error, set *\\*p_left* to ``NULL`` and set an exception."

library/dialog.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,10 +420,10 @@ msgid ""
420420
"index of the button the user pressed."
421421
msgstr ""
422422
"顯示一個由傳統(非主題化)Tk 元件建立的互動 (modal) 對話框,並等待使用者按下"
423-
"其中一個按鈕。透過 *cnf* 或關鍵字引數提供的選項包括:*title*(視窗標題)、"
424-
"*text*(訊息內容)、*bitmap*(圖示,預設為 :data:`DIALOG_ICON`)、*default*"
425-
"(預設按鈕的索引)和 *strings*(按鈕標籤的序列)。建構完成後,:attr:`!num` 屬"
426-
"性會保存使用者按下之按鈕的索引。"
423+
"其中一個按鈕。透過 *cnf* 或關鍵字引數提供的選項包括:*title* (視窗標題)、"
424+
"*text* (訊息內容)、*bitmap* (圖示,預設為 :data:`DIALOG_ICON`)、"
425+
"*default* (預設按鈕的索引)和 *strings* (按鈕標籤的序列)。建構完成後,:"
426+
"attr:`!num` 屬性會保存使用者按下之按鈕的索引。"
427427

428428
#: ../../library/dialog.rst:330
429429
msgid "Destroy the dialog window."

library/http.cookiejar.po

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -463,9 +463,9 @@ msgid ""
463463
"filename <FileCookieJar.filename>` is ``None``, :exc:`ValueError` is raised."
464464
msgstr ""
465465
"*filename* 是用來儲存 cookies 的檔案名稱。如果未指定 *filename*,則會使用 :"
466-
"attr:`self.filename <FileCookieJar.filename>`(其預設值為傳給建構函式的值,如"
467-
"果有的話);如果 :attr:`self.filename <FileCookieJar.filename>` 為 ``None``,"
468-
"則會引發 :exc:`ValueError`。"
466+
"attr:`self.filename <FileCookieJar.filename>`\\ (其預設值為傳給建構函式的"
467+
"值,如果有的話);如果 :attr:`self.filename <FileCookieJar.filename>` 為 "
468+
"``None``,則會引發 :exc:`ValueError`。"
469469

470470
#: ../../library/http.cookiejar.rst:277
471471
msgid ""

0 commit comments

Comments
 (0)