This is an automated email from the ASF dual-hosted git repository.

Lee-W pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new d900cf21c2c Fix zh-TW spacing around placeholders and nested keys 
(#77644)
d900cf21c2c is described below

commit d900cf21c2ca8bbba5da9b061d3fb12475d6f115
Author: Jean <[email protected]>
AuthorDate: Sat Nov 28 09:38:31 2026 +0800

    Fix zh-TW spacing around placeholders and nested keys (#77644)
    
    * Fix zh-TW spacing around placeholders and nested keys
    
    zh-TW strings put a space around every {{variable}} and $t(), so the UI
    showed extra spaces between Chinese words, such as "標記 任務 為失敗".
    The space should follow the rendered text, so the rule is now written
    in the zh-TW guideline.
    
    * Fix typo in zh-TW spacing rule
    
    * Use jsonc for commented examples in zh-TW spacing rule
---
 .../skills/airflow-translations/locales/zh-TW.md   | 37 ++++++++++++++++++++++
 .../ui/public/i18n/locales/zh-TW/admin.json        |  2 +-
 .../ui/public/i18n/locales/zh-TW/common.json       | 24 +++++++-------
 .../airflow/ui/public/i18n/locales/zh-TW/dag.json  |  6 ++--
 .../airflow/ui/public/i18n/locales/zh-TW/dags.json |  2 +-
 5 files changed, 54 insertions(+), 17 deletions(-)

diff --git a/.agents/skills/airflow-translations/locales/zh-TW.md 
b/.agents/skills/airflow-translations/locales/zh-TW.md
index 5f5d5d0dbad..3731d01e871 100644
--- a/.agents/skills/airflow-translations/locales/zh-TW.md
+++ b/.agents/skills/airflow-translations/locales/zh-TW.md
@@ -96,6 +96,43 @@ English words, numbers, or symbols:
 "最近12小時"       // missing space around numbers
 ```
 
+### Spacing Around `{{variable}}` and `$t(key)`
+
+Decide the space by the **rendered text** next to a placeholder, not by the 
placeholder itself. Check the start and the end separately. If the start or the 
end can be English for some values and Chinese for others, keep the space there.
+
+To find the rendered text:
+
+- `$t(key)` renders another translation key in the locale files, so its value 
is fixed. `$t(common:mapIndex)` is `mapIndex` in `common.json`; a key without a 
prefix is usually in the same file.
+- `{{variable}}` is filled in by the UI code. Check the value at every call 
site (see step 2 of the [Translation Workflow](#translation-workflow)). Some 
call sites set a `defaultValue`, which shows as is, often in English, when no 
translation is found.
+
+**Correct** — no space next to Chinese:
+
+```jsonc
+"標記$t(task_one)為失敗"      // renders "標記任務為失敗"
+```
+
+**Correct** — space only next to English or a number:
+
+```jsonc
+"標記 $t(dagRun_one)為失敗"   // renders "標記 Dag 執行為失敗"
+"逾期 {{duration}}完成"       // renders "逾期 34.4 秒完成"
+```
+
+**Correct** — keep the space when the code can pass English or Chinese:
+
+```jsonc
+"清除 {{type}}"               // renders "清除 Dag 執行" or "清除 任務實例"
+```
+
+> **Note:** This leaves an extra space in "清除 任務實例", but removing it would 
render "清除Dag 執行". Keep the space as a trade-off.
+
+**Incorrect** — space between Chinese characters:
+
+```jsonc
+"標記 $t(task_one) 為失敗"    // renders "標記 任務 為失敗"
+"逾期 {{duration}} 完成"      // renders "逾期 34.4 秒 完成"
+```
+
 ## Punctuation
 
 - Use **full-width** punctuation for Chinese sentences: `,` `。` `:` `?` `!`
diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/zh-TW/admin.json 
b/airflow-core/src/airflow/ui/public/i18n/locales/zh-TW/admin.json
index 08c92f26b38..6c5185ef011 100644
--- a/airflow-core/src/airflow/ui/public/i18n/locales/zh-TW/admin.json
+++ b/airflow-core/src/airflow/ui/public/i18n/locales/zh-TW/admin.json
@@ -30,7 +30,7 @@
       "firstConfirmMessage_other": "您即將刪除以下連線:",
       "title": "刪除連線"
     },
-    "duplicate": "複製 $t(connections.connection_one)",
+    "duplicate": "複製$t(connections.connection_one)",
     "edit": "編輯連線",
     "form": {
       "connectionIdRequired": "連線 ID 是必填的",
diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/zh-TW/common.json 
b/airflow-core/src/airflow/ui/public/i18n/locales/zh-TW/common.json
index 555c159aba1..8574053ac14 100644
--- a/airflow-core/src/airflow/ui/public/i18n/locales/zh-TW/common.json
+++ b/airflow-core/src/airflow/ui/public/i18n/locales/zh-TW/common.json
@@ -347,7 +347,7 @@
     },
     "search": {
       "matchAnywhere": {
-        "helper": "$t(search.advanced.description) 各搜尋列的個別選擇與分享連結仍具有較高優先權。",
+        "helper": "$t(search.advanced.description)各搜尋列的個別選擇與分享連結仍具有較高優先權。",
         "label": "預設比對任意位置"
       },
       "title": "搜尋"
@@ -374,28 +374,28 @@
     },
     "descriptions": {
       "clearRun": "清除 $t(dagRun_one)",
-      "clearTaskInstance": "清除 $t(taskInstance_one)",
+      "clearTaskInstance": "清除$t(taskInstance_one)",
       "downloadLogs": "下載日誌",
       "focusFilterSearch": "聚焦篩選搜尋",
       "focusLogSearch": "搜尋日誌",
       "focusSearch": "聚焦搜尋",
-      "markRunFailed": "標記 $t(dagRun_one) 為失敗",
-      "markRunSuccess": "標記 $t(dagRun_one) 為成功",
-      "markTaskFailed": "標記 $t(task_one) 為失敗",
-      "markTaskGroupFailed": "標記 $t(taskGroup_one) 為失敗",
-      "markTaskGroupSuccess": "標記 $t(taskGroup_one) 為成功",
-      "markTaskSuccess": "標記 $t(task_one) 為成功",
+      "markRunFailed": "標記 $t(dagRun_one)為失敗",
+      "markRunSuccess": "標記 $t(dagRun_one)為成功",
+      "markTaskFailed": "標記$t(task_one)為失敗",
+      "markTaskGroupFailed": "標記$t(taskGroup_one)為失敗",
+      "markTaskGroupSuccess": "標記$t(taskGroup_one)為成功",
+      "markTaskSuccess": "標記$t(task_one)為成功",
       "navigateTasks": "導覽$t(task_other)",
       "openGraphFilters": "開啟圖形篩選條件",
       "scrollBottom": "捲動至最下方",
       "scrollTop": "捲動至最上方",
       "searchDags": "搜尋 $t(dag_other)",
-      "selectGridCellRange": "選取範圍 $t(taskInstance_other) 或 
$t(taskGroup_other)",
+      "selectGridCellRange": "選取範圍$t(taskInstance_other)或$t(taskGroup_other)",
       "showHelp": "顯示$t(shortcuts.title)",
       "toggleExpand": "展開或收合所有群組",
       "toggleFullscreen": "切換全螢幕",
       "toggleGraphGrid": "切換圖形/網格檢視",
-      "toggleGridCellSelection": "選取或取消選取 $t(taskInstance_one) 或 
$t(taskGroup_one)",
+      "toggleGridCellSelection": 
"選取或取消選取$t(taskInstance_one)或$t(taskGroup_one)",
       "toggleLogLevel": "切換日誌層級",
       "toggleSource": "切換來源",
       "toggleTaskGroup": "展開或收合$t(taskGroup_one)",
@@ -441,7 +441,7 @@
   },
   "switchDag": "切換 $t(dag_one)",
   "switchDagRun": "切換 $t(dagRun_one)",
-  "switchMapIndex": "切換 $t(mapIndex)",
+  "switchMapIndex": "切換$t(mapIndex)",
   "switchTask": "切換$t(task_one)",
   "table": {
     "completedAt": "完成時間",
@@ -612,7 +612,7 @@
     "tokenGenerated": "您的權杖已產生。",
     "tokenShownOnce": "此權杖僅會顯示一次,請立即複製。"
   },
-  "total": "總計 {{state}}",
+  "total": "總計{{state}}",
   "trigger_one": "觸發器",
   "trigger_other": "觸發器",
   "triggered": "已觸發",
diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/zh-TW/dag.json 
b/airflow-core/src/airflow/ui/public/i18n/locales/zh-TW/dag.json
index 29bc9fddbe0..bc32f8b6d52 100644
--- a/airflow-core/src/airflow/ui/public/i18n/locales/zh-TW/dag.json
+++ b/airflow-core/src/airflow/ui/public/i18n/locales/zh-TW/dag.json
@@ -58,7 +58,7 @@
     "parsedAt": "解析時間:"
   },
   "deadlineAlerts": {
-    "completionRule": "必須在 {{reference}}後 {{interval}} 內完成",
+    "completionRule": "必須在 {{reference}}後 {{interval}}內完成",
     "completionRuleDynamic": "必須在 {{reference}}後的一段變動期間內完成",
     "count_one": "1 個期限",
     "count_other": "{{count, number}} 個期限",
@@ -71,8 +71,8 @@
   "deadlineStatus": {
     "actual": "實際",
     "expected": "預期",
-    "finishedEarly": "提前 {{duration}} 達成期限",
-    "finishedLate": "逾期 {{duration}} 完成",
+    "finishedEarly": "提前 {{duration}}達成期限",
+    "finishedLate": "逾期 {{duration}}完成",
     "label": "期限",
     "met": "已達成",
     "missed": "已逾期",
diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/zh-TW/dags.json 
b/airflow-core/src/airflow/ui/public/i18n/locales/zh-TW/dags.json
index 2478b8fe374..702a0ec3844 100644
--- a/airflow-core/src/airflow/ui/public/i18n/locales/zh-TW/dags.json
+++ b/airflow-core/src/airflow/ui/public/i18n/locales/zh-TW/dags.json
@@ -131,7 +131,7 @@
     "dagRuns": "搜尋 $t(common:dagRun_other)",
     "dags": "搜尋 Dags",
     "hotkey": "+K",
-    "mapIndexes": "搜尋 $t(common:mapIndex)",
+    "mapIndexes": "搜尋$t(common:mapIndex)",
     "tasks": "搜尋任務"
   },
   "sort": {

Reply via email to