From 5f700a70676dcfe4696a7d71307929e1a7164e68 Mon Sep 17 00:00:00 2001 From: SGD-DEV Date: Wed, 15 Jul 2026 20:31:07 +0200 Subject: [PATCH] fix(i18n/de): address code review findings - Remove broken `import type { I18nDictionary } from '../types'` from de.ts and de.settings.ts; match the untyped style of fr.ts/fr.settings.ts - Add `de`/`de-*` case to normalizeLocale() in runtime.ts so browser locale auto-detection picks up German without manual Settings change - Fix ternary indentation in store.ts to match surrounding pl/ja branches --- packages/ui/src/lib/i18n/messages/de.settings.ts | 4 +--- packages/ui/src/lib/i18n/messages/de.ts | 3 +-- packages/ui/src/lib/i18n/runtime.ts | 3 +++ packages/ui/src/lib/i18n/store.ts | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/ui/src/lib/i18n/messages/de.settings.ts b/packages/ui/src/lib/i18n/messages/de.settings.ts index 0558eaa5..e0ed121c 100644 --- a/packages/ui/src/lib/i18n/messages/de.settings.ts +++ b/packages/ui/src/lib/i18n/messages/de.settings.ts @@ -1,6 +1,4 @@ -import type { I18nDictionary } from '../types'; - -export const settingsDict: Partial = { +export const settingsDict = { 'settings.providers.page.openCodeGo.title': 'OpenCode Go Nutzungsverfolgung', 'settings.providers.page.openCodeGo.description': 'Verbinden Sie das OpenCode Go Dashboard, um rollierenden, wöchentlichen und monatlichen Verbrauch anzuzeigen.', 'settings.providers.page.openCodeGo.workspaceId': 'Workspace-ID', diff --git a/packages/ui/src/lib/i18n/messages/de.ts b/packages/ui/src/lib/i18n/messages/de.ts index 57aaad1a..5873f24f 100644 --- a/packages/ui/src/lib/i18n/messages/de.ts +++ b/packages/ui/src/lib/i18n/messages/de.ts @@ -1,7 +1,6 @@ import { settingsDict } from './de.settings'; -import type { I18nDictionary } from '../types'; -export const dict: Partial = { +export const dict = { ...settingsDict, 'common.language.german': 'Deutsch', 'chat.message.userText.collapseAria': 'Benutzer-Nachricht einklappen', diff --git a/packages/ui/src/lib/i18n/runtime.ts b/packages/ui/src/lib/i18n/runtime.ts index 983ea2ca..7e131bf5 100644 --- a/packages/ui/src/lib/i18n/runtime.ts +++ b/packages/ui/src/lib/i18n/runtime.ts @@ -60,6 +60,9 @@ export function normalizeLocale(value: string | undefined | null): Locale { if (normalized === 'ja' || normalized.startsWith('ja-')) { return 'ja'; } + if (normalized === 'de' || normalized.startsWith('de-')) { + return 'de'; + } if (normalized === 'pl' || normalized.startsWith('pl-')) { return 'pl'; } diff --git a/packages/ui/src/lib/i18n/store.ts b/packages/ui/src/lib/i18n/store.ts index e2e0c3a5..19a2eb27 100644 --- a/packages/ui/src/lib/i18n/store.ts +++ b/packages/ui/src/lib/i18n/store.ts @@ -43,10 +43,10 @@ async function loadDictionary(locale: Locale): Promise { : locale === 'pl' ? await import('./messages/pl') as { dict: I18nDictionary } : locale === 'de' - ? await import('./messages/de') as { dict: I18nDictionary } - : locale === 'ja' - ? await import('./messages/ja') as { dict: I18nDictionary } - : { dict: enDict }; + ? await import('./messages/de') as { dict: I18nDictionary } + : locale === 'ja' + ? await import('./messages/ja') as { dict: I18nDictionary } + : { dict: enDict }; dictionaries.set(locale, mod.dict); return mod.dict; }