Fix/i18n chinese translations - #2993
Conversation
- Add Chinese translations for arena, compress, copy, export, hooks, restore, summary commands - Fix missing translation keys: 'Value:', 'No server selected' - Use t() function for internationalization in command files - Update en.js and zh.js with corresponding translation keys
- Add missing t() call for 'Configuration not available' in arena start action
| // ============================================================================ | ||
| // Commands - Hooks | ||
| // ============================================================================ | ||
| 'Configured Hooks ({{count}} total)': |
There was a problem hiding this comment.
[Critical] This change adds a second Configured Hooks ({{count}} total) entry to en.js, so ESLint fails with no-dupe-keys and one definition will silently override the other at runtime. Please keep only one canonical entry for this key.
| 'Configured Hooks ({{count}} total)': | |
| 'Configured Hooks ({{count}} total)': | |
| 'Configured Hooks ({{count}} total)', |
— gpt-5.4 via Qwen Code /review
| // ============================================================================ | ||
| // Commands - Hooks | ||
| // ============================================================================ | ||
| 'Configured Hooks ({{count}} total)': |
There was a problem hiding this comment.
[Critical] This change adds a second Configured Hooks ({{count}} total) entry to zh.js, so ESLint fails with no-dupe-keys and one definition will silently override the other at runtime. Please keep only one canonical entry for this key.
| 'Configured Hooks ({{count}} total)': | |
| 'Configured Hooks ({{count}} total)': | |
| '已配置的 Hook(共 {{count}} 个)', |
— gpt-5.4 via Qwen Code /review
| messageType: 'error', | ||
| content: | ||
| 'Usage: /arena start --models model1,model2 <task>\n' + | ||
| t('Arena usage: /arena start --models model1,model2 <task>') + '\n' + |
There was a problem hiding this comment.
[Suggestion] buildArenaExecutionInput() now calls t('Options:') and t('Examples:'), but the new locale entries were added as Options / Examples without the trailing colon. Those lookups miss the translation table and fall back to English, so part of /arena help remains untranslated in Chinese mode.
| t('Arena usage: /arena start --models model1,model2 <task>') + '\n' + | |
| t('Options') + ':\n' + |
— gpt-5.4 via Qwen Code /review
|
This pull request has had no activity for 60 days and is being marked as stale. It will be closed in another 30 days if no further activity occurs. To keep it open, push a new commit or leave a comment. Maintainers may apply |
|
@copilot resolve the merge conflicts in this pull request |
|
@qwen-code /resolve |
Merge origin/main into fix/i18n-chinese-translations. Resolve conflicts in 8 files by preferring main's refactored command implementations (arenaCommand, copyCommand, exportCommand, hooksCommand, restoreCommand) while preserving the PR's i18n intent. Combine both sides for compressCommand to retain main's truncationNotice prefix with the PR's t() wrapping. Add missing translation keys for compress-related strings to both en.js and zh.js locale files.
|
Qwen Code resolved the merge conflicts and pushed the branch update. Merge Conflict Resolution Summary — PR #2993PR: fix/i18n chinese translationsBase: mainConflicts (8 files)Command files resolved by taking origin/main (5 files)These files conflicted because the PR wrapped strings with
compressCommand.ts — Combined both sidesThe PR wrapped compression messages with Locale files (2 files)
|
DragonnZhang
left a comment
There was a problem hiding this comment.
Code Review
Reviewed the translation additions in en.js/zh.js and the t() wrapper insertions in compressCommand.ts and summaryCommand.ts.
Translation keys match between the two locale files, the Chinese translations look accurate, and the t() calls use the correct interpolation syntax ({{originalTokens}}, {{newTokens}}, {{max}}). The typo fix in summaryCommand.ts (missing t() wrapper) is correct. No issues found.
Generated by Claude Code
DragonnZhang
left a comment
There was a problem hiding this comment.
Code Review
Reviewed the i18n changes in compressCommand.ts, summaryCommand.ts, en.js, and zh.js.
The compressCommand.ts changes look correct — all three new translation keys (Compressing context..., Compression instructions were truncated to {{max}} characters., Context compressed ({{originalTokens}} -> {{newTokens}}).) are present in both en.js and zh.js, and the interpolation parameters match.
One issue found in summaryCommand.ts (see inline comment).
| const markdownSummary = await generateSummaryMarkdown(history); | ||
| if (abortSignal?.aborted) { | ||
| throw new DOMException('Summary generation cancelled.', 'AbortError'); | ||
| throw new DOMException(t('Summary generation cancelled.'), 'AbortError'); |
There was a problem hiding this comment.
[Bug] t('Summary generation cancelled.') is called here, but the key 'Summary generation cancelled.' was not added to either en.js or zh.js.
The t() function falls back to returning the raw key string when no translation entry exists. Under Chinese locale the user will see the English text 'Summary generation cancelled.' embedded inside the Chinese error template (e.g. 无法生成项目上下文摘要:Summary generation cancelled.), which defeats the purpose of this PR.
Fix: Add the missing key to both locale files:
en.js:'Summary generation cancelled.': 'Summary generation cancelled.',zh.js:'Summary generation cancelled.': '摘要生成已取消。',
|
@qwen-code /triage |
…7389) * fix(ci): stop /resolve reports from being guillotined mid-sentence Every substantive /resolve summary was hitting the 2000-byte cap exactly and stopping mid-word: #2993, #4256 and #6206 all ended at 2100 bytes total, cut inside a sentence, with nothing saying the report had been clipped rather than abandoned. Two causes, both fixed: - The contract asked for a file-by-file inventory, which duplicates the diff and grows without bound. It now asks for what only the resolver knows — the root cause on the base branch, whether the merge was semantic or merely textual, what the resolution's correctness rests on, and what it could not verify (this command runs no tests and may not touch non-conflicted files, so a merge that breaks an untouched test can only be reported). - The cap was silent and too low. It is now 6000, above the 4000 the prompt asks for, and a report that still exceeds it says so. Also adds the project's collapsed Chinese section to the contract; no /resolve report had one. * fix(ci): make the truncation test fatal-decode real and link the run in the notice (#7389) --------- Co-authored-by: wenshao <wenshao@example.com> Co-authored-by: qwen-code-dev-bot <qwen-code-dev@service.alibaba.com>
Summary
Fix commands that still show English text after switching to Chinese with
/language ui.Problem
After running
/language ui zhto switch to Chinese UI, several commands still display English text:/arena- Arena session commands/compress- Context compression command/copy- Copy output command/export- Session export command/hooks- Hook management command/restore- Tool call restore command/summary- Project summary commandChanges
1. Added missing translation keys
'Value:'→'Value:'(Chinese:'值:')'No server selected'→'No server selected'(Chinese:'未选择服务器')2. Fixed hardcoded strings
t()function calls in command files3. Added Arena command translations
Test Plan
/language ui zhto switch to Chinese UI/arena startand verify Arena commands show Chinese/compressand verify compression command shows Chinese/copyand verify copy command shows Chinese/export mdand verify export command shows Chinese/hooks listand verify Hooks command shows Chinese/restoreand verify restore command shows Chinese/summaryand verify summary command shows Chinese