Skip to content

fix: Multi-language awareness bugfixes#132

Merged
Peleke merged 5 commits intostagingfrom
bugfix/multi-language-awareness
Jan 7, 2026
Merged

fix: Multi-language awareness bugfixes#132
Peleke merged 5 commits intostagingfrom
bugfix/multi-language-awareness

Conversation

@Peleke
Copy link
Owner

@Peleke Peleke commented Dec 23, 2025

Summary

This PR fixes multiple language awareness issues in the application:

Closes

Closes #129
Closes #130
Closes #131

Changes

File Change
app/api/tts/synthesize/route.ts Fix env var name
app/api/lessons/[lessonId]/generate-from-reading/route.ts Language-agnostic direction detection
lib/languages/index.ts Add getExerciseFeedback() utility
components/exercises/*.tsx Accept language prop, use localized feedback
components/hub/ExercisesRegion.tsx Pass language to exercise components

Test Plan

Automated Tests

  • TTS route tests pass (20 tests)
  • Direction detection tests pass (11 tests)
  • Language config tests pass (38 tests)

Manual UAT Steps

Bug #129: ElevenLabs TTS

  1. Navigate to any lesson with audio content
  2. Click the audio playback button
  3. Expected: Audio should play without "API key not configured" error

Bug #130: Exercise Direction Detection

  1. Create a new Icelandic lesson with a reading
  2. Generate exercises (include translation type)
  3. Check the generated translation exercises in the database
  4. Expected: direction field should be is_to_en or en_to_is, NOT containing 'spanish' or 'latin'

Bug #131: Training Ground Feedback

  1. Navigate to Training Ground for a Spanish lesson

  2. Complete an exercise correctly

  3. Expected: See "¡Correcto!" feedback

  4. Navigate to Training Ground for a Latin lesson

  5. Complete an exercise correctly

  6. Expected: See "Recte!" feedback

  7. Navigate to Training Ground for an Icelandic lesson

  8. Complete an exercise correctly

  9. Expected: See "Rétt!" feedback

🤖 Generated with Claude Code

Peleke Sengstacke and others added 3 commits December 23, 2025 06:00
Change ELEVEN_LABS_API_KEY to ELEVENLABS_API_KEY to match
the deployment configuration in GitHub Actions workflows.

Closes #129

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace hardcoded "spanish"/"latin" string matching with dynamic
language name lookup. Now correctly detects translation direction
for all supported languages including Icelandic.

Closes #130

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add getExerciseFeedback() utility for language-specific success/failure messages
- Update FillBlankExercise, MultipleChoiceExercise, and TranslationExercise
  to accept language prop and display localized feedback
- Update ExercisesRegion to pass language prop to exercise components

Feedback by language:
- Spanish: ¡Correcto! / No del todo
- Latin: Recte! / Non recte
- Icelandic: Rétt! / Ekki alveg

Closes #131

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Peleke
Copy link
Owner Author

Peleke commented Dec 23, 2025

Ready for Review

All automated tests pass. UAT steps are documented in the PR description.

Quick Verification Checklist

Area Test Status
TTS API Unit tests ✅ Pass (20/20)
Direction Detection Unit tests ✅ Pass (11/11)
Language Feedback Unit tests ✅ Pass (38/38 including 3 new)
Type Check No new errors

UAT Summary

  1. TTS Audio - Play audio on any lesson page (requires deployed staging to verify)
  2. Icelandic Exercises - Generate exercises for Icelandic content and verify direction metadata
  3. Training Ground Feedback - Test exercise completion feedback in Spanish/Latin/Icelandic lessons

Peleke Sengstacke and others added 2 commits December 23, 2025 06:27
- Add dark mode variants to NotificationSettings component (alerts, status boxes)
- Add dark mode variants to PWAInstallBanner component
- Add dark mode variants to Flashcards deck management page (25+ fixes)
- Add dark mode variant to Flashcards practice page (mark element)
- Replace text-sepia-* with semantic text-foreground/text-muted-foreground
- Add E2E tests for multi-language exercise feedback

Closes #133 (related diagnosis)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace min-h-screen with min-h-[100dvh] for dynamic viewport height
- Remove redundant min-h-screen from nested mobile dashboard container
- Update hub-container and classic-container CSS classes
- Add pb-8 to mobile dashboard for proper bottom spacing

The 100dvh unit uses dynamic viewport height which properly accounts
for mobile browser chrome (address bar) appearing/disappearing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Peleke
Copy link
Owner Author

Peleke commented Jan 7, 2026

✅ UAT Complete

Tests Performed

Bug #129: ElevenLabs TTS

  • Navigated to Latin lesson with audio content
  • Clicked audio playback button
  • Result: ✅ Audio plays correctly (after fixing env var ELEVEN_LABS_API_KEYELEVENLABS_API_KEY)

Bug #130: Exercise Direction Detection

  • Created Icelandic lesson with reading content
  • Generated exercises including translation type
  • Verified direction field in database
  • Result: ✅ Direction shows is_to_en / en_to_is (not hardcoded Spanish/Latin)

Bug #131: Training Ground Feedback

  • Tested exercises for Spanish lesson → "¡Correcto!" feedback ✅
  • Tested exercises for Latin lesson → "Recte!" feedback ✅
  • Tested exercises for Icelandic lesson → "Rétt!" feedback ✅

Additional Testing

  • Dark mode support on Profile and Flashcards pages ✅
  • Mobile scroll fix verified ✅

Environment

  • Tested on uat/test-all-prs branch with all 3 PRs merged
  • Local dev server + Supabase

Ready to merge 🚀

@Peleke Peleke merged commit 9e27e59 into staging Jan 7, 2026
2 checks passed
@Peleke Peleke deleted the bugfix/multi-language-awareness branch January 7, 2026 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant