feat(i18n): traducir la app de alumnos (con selector de idioma en Perfil)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jose Selesan
2026-11-03 14:05:21 -03:00
parent 486fbaf2ca
commit 4d50b46399
27 changed files with 887 additions and 152 deletions

View File

@@ -5,9 +5,11 @@ import { Badge } from '../../components/ui'
import { formatPrice } from '../../lib/format'
import { feeLabel } from './format'
import { FeeStatusBadge } from './FeeStatusBadge'
import { useTranslation } from 'react-i18next'
/* "Tu cuota": only while there is something unpaid. */
export function FeeCard({ fees }: { fees: StudentFee[] }) {
const { t } = useTranslation(['student', 'common'])
if (fees.length === 0) return null
const first = fees[0] as StudentFee
const toReport = fees.filter((fee) => fee.status !== 'reported')
@@ -21,9 +23,9 @@ export function FeeCard({ fees }: { fees: StudentFee[] }) {
<article className="rounded-2xl border border-border bg-surface p-5">
<div className="flex items-start justify-between gap-3">
<div className="min-w-0">
<p className="text-xs font-semibold uppercase tracking-wide text-secondary">Tu cuota</p>
<p className="text-xs font-semibold uppercase tracking-wide text-secondary">{t('fee.yourFee')}</p>
<h2 className="mt-1 truncate text-lg font-bold text-primary">
{fees.length === 1 ? feeLabel(first) : `${fees.length} cuotas sin pagar`}
{fees.length === 1 ? feeLabel(first) : t('fee.unpaid', { count: fees.length })}
</h2>
<p className="mt-1 text-2xl font-bold text-primary">
{formatPrice(toReport.length > 0 ? total : first.amount, first.currency)}
@@ -32,19 +34,19 @@ export function FeeCard({ fees }: { fees: StudentFee[] }) {
{fees.length === 1 ? (
<FeeStatusBadge status={first.status} />
) : toReport.some((fee) => fee.status === 'overdue') ? (
<Badge variant="warning">Hay vencidas</Badge>
<Badge variant="warning">{t('fee.overdue')}</Badge>
) : null}
</div>
{toReport.length > 0 ? (
<div className="mt-4 space-y-2">
{single ? (
<a href={single.checkoutUrl ?? undefined} target="_blank" rel="noreferrer" className={primary}>
Pagar con Mercado Pago
{t('fee.payMp')}
<ExternalLink className="size-4" aria-hidden="true" />
</a>
) : payable.length > 1 ? (
<Link to="/student/payments" className={primary}>
Pagar con Mercado Pago
{t('fee.payMp')}
</Link>
) : null}
<Link
@@ -56,11 +58,11 @@ export function FeeCard({ fees }: { fees: StudentFee[] }) {
}
>
<Receipt className="size-5" aria-hidden="true" />
Informar pago
{t('fee.report')}
</Link>
</div>
) : (
<p className="mt-3 text-sm text-secondary">Tu profe tiene que confirmar el pago que informaste.</p>
<p className="mt-3 text-sm text-secondary">{t('fee.awaiting')}</p>
)}
</article>
)