fix(desktop): add German (de) desktop locale with review fixes - #71161
Karaboja98 wants to merge 3 commits into
Conversation
- Add missing composer.queue translation ('Nachricht in Warteschlange')
- Fix settings.config.imported: was 'Automatisches Speichern fehlgeschlagen', now 'Konfiguration importiert'
- Fix settings.appearance.importedBadge: was 'Design entfernen', now 'Importiert'
- Fix about.justNowSuffix: was '· just now', now '· gerade eben'
- Fix Petdex capitalization (proper noun) in appearance.pet.unreachable
- Fix backendOutOfDateMessage: clarify pronoun reference
- Add trailing newline to de.ts
- Add regression tests for all fixes in de.test.ts
- Update DESIGN.md: document five locales and defineLocale() fallback
Verification:
- tsc --noEmit: passed (0 errors)
- vitest src/i18n: 39/39 tests passed
- npm run build: successful
Closes NousResearch#67077
|
Replaces #67077 with a clean scope and additional fixes. Scope isolation: only 8 i18n files touched (verified via Beyond the original sweeper fixes, this PR also addresses:
Each fix has a regression test in Verification (all green on this branch):
Happy to adjust wording or split into separate commits if preferred. |
Duplicate of #51762: both open PRs add the same Desktop German locale, catalog registration, type union, and picker aliases. This PR's review-cleanup coverage is useful context for the canonical implementation; it also replaces the author's earlier #67077 attempt. |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the focused locale addition and the registration/tests work. The feature is still absent from current main (apps/desktop/src/i18n/types.ts:8, catalog.ts:8-14), but a few visible strings remain untranslated.
Problems
apps/desktop/src/i18n/de.ts:1364-1366,:1380, and:1477-1478are English profile/cron destructive-dialog fragments. They render directly inapps/desktop/src/app/profiles/delete-profile-dialog.tsx:30-34andapps/desktop/src/app/cron/index.tsx:548-550.apps/desktop/src/i18n/de.ts:1945returns English installer-stage text. The current test walker inde.test.ts:72-90does not execute function-valued translations, so it cannot catch this class.
Suggested changes
- Translate those remaining fragments/functions while retaining their interpolation boundaries.
- Add focused assertions for the assembled destructive descriptions and
de.install.currentStage('…').
This is an automated hermes-sweeper review.
Address teknium1 review comments on PR NousResearch#71161: - Translate profiles.deleteDescPrefix/Mid/Suffix (delete-profile-dialog) - Translate profiles.renameDescPrefix (rename dialog) - Translate cron.deleteDescPrefix/Suffix (cron delete dialog) - Translate install.currentStage() function (installer stage text) - Add focused regression tests for all translated fragments, including direct assertions for assembled destructive descriptions and de.install.currentStage() — the generic leaf walker does not execute function-valued translations. Verification: - tsc --noEmit: 0 errors - vitest src/i18n: 43/43 tests passed (4 new tests added)
What does this PR do?
Adds German (
de) as a sixth Hermes Desktop locale. German is now available in Settings → Appearance → Language and maps todisplay.language: de.The locale uses
defineLocale()so any missing desktop-only keys fall back to English while remaining type-checked against the sharedTranslationscontract.Related Issue
Supersedes #67077 (same author, cleaned up scope and additional fixes).
Type of Change
Changes Made
New files
apps/desktop/src/i18n/de.ts— German desktop UI copy (2613 lines,defineLocale())apps/desktop/src/i18n/de.test.ts— corruption guard + semantic regression testsRegistration
types.ts— addeddetoLocaleunionlanguages.ts— addedLOCALE_OPTIONSentry + aliases:de,de-de,de_de,de-at,de_at,de-ch,de_ch,deutsch,germancatalog.ts— imported and registereddeinTRANSLATIONSTests
languages.test.ts— normalization coverage for all de aliases includingde-AT/de-CHcontext.test.tsx—loads de from display.language configtestde.test.ts— 10 tests covering boot copy, keybind labels, import/export collision, Starmap import semantics (5 distinct values), singular/plural resume, corruption guard, plus regression guards for the 3 copy-paste bugs found during reviewDocumentation
DESIGN.md— updated locale list to five, noteddefineLocale()fallback behaviorReview fixes (from #67077 sweeper + follow-up audit)
Kopiert!resumeWhenBackgroundDone(1)${count}in quotesde-AT/de-CHaliasesLOCALE_ALIASESsettings.config.importedautosaveFailedKonfiguration importiertsettings.appearance.importedBadgeremoveThemeImportiertabout.justNowSuffixgerade ebencomposer.queueNachricht in WarteschlangepetdexcapitalizationunreachablePetdex(proper noun)backendOutOfDateMessagedie Versionende.tsHow to Test
cd apps/desktop && npx tsc --noEmit -p tsconfig.json→ 0 errorscd apps/desktop && npx vitest run src/i18n --environment jsdom→ 39 tests passcd apps/desktop && npm run build→ exit 0Verification performed
npx tsc --noEmit -p tsconfig.json— 0 errorsnpx vitest run src/i18n --environment jsdom— 39/39 passednpm run build— successful,assert-dist-builtpassedgit diff --stat origin/main— only 8 expected i18n files touched (clean scope isolation)