fix(i18n): fill 149 missing zh-TW locale keys from zh-CN - #4491
Conversation
WalkthroughAdds 150+ localization keys to the Traditional Chinese translation file for pricing and top-up configuration features, including weekday/month labels, API/Webhook configuration, token estimators, pricing rules, and billing-related UI prompts. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@web/src/i18n/locales/zh-TW.json`:
- Around line 3638-3787: The new zh-TW entries introduce inconsistent Taiwanese
terminology (e.g., "充值", "缓存/緩存", "设/置/設置", "账户/賬户", "图标", "变量/变量") that
conflicts with existing conventions in this locale; update the added value
strings (examples: "一次性余额充值", "缓存创建", "Waffo Pancake 设置", "付款完成后将自动回到账户页",
"支付方式图标", "变量") to use the project's established TW terms (use 儲值 for 充值, 快取 for
缓存/緩存, 設定 for 设置/設置, 帳號 for 账户/賬户, 圖示 for 图标, and 變數 / 變數值 for 变量/变量值) so
wording matches other keys, and re-run a s2twp.json OpenCC or a targeted
sed/replace mapping to ensure all new keys (e.g., the strings shown in the diff
like "一次性余额充值", "缓存创建", "启用 Waffo Pancake 设置", "付款完成后将自动回到账户页", "支付方式图标", "变量")
are normalized to the established vocabulary.
- Around line 3638-3787: Many of the new zh-TW values were left in Simplified
Chinese (e.g. "Token 类型", "函数", "分时缓存 (Claude)", the whole cache block like
"缓存创建", "缓存读取", and phrases such as "根据用量档位和请求条件动态调整", "充值价格必须大于 0",
"请先选择不低于最低额度的充值金额") — regenerate all added values by running an automated s2t
conversion with OpenCC using the s2twp.json profile (not manual/partial
substitutions), replace the current Simplified values with the OpenCC outputs
for each key (e.g. "Token 类型", "函数", "分时缓存 (Claude)", "缓存创建-1小时 (cc1h)", "规则版本",
"计费明细", "错误详情", "第 {{n}} 组", etc.), and then spot-check the previously listed
problematic entries and the entire added block to ensure Traditional Chinese and
TW idioms are used consistently before committing.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: e1c99b40-4e0f-4d69-9e77-1223a3661310
📒 Files selected for processing (1)
web/src/i18n/locales/zh-TW.json
| "默认补全倍率": "預設補全倍率", | ||
| "0=周日 1=周一 2=周二 3=周三 4=周四 5=周五 6=周六": "0=周日 1=周一 2=周二 3=周三 4=周四 5=周五 6=周六", | ||
| "1=一月 ... 12=十二月": "1=一月 ... 12=十二月", | ||
| "API 私钥": "API 私鑰", | ||
| "Expr 预览": "Expr 預覽", | ||
| "Product ID": "Product ID", | ||
| "Store ID": "Store ID", | ||
| "Token 估算器": "Token 估算器", | ||
| "Token 用量范围": "Token 用量範圍", | ||
| "Token 类型": "Token 类型", | ||
| "Waffo Pancake": "Waffo Pancake", | ||
| "Waffo Pancake 设置": "Waffo Pancake 設置", | ||
| "Webhook 公钥": "Webhook 公鑰", | ||
| "一次性余额充值": "一次性餘額充值", | ||
| "一次性支付,付款后自动返回": "一次性支付,付款後自動返回", | ||
| "上限": "上限", | ||
| "付款完成后将自动回到账户页": "付款完成後將自動回到賬户頁", | ||
| "价格根据用量档位和请求条件动态调整": "價格根据用量檔位和请求條件動態調整", | ||
| "值": "值", | ||
| "充值价格必须大于 0": "充值價格必须大于 0", | ||
| "充值完成后跳回的页面": "充值完成後跳回的頁面", | ||
| "兜底档": "兜底檔", | ||
| "函数": "函数", | ||
| "分时缓存 (Claude)": "分時缓存 (Claude)", | ||
| "分档价格表": "分檔價格表", | ||
| "前 {{count}} 个": "前 {{count}} 個", | ||
| "动态计费": "動態計費", | ||
| "单价": "單價", | ||
| "变量": "變量", | ||
| "可选,填写图片 URL": "可選,填寫图片 URL", | ||
| "可选,用量达到此档时加收的固定费用": "可選,用量達到此檔時加收的固定費用", | ||
| "同时满足": "同時满足", | ||
| "含时间条件": "含時间條件", | ||
| "含请求条件": "含请求條件", | ||
| "启用 Waffo Pancake": "启用 Waffo Pancake", | ||
| "启用后会按测试环境保存这组配置": "启用後會按测试環境保存这组配置", | ||
| "命中档位": "命中檔位", | ||
| "固定费": "固定費", | ||
| "固定阶梯": "固定階梯", | ||
| "实际环境": "实際環境", | ||
| "实际额度": "实際額度", | ||
| "将额外乘以上述价格": "將額外乘以上述價格", | ||
| "小计": "小計", | ||
| "开发者": "開發者", | ||
| "当前入口状态": "當前入口狀態", | ||
| "当前金额未达到 Waffo Pancake 的最低充值要求": "當前金額未達到 Waffo Pancake 的最低充值要求", | ||
| "所有 Token": "所有 Token", | ||
| "支付方式图标": "支付方式图標", | ||
| "支付方式颜色": "支付方式颜色", | ||
| "新年促销": "新年促销", | ||
| "新支付方式": "新支付方式", | ||
| "无条件(兜底档)": "無條件(兜底檔)", | ||
| "无限": "無限", | ||
| "日期": "日期", | ||
| "时区": "時區", | ||
| "时间条件": "時间條件", | ||
| "易支付设置": "易支付設置", | ||
| "星期": "星期", | ||
| "更新 Waffo Pancake 设置": "更新 Waffo Pancake 設置", | ||
| "更新易支付设置": "更新易支付設置", | ||
| "最低充值数量必须大于 0": "最低充值数量必须大于 0", | ||
| "最高档": "最高檔", | ||
| "月份": "月份", | ||
| "条件": "條件", | ||
| "条件乘数": "條件乘数", | ||
| "根据哪个维度的 Token 数量决定落在哪一档": "根据哪個維度的 Token 数量决定落在哪一檔", | ||
| "根据总用量落在哪个档位,所有 Token 都按该档价格计费": "根据總用量落在哪個檔位,所有 Token 都按该檔價格計費", | ||
| "档": "檔", | ||
| "档位标签": "檔位標签", | ||
| "止": "止", | ||
| "此档上限(Token 数)": "此檔上限(Token 数)", | ||
| "每个档位可设置 0~2 个条件(对 p 和 c),最后一档为兜底档无需条件。": "每個檔位可設置 0~2 個條件(對 p 和 c),最後一檔為兜底檔無需條件。", | ||
| "每百万 Token 价格": "每百万 Token 價格", | ||
| "测试 Webhook 公钥": "测试 Webhook 公鑰", | ||
| "测试环境": "测试環境", | ||
| "测试环境 Webhook 验签公钥 Base64": "测试環境 Webhook 驗签公鑰 Base64", | ||
| "添加时间条件": "添加時间條件", | ||
| "添加时间规则": "添加時间规則", | ||
| "添加更多档位": "添加更多檔位", | ||
| "添加条件": "添加條件", | ||
| "添加条件组": "添加條件组", | ||
| "添加阶梯": "添加階梯", | ||
| "生产 Webhook 公钥": "生產 Webhook 公鑰", | ||
| "生产环境": "生產環境", | ||
| "生产环境 Webhook 验签公钥 Base64": "生產環境 Webhook 驗签公鑰 Base64", | ||
| "用量分段计价,每一段各自按对应档位价格计费(类似电费阶梯)": "用量分段計價,每一段各自按對應檔位價格計費(类似電費階梯)", | ||
| "用量范围": "用量範圍", | ||
| "立即充值": "立即充值", | ||
| "第 {{n}} 档": "第 {{n}} 檔", | ||
| "第 {{n}} 组": "第 {{n}} 组", | ||
| "累进阶梯": "累進階梯", | ||
| "统一定价": "統一定價", | ||
| "缓存创建": "缓存创建", | ||
| "缓存创建 Token (cc)": "缓存创建 Token (cc)", | ||
| "缓存创建-1h": "缓存创建-1h", | ||
| "缓存创建-1小时": "缓存创建-1小時", | ||
| "缓存创建-1小时 (cc1h)": "缓存创建-1小時 (cc1h)", | ||
| "缓存创建-5分钟": "缓存创建-5分鐘", | ||
| "缓存创建-5分钟 (cc5)": "缓存创建-5分鐘 (cc5)", | ||
| "缓存创建价格-1小时": "缓存创建價格-1小時", | ||
| "缓存创建价格-5分钟": "缓存创建價格-5分鐘", | ||
| "缓存创建价格(1小时)": "缓存创建價格(1小時)", | ||
| "缓存创建价格(5分钟)": "缓存创建價格(5分鐘)", | ||
| "缓存读取": "缓存读取", | ||
| "缓存读取 Token (cr)": "缓存读取 Token (cr)", | ||
| "表达式编辑": "表達式編輯", | ||
| "表达式错误": "表達式錯誤", | ||
| "见上方动态计费详情": "見上方動態計費详情", | ||
| "规则版本": "规則版本", | ||
| "计费明细": "計費明细", | ||
| "该入口仅用于一次性余额充值": "该入口仅用于一次性餘額充值", | ||
| "请先选择不低于最低额度的充值金额": "请先選擇不低于最低額度的充值金額", | ||
| "请输入 Product ID": "请输入 Product ID", | ||
| "请输入 Store ID": "请输入 Store ID", | ||
| "请输入商户 ID": "请输入商户 ID", | ||
| "请输入支付方式名称": "请输入支付方式名稱", | ||
| "起": "起", | ||
| "超过 {{count}} 个": "超過 {{count}} 個", | ||
| "跨夜范围": "跨夜範圍", | ||
| "跨阶梯": "跨階梯", | ||
| "输入 Token": "输入 Token", | ||
| "输入 Token 定价": "输入 Token 定價", | ||
| "输入 Token 数": "输入 Token 数", | ||
| "输入 Token 数 (p)": "输入 Token 数 (p)", | ||
| "输入 Token 数量,查看按当前配置的预计费用。": "输入 Token 数量,查看按當前配置的預計費用。", | ||
| "输入 Token 数量,查看按当前阶梯配置的预计费用。": "输入 Token 数量,查看按當前階梯配置的預計費用。", | ||
| "输入 Tokens 阶梯": "输入 Tokens 階梯", | ||
| "输入计费表达式...": "输入計費表達式...", | ||
| "输入阶梯": "输入階梯", | ||
| "输出 Token": "输出 Token", | ||
| "输出 Token 定价": "输出 Token 定價", | ||
| "输出 Token 数": "输出 Token 数", | ||
| "输出 Token 数 (c)": "输出 Token 数 (c)", | ||
| "输出 Tokens 阶梯": "输出 Tokens 階梯", | ||
| "输出阶梯": "输出階梯", | ||
| "进入此档额外收费": "進入此檔額外收費", | ||
| "选择金额后直接跳转到 Waffo Pancake 结账页,支付完成后会回到账户页。": "選擇金額後直接跳转到 Waffo Pancake 結賬頁,支付完成後會回到賬户頁。", | ||
| "通用缓存": "通用缓存", | ||
| "错误详情": "錯誤详情", | ||
| "阶": "階", | ||
| "阶梯内 Token 数": "階梯内 Token 数", | ||
| "阶梯判断依据": "階梯判断依据", | ||
| "阶梯序号": "階梯序號", | ||
| "阶梯累进": "階梯累進", | ||
| "阶梯计费": "階梯計費", | ||
| "阶梯计费详情": "階梯計費详情", | ||
| "阶梯配置摘要": "階梯配置摘要", | ||
| "预估环境": "預估環境", | ||
| "预估额度": "預估額度", | ||
| "预计费用": "預計費用" |
There was a problem hiding this comment.
Terminology inconsistent with the rest of zh-TW.json — please align with project conventions.
Even where the s2t character conversion is correct, several added entries use TW words that conflict with the vocabulary already standardized elsewhere in this same file. Mixed terminology will look inconsistent in the UI (e.g., one screen says 儲值, the next says 充值).
Concrete cases (left value already in file → recommended for new entries):
| Convention in existing file | New entries that diverge |
|---|---|
充值 → 儲值 (lines 124, 640, 1160, 2588 …) |
3651, 3658, 3683, 3725, 3748, 3749 still use 充值 |
缓存 → 快取 (lines 21, 48, 51, 64–68, 2688–2727 …) |
3661, 3730–3742 use 缓存/緩存 |
设置 → 設定 (lines 73, 108, 125, 234, 238 …) |
3649, 3694, 3696, 3697, 3709 use 設置 |
账户 → 帳號 (lines 819, 1213, 1376, 2202 …) |
3654, 3774 use 賬户/账户 |
图标 → 圖示 (lines 549, 1046, 1047) |
3685 uses 图標 |
变量值 → 變數值 (line 917); 变量 widely → 變數 |
3666 uses 變量 |
Consider running OpenCC with s2twp.json (Taiwanese idiom variant) when generating these, or post-process with a small sed/replace step using the table above so consumers of the JSON see consistent wording across the app.
Based on learnings: zh-TW locale uses flat key-value mappings inside the translation wrapper; consistency of the value vocabulary across the file is the only signal users have for the chosen TW localization style.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@web/src/i18n/locales/zh-TW.json` around lines 3638 - 3787, The new zh-TW
entries introduce inconsistent Taiwanese terminology (e.g., "充值", "缓存/緩存",
"设/置/設置", "账户/賬户", "图标", "变量/变量") that conflicts with existing conventions in
this locale; update the added value strings (examples: "一次性余额充值", "缓存创建", "Waffo
Pancake 设置", "付款完成后将自动回到账户页", "支付方式图标", "变量") to use the project's established
TW terms (use 儲值 for 充值, 快取 for 缓存/緩存, 設定 for 设置/設置, 帳號 for 账户/賬户, 圖示 for 图标,
and 變數 / 變數值 for 变量/变量值) so wording matches other keys, and re-run a s2twp.json
OpenCC or a targeted sed/replace mapping to ensure all new keys (e.g., the
strings shown in the diff like "一次性余额充值", "缓存创建", "启用 Waffo Pancake 设置",
"付款完成后将自动回到账户页", "支付方式图标", "变量") are normalized to the established vocabulary.
Many of the 149 added entries are not actually converted to Traditional Chinese — Simplified characters remain in the value.
The PR's premise is "fill missing zh-TW keys by converting zh-CN via s2t", but a large portion of the new values still contain Simplified Chinese characters. These will render as Simplified text for zh-TW users and defeat the purpose of the PR. Spot-checks passing in the description suggests only a sample was inspected.
A non-exhaustive list of affected lines (look at the right-hand side / value):
- Line 3647
"Token 类型": "Token 类型"—类→類 - Line 3655
…根据用量档位和请求条件动态调整—根据→根據,请求→請求 - Line 3657
…必须大于 0—必须→必須,大于→大於 - Line 3660
"函数": "函数"—数→數(both sides Simplified; the source key itself looks miscaptured) - Line 3661
"分时缓存 (Claude)": "分時缓存 (Claude)"—缓→緩 - Line 3667
…填寫图片 URL—图→圖 - Line 3669
"同时满足": "同時满足"—满→滿 - Lines 3670, 3693, 3714, 3715 —
时间/间→時間/間 - Line 3671
"含请求条件": "含请求條件"—请→請 - Line 3672
"启用 Waffo Pancake": "启用 Waffo Pancake"—启→啟(both sides Simplified) - Line 3673
启用後會按测试環境保存这组配置—启,测试,这,组all unconverted - Lines 3677, 3678 —
实→實 - Line 3686
"支付方式颜色": "支付方式颜色"—颜→顏(both sides Simplified) - Line 3687
"新年促销": "新年促销"—销→銷(both sides Simplified) - Line 3698
最低充值数量必须大于 0—数量,必须,大于unconverted - Lines 3702, 3708 —
数→數 - Lines 3703, 3704 —
根据,决定,该unconverted - Line 3706
"档位标签": "檔位標签"—签→籤 - Line 3710
"每百万 Token 价格"—万→萬 - Lines 3711–3713
测试,验签—测/试/签→測/試/簽 - Line 3723
…类似電費階梯—类→類 - Line 3727
"第 {{n}} 组": "第 {{n}} 组"—组→組 - Lines 3730–3742 (cache block) —
缓→緩(entire group; also see terminology comment below) - Line 3745
…计费详情—详→詳(cf. existing詳情at lines 717, 1806) - Line 3746
"规则版本": "规則版本"—规→規 - Line 3747
"计费明细": "計費明细"—细→細 - Line 3748
该入口仅用于一次性余额充值—该/仅/用于unconverted - Line 3749
请先选择不低于最低额度的充值金额—请/低于unconverted - Lines 3750–3753
"请输入…"—请→請 - Lines 3758–3766
"输入…", includingToken 数—输→輸,数→數 - Lines 3767–3772
"输出…"—输→輸 - Line 3774
…跳转到 Waffo Pancake 结账页…回到賬户頁—跳转→跳轉; see terminology note for账户 - Line 3776
"错误详情": "錯誤详情"—详→詳 - Line 3778
"阶梯内 Token 数"—内→內,数→數 - Line 3779
"阶梯判断依据"—断→斷,据→據
I recommend regenerating these values through OpenCC (s2twp.json config, which also does TW idiom mapping) and re-checking the diff, rather than partial char-by-char substitution.
Based on learnings from web/src/i18n/locales/zh-TW.json PR #4329 (2026-04-18): zh-TW locale entries are flat string-to-string mappings under translation; values must be valid Traditional Chinese to serve their purpose for zh-TW users.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@web/src/i18n/locales/zh-TW.json` around lines 3638 - 3787, Many of the new
zh-TW values were left in Simplified Chinese (e.g. "Token 类型", "函数", "分时缓存
(Claude)", the whole cache block like "缓存创建", "缓存读取", and phrases such as
"根据用量档位和请求条件动态调整", "充值价格必须大于 0", "请先选择不低于最低额度的充值金额") — regenerate all added
values by running an automated s2t conversion with OpenCC using the s2twp.json
profile (not manual/partial substitutions), replace the current Simplified
values with the OpenCC outputs for each key (e.g. "Token 类型", "函数", "分时缓存
(Claude)", "缓存创建-1小时 (cc1h)", "规则版本", "计费明细", "错误详情", "第 {{n}} 组", etc.), and
then spot-check the previously listed problematic entries and the entire added
block to ensure Traditional Chinese and TW idioms are used consistently before
committing.
51fdfc5 to
2b6f1df
Compare
Summary
Changes
web/src/i18n/locales/zh-TW.jsonTest plan
Summary by CodeRabbit