Wire all 7 learn pages to central translation system
All exercise pages now use useNativeLanguage() hook: - Buttons show text in user's native language (Richtig→Dogru, etc.) - Instructions translated (Geschafft→Bitti, Nochmal→Tekrar, etc.) - wordInNative() available for vocab translations (needs data) Pages updated: flashcards, quiz, type, listen, match, pronounce, story. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import React, { useState, useEffect, useCallback } from 'react'
|
||||
import { useParams, useRouter } from 'next/navigation'
|
||||
import { useTheme } from '@/lib/ThemeContext'
|
||||
import { useNativeLanguage } from '@/lib/useNativeLanguage'
|
||||
import { QuizQuestion } from '@/components/learn/QuizQuestion'
|
||||
|
||||
interface MCQuestion {
|
||||
@@ -21,6 +22,7 @@ export default function QuizPage() {
|
||||
const { unitId } = useParams<{ unitId: string }>()
|
||||
const router = useRouter()
|
||||
const { isDark } = useTheme()
|
||||
const { t, wordInNative, nativeLang, isThirdLanguage } = useNativeLanguage()
|
||||
|
||||
const [questions, setQuestions] = useState<MCQuestion[]>([])
|
||||
const [currentIndex, setCurrentIndex] = useState(0)
|
||||
@@ -110,7 +112,7 @@ export default function QuizPage() {
|
||||
{stats.correct === questions.length ? '🏆' : stats.correct > stats.incorrect ? '🎉' : '💪'}
|
||||
</div>
|
||||
<h2 className={`text-2xl font-bold mb-2 ${isDark ? 'text-white' : 'text-slate-900'}`}>
|
||||
{stats.correct === questions.length ? 'Perfekt!' : 'Geschafft!'}
|
||||
{stats.correct === questions.length ? 'Perfekt!' : t('done')}
|
||||
</h2>
|
||||
<p className={`text-lg mb-4 ${isDark ? 'text-white/70' : 'text-slate-600'}`}>
|
||||
{stats.correct} von {questions.length} richtig
|
||||
|
||||
Reference in New Issue
Block a user