Skip to content

feat: Add German (de) i18n support#237

Open
nicomusa wants to merge 3 commits into
OpenCoworkAI:mainfrom
nicomusa:i18n-german
Open

feat: Add German (de) i18n support#237
nicomusa wants to merge 3 commits into
OpenCoworkAI:mainfrom
nicomusa:i18n-german

Conversation

@nicomusa

@nicomusa nicomusa commented Jun 2, 2026

Copy link
Copy Markdown

Adds complete German i18n support (~450 translated keys) and registers 'de' as a supported language in the settings UI.

Changes

  • \src/renderer/i18n/locales/de.json\ — 917 lines, complete German translation across all UI sections
  • \src/renderer/i18n/config.ts\ — register \de\ as supported language
  • \src/renderer/components/settings/SettingsGeneral.tsx\ — add German to language switcher

Adds complete German i18n support (~450 translated keys) and registers 'de' as a supported language in the settings UI.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review mode: initial

Findings

  • [Minor] Language detection in SettingsGeneral uses startsWith for German
    src/renderer/components/settings/SettingsGeneral.tsx:11-13 uses i18n.language.startsWith('de') to detect German. This would also match variants like de-AT, de-DE, etc. While this is functional for these variants, consider using an exact match or the language code normalization (e.g., i18n.language.split('-')[0] === 'de') to avoid potential ambiguity.
    Suggested fix:

    const lang = i18n.language.split('-')[0];
    const currentLang = lang === 'zh' ? 'zh' : lang === 'de' ? 'de' : 'en';
  • [Minor] Missing fallback for some common keys?
    The German translation file (de.json) appears comprehensive, but a spot-check reveals the absence of keys like common.search, common.remove, common.download, and common.import that might exist in the English locale. If these keys are used elsewhere with a fallback string (e.g., t('common.remove', 'Remove')), no issue occurs. However, if they are used without a fallback, the displayed text will be empty. Recommend verifying that all keys used in the UI either have a fallback value or a translation.
    Suggested fix: Ensure all t() calls provide a fallback string, or audit the English locale for keys not present in de.json.

  • [Nit] Removal of Chinese comments in config.ts
    Two Chinese comments were removed from src/renderer/i18n/config.ts. While not functionally impactful, this reduces code readability for Chinese-speaking developers. Consider re-adding them in English for consistency.

Summary
The PR adds complete German i18n support (~917 lines of translations) and registers German as a supported language. The implementation is solid: de.json covers all major UI sections, uses proper pluralization keys, and includes correct parameter interpolation. The integration in config.ts and SettingsGeneral.tsx is clean and follows existing patterns. No regressions or security issues were identified.

Testing
No automated tests were added for the new locale. Consider adding a test that verifies all keys from the English locale exist in de.json to prevent future translation gaps. This can be done by comparing key structures or using a snapshot test.

Open Cowork Bot

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review mode: follow-up after new commits

Findings

  • [Minor] Unresolved: Language detection using startsWith
    As noted in the previous review, src/renderer/components/settings/SettingsGeneral.tsx:11-13 uses startsWith('de'), which matches de-AT, de-DE, etc. This is not addressed in the new commits. Consider normalizing the language code before comparison.

  • [Minor] Unresolved: Possible missing translation keys
    The previous review flagged that keys like common.search, common.remove, common.download, and common.import may be absent from de.json if they exist in the English locale. This has not been verified. Ensure all keys used in the UI either have a German translation or a fallback string in t() calls.

  • [Nit] Unresolved: Chinese comments removed
    Two Chinese comments were removed from src/renderer/i18n/config.ts. Not functionally impactful, but reduces readability for Chinese-speaking developers.

What's improved
The only changes in this follow-up are the addition of the "german" translation key to en.json and zh.json. This ensures the language name “German” / “德语” appears correctly when the German locale is active, addressing a gap from the initial PR. No new issues introduced.

Summary
The new commits add the missing "german" key to English and Chinese language files. The three minor issues from the previous review remain unaddressed. No regressions or security issues.

Testing
Not run (automation). Consider adding a test that verifies all keys from the English locale are present in de.json to prevent translation drift.

Open Cowork Bot

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review mode: follow-up after new commits

Findings

  • [Minor] Resolved: Language detection normalized
    The previous review flagged that i18n.language.startsWith('de') would incorrectly match regional variants like de-AT. The new commit replaces this with i18n.language.split('-')[0] and exact equality checks (lang === 'zh' ? 'zh' : lang === 'de' ? 'de' : 'en'), which correctly handles de-DE, de-CH, etc. (src/renderer/components/settings/SettingsGeneral.tsx:11-13)

  • Previous review items re-evaluated

    • Possible missing translation keys: Based on the provided excerpts, the German locale (de.json) contains all keys present in the English locale under the sections shown (e.g., language.english, language.chinese, language.german). The translation appears complete. No evidence of missing keys was found in the examined context.
    • Chinese comments removed from config.ts: The new commit replaced Chinese comments with English ones. This is a stylistic choice with no functional impact.
  • No new issues introduced
    The only code changes beyond the de.json file are the language detection fix and English comment additions. No regressions, security concerns, or data loss risks are introduced.

Summary
The follow-up commits successfully address the previous review's main concern (language detection). The PR remains a clean addition of German i18n support with all necessary infrastructure changes. No action required.

Testing
Not run (automation). Consider adding a test that validates all keys from the English locale are present in de.json to prevent translation drift in future updates.

Open Cowork Bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant