feat(i18n): add complete German (de) frontend locale support - #4254
feat(i18n): add complete German (de) frontend locale support#4254Babo96 wants to merge 4 commits into
Conversation
Add German language support for frontend UI: - Create de.json with 3,514 German translations - Register German in language.js supportedLanguages array - Add German variant normalization (de-DE, de-AT, etc.) - Import and register de.json in i18n.js resources - Add German option to LanguageSelector.jsx dropdown - Add German option to PreferencesSettings.jsx language selector - Import and map German Semi UI locale in index.jsx All 3,514 translation keys have been translated to German. Backend continues to return English for German users as intended.
Add German language support for frontend UI: - Create de.json with 3,512 German translations - All translations processed through 36 isolated batch files - Each batch translated by separate agents to ensure quality - Merged all batches back into final de.json - Register German in language.js supportedLanguages array - Add German variant normalization (de-DE, de-AT, etc.) - Import and register de.json in i18n.js resources - Add German option to LanguageSelector.jsx dropdown - Add German option to PreferencesSettings.jsx language selector - Import and map German Semi UI locale in index.jsx Backend continues to return English for German users as intended.
Add German language support for frontend UI: - Create de.json with 3,512 German translations - Split into 30 sequential batches for thorough translation - Processed batches 29-00 sequentially with translation agents - Fixed JSON escaping issues in batches 17 and 26 - Merged all 30 batches back into final de.json - Register German in language.js supportedLanguages array - Add German variant normalization (de-DE, de-AT, etc.) - Import and register de.json in i18n.js resources - Add German option to LanguageSelector.jsx dropdown - Add German option to PreferencesSettings.jsx language selector - Import and map German Semi UI locale in index.jsx Backend continues to return English for German users as intended.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAdds German ("de") language support: UI dropdown options, i18n resource registration, supported language list and normalization, and Semi-UI locale mapping. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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.
🧹 Nitpick comments (1)
web/src/i18n/language.js (1)
57-59: Tighten German variant matching to avoid over-broad normalization.
startsWith('de')also matches unrelated prefixes. Prefer matchingdeorde-*explicitly.♻️ Proposed refinement
- if (lower.startsWith('de')) { + if (lower === 'de' || lower.startsWith('de-')) { return 'de'; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@web/src/i18n/language.js` around lines 57 - 59, The German locale detection using lower.startsWith('de') is too broad; update the check around the `lower` variable (the German branch that currently returns 'de') to only match exactly 'de' or variants starting with 'de-' (e.g., use a conditional like lower === 'de' || lower.startsWith('de-') or an equivalent regex) so unrelated prefixes are not normalized to 'de'.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@web/src/i18n/language.js`:
- Around line 57-59: The German locale detection using lower.startsWith('de') is
too broad; update the check around the `lower` variable (the German branch that
currently returns 'de') to only match exactly 'de' or variants starting with
'de-' (e.g., use a conditional like lower === 'de' || lower.startsWith('de-') or
an equivalent regex) so unrelated prefixes are not normalized to 'de'.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: dcd49651-11d1-471d-8531-8ef6e4fa1f9c
📒 Files selected for processing (6)
web/src/components/layout/headerbar/LanguageSelector.jsxweb/src/components/settings/personal/cards/PreferencesSettings.jsxweb/src/i18n/i18n.jsweb/src/i18n/language.jsweb/src/i18n/locales/de.jsonweb/src/index.jsx
中文:
本次 PR 为 new-api 前端添加了完整的德语(German/de)国际化支持。
做了什么:
web/src/i18n/locales/de.json- 包含 3,516 行的完整德语翻译文件,涵盖所有现有中文/英文界面的对应翻译LanguageSelector.jsx) - 添加德语选项PreferencesSettings.jsx) - 支持德语显示i18n.js) - 注册德语资源language.js) - 添加德语常量定义index.jsx) - 导入德语 locale 配置为什么这样改能生效:
useTranslationhook 动态加载对应语言的翻译English:
This PR adds complete German (de) internationalization support to the new-api frontend.
What was done:
web/src/i18n/locales/de.json- a complete German translation file with 3,516 lines, covering translations for all existing Chinese/English interface elementsLanguageSelector.jsx) - added German optionPreferencesSettings.jsx) - added German display supporti18n.js) - registered German resourceslanguage.js) - added German constant definitionsindex.jsx) - imported German locale configurationWhy this works:
useTranslationhook🚀 变更类型 / Type of change
🔗 关联任务 / Related Issue
✅ 提交前检查项 / Checklist
Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug / If this PR is marked asBug fix, I have submitted or linked the corresponding Issue and will not classify design trade-offs, mismatched expectations, or misunderstandings as bugs.📸 运行证明 / Proof of Work
文件变更概览 / File changes overview:
web/src/i18n/locales/de.json(3,516 行德语翻译 / 3,516 lines of German translations)本地验证步骤 / Local verification steps:
bun install安装依赖 / Runbun installto install dependenciesbun run dev启动开发服务器 / Runbun run devto start the development server截图 / Screenshots:




Summary by CodeRabbit