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) <noreply@anthropic.com>
Replaced localStorage-only hook with React Context Provider.
Layout and page components now share the same state — switching
language in the dropdown instantly updates all text on screen
without requiring a page reload.
NativeLanguageProvider added to root layout.tsx.
useNativeLanguage() re-exported from Context for backward compat.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
useNativeLanguage: Now has setNativeLang() that persists to localStorage.
Language selection carries across all pages automatically.
LanguageSwitcher: Compact dropdown component added to learn/layout.tsx
and parent/layout.tsx — visible on every sub-page (top-right).
Parent portal: Language dropdown syncs both UI language and native
language. Parents can switch language mid-session (e.g. when both
parents speak different languages).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
useNativeLanguage.ts: Hook that reads bp_native_language from
localStorage and provides t(key) for translated UI text and
wordInNative() for vocabulary translations.
exerciseTranslations.ts: All exercise UI strings in DE/EN/TR/AR/UK/RU/PL.
Buttons (Richtig/Falsch), instructions, labels, result texts.
Next: Wire into all 9 exercise pages for trilingual display.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Turbopack doesn't support tsconfig path aliases pointing outside
the project root. Reverted to copying shared types directly into
each service. The canonical source remains shared/types/*.ts,
synced via scripts/sync-shared-types.sh.
Changes:
- Reverted docker-compose.yml contexts to ./service
- Reverted Dockerfiles to simple COPY . .
- Removed @shared/* from tsconfigs
- Removed symlinks + .gitignore hacks
- Added scripts/sync-shared-types.sh for keeping copies in sync
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Shared types extracted to shared/types/:
- companion.ts (33+ types, was 100% duplicated admin-lehrer ↔ studio-v2)
- klausur.ts (18+ types, was 95% duplicated across 4 locations)
- ocr-labeling.ts (11 types, was 100% duplicated admin-lehrer ↔ website)
Original type files replaced with re-exports for backward compat.
tsconfig.json paths updated with @shared/* alias in all 3 services.
Docker: Changed build context from ./service to . (root) so shared/
is accessible. Dockerfiles updated to COPY service/ + shared/.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>