You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "Astro-Han (via GitHub)" <gi...@apache.org> on 2026/08/29 19:29:55 UTC

Re: [PR] feat(i18n): add Traditional Chinese locale [maka]

Astro-Han commented on code in PR #3853:
URL: https://github.com/apache/maka/pull/3853#discussion_r3887468142


##########
packages/cli/src/cli-ui-locale.ts:
##########
@@ -33,11 +33,17 @@ export type CliUiLocaleResolution =
 /** Resolve the interactive TUI locale without changing the top-level CLI grammar. */
 export function resolveCliUiLocale(environment: CliEnvironment): CliUiLocaleResolution {
   const rawPreference = environment.MAKA_LOCALE?.trim();
-  const preference = rawPreference ? rawPreference.toLowerCase() : 'auto';
+  const normalizedPreference = rawPreference?.replaceAll('_', '-').toLowerCase();
+  const preference =
+    normalizedPreference === 'zh' || normalizedPreference === 'zh-cn'
+      ? 'zh-CN'
+      : normalizedPreference === 'zh-tw'
+        ? 'zh-TW'
+        : (normalizedPreference ?? 'auto');

Review Comment:
   [P2 · category ①] An empty or whitespace-only `MAKA_LOCALE` now becomes `''`, because the fallback is nullish-only. `isUiLocalePreference('')` then fails and the TUI exits with code 2. Empty exported environment variables are a normal shell/CI configuration, and the previous implementation treated them as unset. Please normalize the trimmed empty string to `auto`/undefined and add `''` plus whitespace regression cases.



##########
.github/workflows/zh-tw-locale-screenshots.yml:
##########
@@ -0,0 +1,37 @@
+name: Traditional Chinese locale screenshots
+
+on:
+  workflow_dispatch:
+
+permissions:
+  contents: read
+
+jobs:
+  screenshots:
+    runs-on: macos-15
+    timeout-minutes: 45
+    steps:
+      - name: Check out pull request
+        uses: actions/checkout@v4
+        with:
+          ref: ${{ github.event.pull_request.head.sha || github.sha }}
+
+      - name: Set up Node.js
+        uses: actions/setup-node@v4
+        with:
+          node-version: 22.19.0
+          cache: npm
+
+      - name: Install dependencies
+        run: npm ci
+
+      - name: Capture locale screenshots
+        run: npm --workspace @maka/desktop run e2e -- e2e/zh-tw-locale-screenshots.spec.ts --workers=1
+
+      - name: Upload locale screenshots
+        if: always()
+        uses: actions/upload-artifact@v4
+        with:
+          name: zh-tw-locale-screenshots
+          path: apps/desktop/test-results/**/zh-tw-locale/*.png
+          if-no-files-found: warn

Review Comment:
   [P2 · category ①] The existing screenshot run passed its E2E step but uploaded zero artifacts, and `if-no-files-found: warn` still leaves the workflow green. That makes the workflow unable to prove the visual evidence it exists to produce. Please align the output path and fail closed when the expected zh-CN/zh-TW PNGs are absent, then attach the current-head artifacts to the PR.



##########
packages/ui/src/daily-review-copy.ts:
##########
@@ -139,6 +139,41 @@ const DAILY_REVIEW_COPY = {
       separator: ':', title: (dayLabel) => `# Maka · 每日回顾 · ${dayLabel}`, conversations: '任务', requests: '模型调用', tokens: 'Token', cost: '费用', errors: '错误', activeConversations: '活跃任务', modelUsage: '模型使用', toolCalls: '工具调用', requestCount: (count) => `${count} 次`,
     },
   },
+  'zh-TW': {
+    archive: {
+      section: { summary: '任務摘要', gaps: '遺漏提醒', usage: '使用洞察', code: '程式碼建議' },
+      status: { ok: '已生成', no_model: '缺少模型', no_data: '無資料', failed: '生成失敗', skipped: '已跳過' },
+      trigger: { cron: '定時', manual: '手動' },
+      title: (date, mode) => `${date} · ${mode}`,
+      range: { 1: '單日', 7: '7 天', 30: '30 天' },
+      generated: (trigger, time) => `${trigger}生成 ${time}`,
+      sessionCount: (count) => `${count} 任務`,
+      defaultModel: '預設任務模型',
+      opening: '正在開啟這份報告…',
+      noContent: '這份報告沒有生成正文內容。',
+      noContentHelp: '這一天沒有歸檔內容。',
+    },
+    date: {
+      today: '今天', yesterday: '昨天', daysAgo: (count) => `${count} 天前`, recent7Days: '最近 7 天', recent30Days: '最近 30 天', shiftedRange: (range, days) => `${range}(往前 ${days} 天)`,
+      unit: { day: '天', week: '周', month: '月' }, earlier: (unit) => `檢視更早一${unit}`, later: (unit) => `檢視更晚一${unit}`,
+    },
+    emptyOverview: {
+      todayTitle: '等待記錄今天活動', rangeTitle: (label) => `${label}無活動`, todayBody: '今天還沒有發起任務,也沒有呼叫模型。', rangeBody: (label) => `${label}範圍內沒有發起任務,也沒有呼叫模型。`,
+    },
+    export: {
+      ariaLabel: '回顧匯出操作', copyTitle: '複製為 Markdown 摘要,方便分享 / 貼到筆記', copying: '複製中…', copy: '複製', appendTitle: '追加到目前輸入框草稿', appending: '追加中…', append: '粘到輸入框', saveTitle: '儲存為 Markdown 檔案', saving: '儲存中…', save: '儲存',

Review Comment:
   [P3 · category ①] This action is rendered by the Daily Review panel, and `粘到輸入框` is not the expected Traditional Chinese wording here. Please use `貼到輸入框` and add a direct catalog assertion so this reachable copy does not regress.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org