From ef821831a4bc4008685e419479fe7dc6b4ef85e0 Mon Sep 17 00:00:00 2001 From: Benjamin Admin Date: Tue, 28 Apr 2026 13:37:19 +0200 Subject: [PATCH] Fix: Fallback to English (not German) for unsupported languages When a language like PT, FR, IT is selected but has no translation in exerciseTranslations.ts, the system now falls back to English instead of German. English is more universally understood. Applies to: exercise explanations, button labels, instructions. Co-Authored-By: Claude Opus 4.6 (1M context) --- studio-v2/components/learn/ExerciseLayout.tsx | 1 + studio-v2/lib/NativeLanguageContext.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/studio-v2/components/learn/ExerciseLayout.tsx b/studio-v2/components/learn/ExerciseLayout.tsx index 2b1fbc5..2b7a801 100644 --- a/studio-v2/components/learn/ExerciseLayout.tsx +++ b/studio-v2/components/learn/ExerciseLayout.tsx @@ -68,6 +68,7 @@ export function ExerciseLayout({ const typeKey = exerciseType || title.toLowerCase() const explanation = exerciseExplanation || explanations[typeKey]?.[nativeLang] + || explanations[typeKey]?.['en'] || explanations[typeKey]?.['de'] || '' diff --git a/studio-v2/lib/NativeLanguageContext.tsx b/studio-v2/lib/NativeLanguageContext.tsx index 77aa9c0..d25cc2a 100644 --- a/studio-v2/lib/NativeLanguageContext.tsx +++ b/studio-v2/lib/NativeLanguageContext.tsx @@ -39,7 +39,7 @@ export function NativeLanguageProvider({ children }: { children: React.ReactNode const t = useCallback((key: ExerciseKey): string => { const entry = exerciseT[key] if (!entry) return key - return (entry as Record)[nativeLang] || entry.de || key + return (entry as Record)[nativeLang] || entry.en || entry.de || key }, [nativeLang]) const wordInNative = useCallback((translations?: Record): string => {