From 4d50b46399cf84d64c572efc296cc7e6d3a063bb Mon Sep 17 00:00:00 2001 From: Jose Selesan Date: Tue, 3 Nov 2026 14:05:21 -0300 Subject: [PATCH] feat(i18n): traducir la app de alumnos (con selector de idioma en Perfil) Co-Authored-By: Claude Opus 5.5 --- apps/web/src/features/student-app/FeeCard.tsx | 16 +- .../features/student-app/FeeStatusBadge.tsx | 9 +- .../features/student-app/NextClassCard.tsx | 8 +- .../student-app/NotifyAbsenceView.tsx | 36 ++-- .../src/features/student-app/PasskeyCard.tsx | 14 +- .../student-app/PaymentReviewBanner.tsx | 9 +- .../features/student-app/ReceiptDropzone.tsx | 12 +- .../student-app/RecoveryEmailCard.tsx | 22 +-- .../student-app/ReportPaymentView.tsx | 41 +++-- .../features/student-app/StudentBottomNav.tsx | 6 +- .../student-app/StudentClassesView.tsx | 24 +-- .../features/student-app/StudentHomeView.tsx | 6 +- .../features/student-app/StudentLayout.tsx | 8 +- .../student-app/StudentPaymentsView.tsx | 38 ++-- .../features/student-app/StudentPicker.tsx | 6 +- .../student-app/StudentProfileView.tsx | 8 +- .../student-app/TeacherNoticeCard.tsx | 6 +- .../student-app/TransferDetailsCard.tsx | 15 +- .../features/student-app/WeekClassesList.tsx | 10 +- .../src/features/student-app/WelcomeView.tsx | 18 +- apps/web/src/features/student-app/format.ts | 34 ++-- .../features/student-app/student-nav-items.ts | 15 +- apps/web/src/i18n/i18next.d.ts | 2 + apps/web/src/i18n/locales/en/student.json | 169 ++++++++++++++++++ apps/web/src/i18n/locales/es-419/student.json | 169 ++++++++++++++++++ apps/web/src/i18n/locales/es-AR/student.json | 169 ++++++++++++++++++ apps/web/src/i18n/locales/pt-BR/student.json | 169 ++++++++++++++++++ 27 files changed, 887 insertions(+), 152 deletions(-) create mode 100644 apps/web/src/i18n/locales/en/student.json create mode 100644 apps/web/src/i18n/locales/es-419/student.json create mode 100644 apps/web/src/i18n/locales/es-AR/student.json create mode 100644 apps/web/src/i18n/locales/pt-BR/student.json diff --git a/apps/web/src/features/student-app/FeeCard.tsx b/apps/web/src/features/student-app/FeeCard.tsx index 4187e82..a04378a 100644 --- a/apps/web/src/features/student-app/FeeCard.tsx +++ b/apps/web/src/features/student-app/FeeCard.tsx @@ -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[] }) {
-

Tu cuota

+

{t('fee.yourFee')}

- {fees.length === 1 ? feeLabel(first) : `${fees.length} cuotas sin pagar`} + {fees.length === 1 ? feeLabel(first) : t('fee.unpaid', { count: fees.length })}

{formatPrice(toReport.length > 0 ? total : first.amount, first.currency)} @@ -32,19 +34,19 @@ export function FeeCard({ fees }: { fees: StudentFee[] }) { {fees.length === 1 ? ( ) : toReport.some((fee) => fee.status === 'overdue') ? ( - Hay vencidas + {t('fee.overdue')} ) : null}

{toReport.length > 0 ? (
{single ? ( - Pagar con Mercado Pago + {t('fee.payMp')} ) : payable.length > 1 ? ( - Pagar con Mercado Pago + {t('fee.payMp')} ) : null}
) : ( -

Tu profe tiene que confirmar el pago que informaste.

+

{t('fee.awaiting')}

)}
) diff --git a/apps/web/src/features/student-app/FeeStatusBadge.tsx b/apps/web/src/features/student-app/FeeStatusBadge.tsx index 3c15055..5cecf54 100644 --- a/apps/web/src/features/student-app/FeeStatusBadge.tsx +++ b/apps/web/src/features/student-app/FeeStatusBadge.tsx @@ -1,14 +1,11 @@ import type { StudentFeeStatus } from '@gruperly/shared' import { Badge } from '../../components/ui' +import { useTranslation } from 'react-i18next' -const LABELS: Record = { - pending: 'Pendiente', - overdue: 'Vencida', - reported: 'Informada', -} // Color always goes with the word: amber overdue, blue reported. export function FeeStatusBadge({ status }: { status: StudentFeeStatus }) { + const { t } = useTranslation('student') const variant = status === 'overdue' ? 'warning' : status === 'reported' ? 'info' : 'neutral' - return {LABELS[status]} + return {t(`feeStatus.${status}`)} } diff --git a/apps/web/src/features/student-app/NextClassCard.tsx b/apps/web/src/features/student-app/NextClassCard.tsx index 195c8c8..163067f 100644 --- a/apps/web/src/features/student-app/NextClassCard.tsx +++ b/apps/web/src/features/student-app/NextClassCard.tsx @@ -2,6 +2,7 @@ import { Link } from '@tanstack/react-router' import type { StudentClass } from '@gruperly/shared' import { CalendarX2, Check } from 'lucide-react' import { dateParts, formatLongDate, formatRelativeDay, formatTime } from './format' +import { useTranslation } from 'react-i18next' type NextClassCardProps = { item: StudentClass; timeZone: string } @@ -9,11 +10,12 @@ type NextClassCardProps = { item: StudentClass; timeZone: string } White on brand-night scores 15:1 in both themes. */ export function NextClassCard({ item, timeZone }: NextClassCardProps) { const { day, month } = dateParts(item.startsAt, timeZone) + const { t } = useTranslation(['student', 'common']) return (

- Próxima clase · {formatRelativeDay(item.startsAt, timeZone)} + {t('home.nextClass', { when: formatRelativeDay(item.startsAt, timeZone) })}

@@ -30,7 +32,7 @@ export function NextClassCard({ item, timeZone }: NextClassCardProps) { {item.notice ? (

) : (
diff --git a/apps/web/src/features/student-app/NotifyAbsenceView.tsx b/apps/web/src/features/student-app/NotifyAbsenceView.tsx index 85d5a78..2c9f7a9 100644 --- a/apps/web/src/features/student-app/NotifyAbsenceView.tsx +++ b/apps/web/src/features/student-app/NotifyAbsenceView.tsx @@ -6,21 +6,23 @@ import { Button, Label } from '../../components/ui' import { cn } from '../../lib/utils' import { FlowDone } from './FlowDone' import { FlowFooter } from './FlowFooter' -import { ABSENCE_REASON_LABELS, firstName, formatShortDate, formatTime } from './format' +import { ABSENCE_REASONS, absenceReasonLabel, firstName, formatShortDate, formatTime } from './format' import { SelectableRow } from './SelectableRow' import { useStudentApp } from './StudentAppProvider' +import { useTranslation } from 'react-i18next' -const REASONS = Object.keys(ABSENCE_REASON_LABELS) as AbsenceReasonValue[] +const REASONS = ABSENCE_REASONS export function NotifyAbsenceView({ preselected }: { preselected?: string }) { const { student, classes, notifyAbsences } = useStudentApp() const [selected, setSelected] = useState(preselected ? [preselected] : []) const [reason, setReason] = useState(null) const [message, setMessage] = useState('') + const { t } = useTranslation(['student', 'common']) if (!student || !classes) { return ( -
+
) @@ -30,14 +32,14 @@ export function NotifyAbsenceView({ preselected }: { preselected?: string }) { if (notifyAbsences.isSuccess) { return ( - -

Si cambiás de idea, podés deshacerlo desde Clases mientras la clase no haya empezado.

+ +

{t('notify.doneHint')}

- Volver al inicio + {t('backHome')} - Ver mis clases + {t('notify.seeClasses')}
@@ -63,17 +65,17 @@ export function NotifyAbsenceView({ preselected }: { preselected?: string }) {