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 }) {