feat: localize various UI texts and labels to Spanish across application pages and interactive components.

This commit is contained in:
2026-01-16 23:25:36 -03:00
parent 2cfd1f204b
commit ffbef17396
19 changed files with 178 additions and 181 deletions
@@ -42,7 +42,7 @@ export default function LessonPlayerPage({ params }: { params: { id: string, les
setUserGrade(currentGrade || null);
}
} catch (err) {
console.error("Failed to load lesson data", err);
console.error("Error al cargar los datos de la lección", err);
} finally {
setLoading(false);
}
@@ -50,8 +50,8 @@ export default function LessonPlayerPage({ params }: { params: { id: string, les
fetchAll();
}, [params.id, params.lessonId, user]);
if (loading) return <div className="p-20 text-center animate-pulse text-gray-500 font-bold uppercase tracking-widest">Loading Experience...</div>;
if (!lesson || !course) return <div className="p-20 text-center text-red-400">Content not found.</div>;
if (loading) return <div className="p-20 text-center animate-pulse text-gray-500 font-bold uppercase tracking-widest">Cargando Experiencia...</div>;
if (!lesson || !course) return <div className="p-20 text-center text-red-400">Contenido no encontrado.</div>;
const allLessons = course.modules.flatMap(m => m.lessons);
const currentIndex = allLessons.findIndex(l => l.id === params.lessonId);
@@ -76,7 +76,7 @@ export default function LessonPlayerPage({ params }: { params: { id: string, les
className={`glass border-r border-white/5 transition-all duration-500 bg-black/40 flex flex-col ${sidebarOpen ? 'w-80' : 'w-0 overflow-hidden border-none'}`}
>
<div className="p-6 border-b border-white/5">
<h2 className="text-xs font-black uppercase tracking-widest text-blue-500 mb-1">Course Content</h2>
<h2 className="text-xs font-black uppercase tracking-widest text-blue-500 mb-1">Contenido del Curso</h2>
<p className="text-sm font-bold text-white truncate">{course.title}</p>
</div>
@@ -108,7 +108,7 @@ export default function LessonPlayerPage({ params }: { params: { id: string, les
<button
onClick={() => setSidebarOpen(!sidebarOpen)}
className="p-3 rounded-xl glass border-white/10 text-gray-400 hover:text-white transition-all bg-black/40"
title="Toggle Sidebar"
title="Alternar Barra Lateral"
>
<Menu size={20} />
</button>
@@ -116,7 +116,7 @@ export default function LessonPlayerPage({ params }: { params: { id: string, les
<button
onClick={() => setTranscriptOpen(!transcriptOpen)}
className={`p-3 rounded-xl glass border-white/10 transition-all bg-black/40 ${transcriptOpen ? 'text-blue-400' : 'text-gray-400 hover:text-white'}`}
title="Toggle Transcript"
title="Alternar Transcripción"
>
<ListMusic size={20} />
</button>
@@ -128,7 +128,7 @@ export default function LessonPlayerPage({ params }: { params: { id: string, les
<div className="max-w-4xl mx-auto space-y-20 pb-40">
<div className="space-y-4">
<div className="flex items-center gap-2 text-[10px] font-black uppercase tracking-widest text-blue-400">
<span>{lesson.content_type === 'activity' ? 'Interactive Activity' : 'Video Lesson'}</span>
<span>{lesson.content_type === 'activity' ? 'Actividad Interactiva' : 'Lección en Video'}</span>
</div>
<h1 className="text-4xl font-black tracking-tighter text-white">{lesson.title}</h1>
</div>
@@ -136,7 +136,7 @@ export default function LessonPlayerPage({ params }: { params: { id: string, les
{lesson.summary && (
<div className="p-8 rounded-3xl bg-gradient-to-br from-blue-500/10 to-indigo-500/10 border border-blue-500/20 animate-in fade-in slide-in-from-top-4 duration-1000">
<h3 className="text-[10px] font-black uppercase tracking-[0.3em] text-blue-400 mb-4 flex items-center gap-2">
<span className="text-base"></span> Summary
<span className="text-base"></span> Resumen
</h3>
<p className="text-lg text-gray-300 leading-relaxed font-medium italic">
&quot;{lesson.summary}&quot;
@@ -183,7 +183,7 @@ export default function LessonPlayerPage({ params }: { params: { id: string, les
);
setUserGrade(res);
} catch (err) {
console.error("Failed to persist play count", err);
console.error("Error al guardar el recuento de reproducciones", err);
}
}
}}
@@ -219,7 +219,7 @@ export default function LessonPlayerPage({ params }: { params: { id: string, les
);
setUserGrade(res);
} catch (err) {
console.error("Failed to persist block attempts", err);
console.error("Error al guardar los intentos del bloque", err);
}
}
}}
@@ -248,7 +248,7 @@ export default function LessonPlayerPage({ params }: { params: { id: string, les
</div>
) : (
<div className="py-20 text-center glass-card border-dashed border-white/10">
<p className="text-gray-500 font-bold uppercase tracking-widest">This lesson currently has no content.</p>
<p className="text-gray-500 font-bold uppercase tracking-widest">Actualmente, esta lección no tiene contenido.</p>
</div>
)}
@@ -257,12 +257,12 @@ export default function LessonPlayerPage({ params }: { params: { id: string, les
{userGrade && lesson.max_attempts && userGrade.attempts_count >= lesson.max_attempts ? (
<div className="space-y-4">
<div className="inline-flex items-center gap-2 px-6 py-2 bg-amber-500/10 border border-amber-500/30 text-amber-400 rounded-full text-xs font-black uppercase tracking-widest">
Locked: Maximum attempts reached ({lesson.max_attempts})
Bloqueado: Se alcanzó el máximo de intentos ({lesson.max_attempts})
</div>
<div className="text-4xl font-black text-white">
Score: <span className="text-blue-500">{userGrade.score * 100}%</span>
Puntuación: <span className="text-blue-500">{userGrade.score * 100}%</span>
</div>
<p className="text-gray-500 text-xs italic">This assessment is now closed for further submissions.</p>
<p className="text-gray-500 text-xs italic">Esta evaluación ya está cerrada para futuras entregas.</p>
</div>
) : (
<>
@@ -273,23 +273,23 @@ export default function LessonPlayerPage({ params }: { params: { id: string, les
// In a real scenario, we'd calculate the actual score from blocks
const res = await lmsApi.submitScore(user.id, params.id, params.lessonId, 1.0);
setUserGrade(res);
alert("Score submitted successfully!");
alert("¡Puntuación enviada con éxito!");
} catch (err) {
console.error("Submission failed", err);
alert("Failed to submit score. Please try again.");
console.error("Falló el envío", err);
alert("Error al enviar la puntuación. Por favor, inténtalo de nuevo.");
}
}
}}
className="btn-premium px-12 py-4 rounded-2xl shadow-blue-500/40 shadow-xl group/btn"
>
<span className="flex items-center gap-2 font-black italic">
{userGrade ? `SUBMIT ATTEMPT ${userGrade.attempts_count + 1}` : 'SUBMIT FOR GRADING'}
{userGrade ? `ENVIAR INTENTO ${userGrade.attempts_count + 1}` : 'ENVIAR PARA CALIFICAR'}
<CheckCircle2 className="w-5 h-5 group-hover/btn:scale-110 transition-transform" />
</span>
</button>
{lesson.max_attempts && (
<p className="mt-4 text-[10px] text-gray-500 font-bold uppercase tracking-widest">
Attempt {userGrade ? userGrade.attempts_count : 0} of {lesson.max_attempts} used
Intento {userGrade ? userGrade.attempts_count : 0} de {lesson.max_attempts} usado
</p>
)}
</>
@@ -319,7 +319,7 @@ export default function LessonPlayerPage({ params }: { params: { id: string, les
<ChevronLeft size={20} />
</div>
<div className="hidden sm:block">
<p className="text-[10px] font-black uppercase tracking-widest text-gray-500">Previous</p>
<p className="text-[10px] font-black uppercase tracking-widest text-gray-500">Anterior</p>
<p className="text-xs font-bold text-gray-300 group-hover:text-white truncate max-w-[120px]">{prevLesson.title}</p>
</div>
</Link>
@@ -332,17 +332,17 @@ export default function LessonPlayerPage({ params }: { params: { id: string, les
))}
</div>
<span className="text-[10px] font-black uppercase tracking-widest text-gray-500 ml-4">
{currentIndex + 1} OF {allLessons.length} COMPLETED
{currentIndex + 1} OF {allLessons.length} COMPLETADO
</span>
</div>
{nextLesson ? (
<Link href={`/courses/${params.id}/lessons/${nextLesson.id}`} className="btn-premium !py-3 !px-6 text-xs !shadow-none">
Next Lesson <ChevronRight size={18} />
Siguiente Lección <ChevronRight size={18} />
</Link>
) : (
<Link href="/" className="btn-premium !bg-green-600 !py-3 !px-6 text-xs !shadow-none">
Finish Course <CheckCircle2 size={18} />
Finalizar Curso <CheckCircle2 size={18} />
</Link>
)}
</footer>