Unify language system: one setting for all modules
Some checks failed
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-school (push) Successful in 41s
CI / test-go-edu-search (push) Successful in 30s
CI / test-python-klausur (push) Failing after 2m29s
CI / test-python-agent-core (push) Successful in 19s
CI / test-nodejs-website (push) Successful in 26s

- Merge two separate language systems (bp_language + bp_native_language) into one
- NativeLanguageContext now reads from LanguageContext (same localStorage key)
- Extend i18n.ts to 26 languages with flags (UI falls back to EN/DE)
- Replace LanguageSwitcher with LanguageDropdown (flags) in learn + parent layouts
- Migration: old bp_native_language value auto-migrates to bp_language
- Onboarding page writes to bp_language (unified key)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-04-29 16:54:27 +02:00
parent a30f10a467
commit 0018076ed5
6 changed files with 57 additions and 41 deletions

View File

@@ -43,9 +43,9 @@ export function LanguageProvider({ children }: { children: ReactNode }) {
}
}
// Uebersetzungsfunktion
// Uebersetzungsfunktion (Fallback: en → de → key)
const t = (key: string): string => {
return translations[language][key] || translations[defaultLanguage][key] || key
return translations[language]?.[key] || translations['en']?.[key] || translations['de']?.[key] || key
}
// Waehrend SSR: Default anzeigen
@@ -55,7 +55,7 @@ export function LanguageProvider({ children }: { children: ReactNode }) {
value={{
language: defaultLanguage,
setLanguage: () => {},
t: (key) => translations[defaultLanguage][key] || key,
t: (key) => translations[defaultLanguage]?.[key] || key,
isRTL: false,
availableLanguages,
}}