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

View File

@@ -1,14 +1,11 @@
import type { StudentFeeStatus } from '@gruperly/shared' import type { StudentFeeStatus } from '@gruperly/shared'
import { Badge } from '../../components/ui' import { Badge } from '../../components/ui'
import { useTranslation } from 'react-i18next'
const LABELS: Record<StudentFeeStatus, string> = {
pending: 'Pendiente',
overdue: 'Vencida',
reported: 'Informada',
}
// Color always goes with the word: amber overdue, blue reported. // Color always goes with the word: amber overdue, blue reported.
export function FeeStatusBadge({ status }: { status: StudentFeeStatus }) { export function FeeStatusBadge({ status }: { status: StudentFeeStatus }) {
const { t } = useTranslation('student')
const variant = status === 'overdue' ? 'warning' : status === 'reported' ? 'info' : 'neutral' const variant = status === 'overdue' ? 'warning' : status === 'reported' ? 'info' : 'neutral'
return <Badge variant={variant}>{LABELS[status]}</Badge> return <Badge variant={variant}>{t(`feeStatus.${status}`)}</Badge>
} }

View File

@@ -2,6 +2,7 @@ import { Link } from '@tanstack/react-router'
import type { StudentClass } from '@gruperly/shared' import type { StudentClass } from '@gruperly/shared'
import { CalendarX2, Check } from 'lucide-react' import { CalendarX2, Check } from 'lucide-react'
import { dateParts, formatLongDate, formatRelativeDay, formatTime } from './format' import { dateParts, formatLongDate, formatRelativeDay, formatTime } from './format'
import { useTranslation } from 'react-i18next'
type NextClassCardProps = { item: StudentClass; timeZone: string } 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. */ White on brand-night scores 15:1 in both themes. */
export function NextClassCard({ item, timeZone }: NextClassCardProps) { export function NextClassCard({ item, timeZone }: NextClassCardProps) {
const { day, month } = dateParts(item.startsAt, timeZone) const { day, month } = dateParts(item.startsAt, timeZone)
const { t } = useTranslation(['student', 'common'])
return ( return (
<article className="rounded-2xl bg-brand-night p-5 text-white shadow-sm"> <article className="rounded-2xl bg-brand-night p-5 text-white shadow-sm">
<p className="text-xs font-semibold uppercase tracking-wide text-brand-celeste"> <p className="text-xs font-semibold uppercase tracking-wide text-brand-celeste">
Próxima clase · {formatRelativeDay(item.startsAt, timeZone)} {t('home.nextClass', { when: formatRelativeDay(item.startsAt, timeZone) })}
</p> </p>
<div className="mt-3 flex items-center gap-4"> <div className="mt-3 flex items-center gap-4">
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
@@ -30,7 +32,7 @@ export function NextClassCard({ item, timeZone }: NextClassCardProps) {
{item.notice ? ( {item.notice ? (
<p className="mt-4 flex min-h-11 items-center gap-2 rounded-xl bg-white/10 px-4 text-sm font-medium"> <p className="mt-4 flex min-h-11 items-center gap-2 rounded-xl bg-white/10 px-4 text-sm font-medium">
<Check className="size-4" aria-hidden="true" /> <Check className="size-4" aria-hidden="true" />
Avisaste que no vas {t('home.notified')}
</p> </p>
) : ( ) : (
<Link <Link
@@ -39,7 +41,7 @@ export function NextClassCard({ item, timeZone }: NextClassCardProps) {
className="mt-4 flex min-h-12 items-center justify-center gap-2 rounded-xl bg-white font-semibold text-brand-night hover:bg-brand-cloud" className="mt-4 flex min-h-12 items-center justify-center gap-2 rounded-xl bg-white font-semibold text-brand-night hover:bg-brand-cloud"
> >
<CalendarX2 className="size-5" aria-hidden="true" /> <CalendarX2 className="size-5" aria-hidden="true" />
No voy a ir {t('home.notGoing')}
</Link> </Link>
)} )}
</article> </article>

View File

@@ -6,21 +6,23 @@ import { Button, Label } from '../../components/ui'
import { cn } from '../../lib/utils' import { cn } from '../../lib/utils'
import { FlowDone } from './FlowDone' import { FlowDone } from './FlowDone'
import { FlowFooter } from './FlowFooter' 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 { SelectableRow } from './SelectableRow'
import { useStudentApp } from './StudentAppProvider' 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 }) { export function NotifyAbsenceView({ preselected }: { preselected?: string }) {
const { student, classes, notifyAbsences } = useStudentApp() const { student, classes, notifyAbsences } = useStudentApp()
const [selected, setSelected] = useState<string[]>(preselected ? [preselected] : []) const [selected, setSelected] = useState<string[]>(preselected ? [preselected] : [])
const [reason, setReason] = useState<AbsenceReasonValue | null>(null) const [reason, setReason] = useState<AbsenceReasonValue | null>(null)
const [message, setMessage] = useState('') const [message, setMessage] = useState('')
const { t } = useTranslation(['student', 'common'])
if (!student || !classes) { if (!student || !classes) {
return ( return (
<div className="flex justify-center py-20" role="status" aria-label="Cargando"> <div className="flex justify-center py-20" role="status" aria-label={t('loading')}>
<Loader2 className="size-8 animate-spin text-accent" aria-hidden="true" /> <Loader2 className="size-8 animate-spin text-accent" aria-hidden="true" />
</div> </div>
) )
@@ -30,14 +32,14 @@ export function NotifyAbsenceView({ preselected }: { preselected?: string }) {
if (notifyAbsences.isSuccess) { if (notifyAbsences.isSuccess) {
return ( return (
<FlowDone title={`Listo, le avisamos a ${teacher}`}> <FlowDone title={t('notify.done', { teacher })}>
<p className="text-sm text-secondary">Si cambiás de idea, podés deshacerlo desde Clases mientras la clase no haya empezado.</p> <p className="text-sm text-secondary">{t('notify.doneHint')}</p>
<div className="space-y-2 pt-2"> <div className="space-y-2 pt-2">
<Link to="/student" className="flex min-h-12 items-center justify-center rounded-xl bg-accent font-semibold text-on-accent hover:bg-accent-strong"> <Link to="/student" className="flex min-h-12 items-center justify-center rounded-xl bg-accent font-semibold text-on-accent hover:bg-accent-strong">
Volver al inicio {t('backHome')}
</Link> </Link>
<Link to="/student/classes" className="flex min-h-12 items-center justify-center rounded-xl border border-border font-medium text-primary hover:bg-primary-soft"> <Link to="/student/classes" className="flex min-h-12 items-center justify-center rounded-xl border border-border font-medium text-primary hover:bg-primary-soft">
Ver mis clases {t('notify.seeClasses')}
</Link> </Link>
</div> </div>
</FlowDone> </FlowDone>
@@ -63,17 +65,17 @@ export function NotifyAbsenceView({ preselected }: { preselected?: string }) {
<div className="space-y-6"> <div className="space-y-6">
<Link to="/student" className="hidden items-center gap-1 text-sm text-secondary hover:text-primary lg:inline-flex"> <Link to="/student" className="hidden items-center gap-1 text-sm text-secondary hover:text-primary lg:inline-flex">
<ArrowLeft className="size-4" aria-hidden="true" /> <ArrowLeft className="size-4" aria-hidden="true" />
Volver {t('back')}
</Link> </Link>
<h1 className="text-2xl font-bold text-primary">Avisar que no voy</h1> <h1 className="text-2xl font-bold text-primary">{t('notify.title')}</h1>
<section aria-labelledby="classes-label" className="space-y-2"> <section aria-labelledby="classes-label" className="space-y-2">
<h2 id="classes-label" className="text-sm font-semibold text-primary"> <h2 id="classes-label" className="text-sm font-semibold text-primary">
¿A qué clases no vas? {t('notify.which')}
</h2> </h2>
{available.length === 0 ? ( {available.length === 0 ? (
<p className="rounded-xl border border-dashed border-border px-4 py-6 text-center text-sm text-secondary"> <p className="rounded-xl border border-dashed border-border px-4 py-6 text-center text-sm text-secondary">
No hay clases para avisar. {t('notify.none')}
</p> </p>
) : ( ) : (
<div className="space-y-2"> <div className="space-y-2">
@@ -91,7 +93,7 @@ export function NotifyAbsenceView({ preselected }: { preselected?: string }) {
<section aria-labelledby="reason-label" className="space-y-2"> <section aria-labelledby="reason-label" className="space-y-2">
<h2 id="reason-label" className="text-sm font-semibold text-primary"> <h2 id="reason-label" className="text-sm font-semibold text-primary">
Motivo <span className="font-normal text-secondary">(opcional)</span> {t('notify.reason')} <span className="font-normal text-secondary">{t('notify.optional')}</span>
</h2> </h2>
<div className="flex flex-wrap gap-2"> <div className="flex flex-wrap gap-2">
{REASONS.map((value) => ( {REASONS.map((value) => (
@@ -105,14 +107,14 @@ export function NotifyAbsenceView({ preselected }: { preselected?: string }) {
reason === value ? 'border-accent bg-accent-soft text-accent-fg' : 'border-border bg-surface text-primary hover:bg-primary-soft', reason === value ? 'border-accent bg-accent-soft text-accent-fg' : 'border-border bg-surface text-primary hover:bg-primary-soft',
)} )}
> >
{ABSENCE_REASON_LABELS[value]} {absenceReasonLabel(value)}
</button> </button>
))} ))}
</div> </div>
</section> </section>
<div className="space-y-1.5"> <div className="space-y-1.5">
<Label htmlFor="absence-message">Mensaje para {teacher} (opcional)</Label> <Label htmlFor="absence-message">{t('notify.message', { teacher })}</Label>
<textarea <textarea
id="absence-message" id="absence-message"
value={message} value={message}
@@ -123,18 +125,18 @@ export function NotifyAbsenceView({ preselected }: { preselected?: string }) {
/> />
</div> </div>
<p className="text-xs text-secondary">Si avisás antes de la clase, la falta queda como justificada.</p> <p className="text-xs text-secondary">{t('notify.hint')}</p>
{notifyAbsences.isError ? ( {notifyAbsences.isError ? (
<p role="alert" className="text-sm text-danger-fg"> <p role="alert" className="text-sm text-danger-fg">
No pudimos mandar el aviso. Si alguna clase ya empezó, sacala y probá de nuevo. {t('notify.error')}
</p> </p>
) : null} ) : null}
<FlowFooter> <FlowFooter>
<Button variant="primary" className="h-12 w-full text-base" disabled={count === 0 || notifyAbsences.isPending} onClick={submit}> <Button variant="primary" className="h-12 w-full text-base" disabled={count === 0 || notifyAbsences.isPending} onClick={submit}>
{notifyAbsences.isPending ? <Loader2 className="size-5 animate-spin" aria-hidden="true" /> : null} {notifyAbsences.isPending ? <Loader2 className="size-5 animate-spin" aria-hidden="true" /> : null}
{count === 0 ? 'Elegí al menos una clase' : count === 1 ? 'Avisar 1 clase' : `Avisar ${count} clases`} {count === 0 ? t('notify.pick') : t('notify.submit', { count })}
</Button> </Button>
</FlowFooter> </FlowFooter>
</div> </div>

View File

@@ -4,12 +4,14 @@ import { Button } from '../../components/ui'
import { cn } from '../../lib/utils' import { cn } from '../../lib/utils'
import { isPasskeyCancel, supportsPasskeys } from '../student-access/passkeys' import { isPasskeyCancel, supportsPasskeys } from '../student-access/passkeys'
import { useStudentApp } from './StudentAppProvider' import { useStudentApp } from './StudentAppProvider'
import { useTranslation } from 'react-i18next'
/* "Entrar con Face ID o huella". Not shown when the browser has no WebAuthn, /* "Entrar con Face ID o huella". Not shown when the browser has no WebAuthn,
unless there's already a passkey to remove. */ unless there's already a passkey to remove. */
export function PasskeyCard({ highlighted = false }: { highlighted?: boolean }) { export function PasskeyCard({ highlighted = false }: { highlighted?: boolean }) {
const { me, activatePasskey, removePasskeys } = useStudentApp() const { me, activatePasskey, removePasskeys } = useStudentApp()
const [failed, setFailed] = useState(false) const [failed, setFailed] = useState(false)
const { t } = useTranslation(['student', 'common'])
const hasPasskey = me?.account.hasPasskey ?? false const hasPasskey = me?.account.hasPasskey ?? false
if (!supportsPasskeys() && !hasPasskey) return null if (!supportsPasskeys() && !hasPasskey) return null
@@ -33,30 +35,30 @@ export function PasskeyCard({ highlighted = false }: { highlighted?: boolean })
</span> </span>
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<h2 id="passkey-title" className="text-base font-bold text-primary"> <h2 id="passkey-title" className="text-base font-bold text-primary">
{hasPasskey ? 'Face ID activado' : 'Entrar con Face ID o huella'} {hasPasskey ? t('passkey.active') : t('passkey.title')}
</h2> </h2>
<p className="mt-1 text-sm text-secondary"> <p className="mt-1 text-sm text-secondary">
{hasPasskey {hasPasskey
? 'Si se cierra tu sesión, entrás con tu cara o tu huella, sin pedirle un link a tu profe.' ? t('passkey.activeHint')
: 'Si se cierra tu sesión o cambiás de navegador, vas a poder volver a entrar sin pedirle un link a tu profe.'} : t('passkey.hint')}
</p> </p>
</div> </div>
</div> </div>
{failed ? ( {failed ? (
<p role="alert" className="mt-3 text-sm text-danger-fg"> <p role="alert" className="mt-3 text-sm text-danger-fg">
No pudimos activarlo en este teléfono. {t('passkey.error')}
</p> </p>
) : null} ) : null}
<div className="mt-4"> <div className="mt-4">
{hasPasskey ? ( {hasPasskey ? (
<Button variant="outline" className="h-11 w-full" onClick={() => removePasskeys.mutate()} disabled={removePasskeys.isPending}> <Button variant="outline" className="h-11 w-full" onClick={() => removePasskeys.mutate()} disabled={removePasskeys.isPending}>
{removePasskeys.isPending ? <Loader2 className="size-4 animate-spin" aria-hidden="true" /> : null} {removePasskeys.isPending ? <Loader2 className="size-4 animate-spin" aria-hidden="true" /> : null}
Quitar Face ID o huella {t('passkey.remove')}
</Button> </Button>
) : ( ) : (
<Button variant="primary" className="h-11 w-full" onClick={activate} disabled={activatePasskey.isPending}> <Button variant="primary" className="h-11 w-full" onClick={activate} disabled={activatePasskey.isPending}>
{activatePasskey.isPending ? <Loader2 className="size-4 animate-spin" aria-hidden="true" /> : null} {activatePasskey.isPending ? <Loader2 className="size-4 animate-spin" aria-hidden="true" /> : null}
Activar {t('passkey.activate')}
</Button> </Button>
)} )}
</div> </div>

View File

@@ -1,12 +1,14 @@
import type { StudentPaymentReport } from '@gruperly/shared' import type { StudentPaymentReport } from '@gruperly/shared'
import { CheckCircle2, XCircle } from 'lucide-react' import { CheckCircle2, XCircle } from 'lucide-react'
import { formatPrice } from '../../lib/format' import { formatPrice } from '../../lib/format'
import { useTranslation } from 'react-i18next'
const RECENT_MS = 7 * 24 * 60 * 60 * 1000 const RECENT_MS = 7 * 24 * 60 * 60 * 1000
/* In-app notice of the teacher's review: the latest report reviewed in the /* In-app notice of the teacher's review: the latest report reviewed in the
last week (the student is also emailed if they confirmed a recovery email). */ last week (the student is also emailed if they confirmed a recovery email). */
export function PaymentReviewBanner({ reports }: { reports: StudentPaymentReport[] }) { export function PaymentReviewBanner({ reports }: { reports: StudentPaymentReport[] }) {
const { t } = useTranslation(['student', 'common'])
const latest = reports.find( const latest = reports.find(
(report) => report.status !== 'reported' && report.reviewedAt && Date.now() - Date.parse(report.reviewedAt) < RECENT_MS, (report) => report.status !== 'reported' && report.reviewedAt && Date.now() - Date.parse(report.reviewedAt) < RECENT_MS,
) )
@@ -17,7 +19,7 @@ export function PaymentReviewBanner({ reports }: { reports: StudentPaymentReport
return ( return (
<p role="status" className="flex gap-3 rounded-2xl bg-success-soft px-4 py-3 text-sm text-primary"> <p role="status" className="flex gap-3 rounded-2xl bg-success-soft px-4 py-3 text-sm text-primary">
<CheckCircle2 className="size-5 shrink-0 text-success" aria-hidden="true" /> <CheckCircle2 className="size-5 shrink-0 text-success" aria-hidden="true" />
<span>Tu profe confirmó tu pago de {amount}.</span> <span>{t('review.confirmed', { amount })}</span>
</p> </p>
) )
} }
@@ -25,8 +27,9 @@ export function PaymentReviewBanner({ reports }: { reports: StudentPaymentReport
<p role="status" className="flex gap-3 rounded-2xl bg-danger-soft px-4 py-3 text-sm text-primary"> <p role="status" className="flex gap-3 rounded-2xl bg-danger-soft px-4 py-3 text-sm text-primary">
<XCircle className="size-5 shrink-0 text-danger-fg" aria-hidden="true" /> <XCircle className="size-5 shrink-0 text-danger-fg" aria-hidden="true" />
<span> <span>
Tu profe no pudo confirmar tu pago de {amount}. {t('review.rejected', { amount })}
{latest.rejectionReason ? ` Motivo: ${latest.rejectionReason}.` : ''} Podés volver a informarlo. {latest.rejectionReason ? t('review.reason', { reason: latest.rejectionReason }) : ''}
{t('review.retry')}
</span> </span>
</p> </p>
) )

View File

@@ -2,6 +2,7 @@ import { useEffect, useId, useMemo, useState } from 'react'
import { FileText, Paperclip, X } from 'lucide-react' import { FileText, Paperclip, X } from 'lucide-react'
import { RECEIPT_ACCEPT, RECEIPT_MAX_MB } from '@gruperly/shared' import { RECEIPT_ACCEPT, RECEIPT_MAX_MB } from '@gruperly/shared'
import { formatFileSize } from './format' import { formatFileSize } from './format'
import { useTranslation } from 'react-i18next'
const ACCEPTED = new Set(RECEIPT_ACCEPT.split(',')) const ACCEPTED = new Set(RECEIPT_ACCEPT.split(','))
// Safari's HEIC can't be previewed by other browsers: those show the file icon. // Safari's HEIC can't be previewed by other browsers: those show the file icon.
@@ -17,6 +18,7 @@ type ReceiptDropzoneProps = {
export function ReceiptDropzone({ file, onChange }: ReceiptDropzoneProps) { export function ReceiptDropzone({ file, onChange }: ReceiptDropzoneProps) {
const inputId = useId() const inputId = useId()
const [error, setError] = useState<string | null>(null) const [error, setError] = useState<string | null>(null)
const { t } = useTranslation(['student', 'common'])
const preview = useMemo(() => (file && PREVIEWABLE.has(file.type) ? URL.createObjectURL(file) : null), [file]) const preview = useMemo(() => (file && PREVIEWABLE.has(file.type) ? URL.createObjectURL(file) : null), [file])
useEffect(() => () => { useEffect(() => () => {
@@ -26,11 +28,11 @@ export function ReceiptDropzone({ file, onChange }: ReceiptDropzoneProps) {
const handleFile = (next: File | undefined) => { const handleFile = (next: File | undefined) => {
if (!next) return if (!next) return
if (next.size > RECEIPT_MAX_MB * 1024 * 1024) { if (next.size > RECEIPT_MAX_MB * 1024 * 1024) {
setError(`El archivo pesa más de ${RECEIPT_MAX_MB} MB.`) setError(t('receipt.tooBig', { max: RECEIPT_MAX_MB }))
return return
} }
if (next.type && !ACCEPTED.has(next.type)) { if (next.type && !ACCEPTED.has(next.type)) {
setError('Tiene que ser una captura (JPG, PNG, WEBP, HEIC) o un PDF.') setError(t('receipt.badType'))
return return
} }
setError(null) setError(null)
@@ -54,7 +56,7 @@ export function ReceiptDropzone({ file, onChange }: ReceiptDropzoneProps) {
<button <button
type="button" type="button"
onClick={() => onChange(null)} onClick={() => onChange(null)}
aria-label="Quitar comprobante" aria-label={t('receipt.remove')}
className="flex size-11 shrink-0 items-center justify-center rounded-xl text-foreground hover:bg-primary-soft hover:text-primary" className="flex size-11 shrink-0 items-center justify-center rounded-xl text-foreground hover:bg-primary-soft hover:text-primary"
> >
<X className="size-5" aria-hidden="true" /> <X className="size-5" aria-hidden="true" />
@@ -70,8 +72,8 @@ export function ReceiptDropzone({ file, onChange }: ReceiptDropzoneProps) {
className="flex min-h-28 cursor-pointer flex-col items-center justify-center gap-2 rounded-2xl border-2 border-dashed border-border bg-surface px-4 py-6 text-center hover:border-accent focus-within:border-accent focus-within:ring-2 focus-within:ring-accent/30" className="flex min-h-28 cursor-pointer flex-col items-center justify-center gap-2 rounded-2xl border-2 border-dashed border-border bg-surface px-4 py-6 text-center hover:border-accent focus-within:border-accent focus-within:ring-2 focus-within:ring-accent/30"
> >
<Paperclip className="size-6 text-accent-fg" aria-hidden="true" /> <Paperclip className="size-6 text-accent-fg" aria-hidden="true" />
<span className="text-sm font-semibold text-primary">Adjuntar captura o PDF</span> <span className="text-sm font-semibold text-primary">{t('receipt.attach')}</span>
<span className="text-xs text-secondary">Hasta {RECEIPT_MAX_MB} MB</span> <span className="text-xs text-secondary">{t('receipt.max', { max: RECEIPT_MAX_MB })}</span>
<input <input
id={inputId} id={inputId}
type="file" type="file"

View File

@@ -2,12 +2,14 @@ import { useState, type FormEvent } from 'react'
import { Loader2, Mail } from 'lucide-react' import { Loader2, Mail } from 'lucide-react'
import { Button, Input, Label } from '../../components/ui' import { Button, Input, Label } from '../../components/ui'
import { useStudentApp } from './StudentAppProvider' import { useStudentApp } from './StudentAppProvider'
import { Trans, useTranslation } from 'react-i18next'
/* Optional recovery email (Perfil). Saving it sends a confirmation link: until /* Optional recovery email (Perfil). Saving it sends a confirmation link: until
it's confirmed it doesn't recover anything. */ it's confirmed it doesn't recover anything. */
export function RecoveryEmailCard() { export function RecoveryEmailCard() {
const { me, saveRecoveryEmail, removeRecoveryEmail } = useStudentApp() const { me, saveRecoveryEmail, removeRecoveryEmail } = useStudentApp()
const [editing, setEditing] = useState(false) const [editing, setEditing] = useState(false)
const { t } = useTranslation(['student', 'common'])
const [email, setEmail] = useState('') const [email, setEmail] = useState('')
const current = me?.account.recoveryEmail ?? null const current = me?.account.recoveryEmail ?? null
const pending = me?.account.pendingRecoveryEmail ?? null const pending = me?.account.pendingRecoveryEmail ?? null
@@ -32,20 +34,20 @@ export function RecoveryEmailCard() {
</span> </span>
<div className="min-w-0 flex-1"> <div className="min-w-0 flex-1">
<h2 id="recovery-title" className="text-base font-bold text-primary"> <h2 id="recovery-title" className="text-base font-bold text-primary">
Mail de recuperación <span className="font-normal text-secondary">(opcional)</span> {t('recovery.title')} <span className="font-normal text-secondary">{t('recovery.optional')}</span>
</h2> </h2>
{current ? ( {current ? (
<p className="mt-1 truncate text-sm text-secondary"> <p className="mt-1 truncate text-sm text-secondary">
Confirmado: <span className="font-medium text-primary">{current}</span> <Trans t={t} i18nKey="recovery.confirmed" values={{ email: current }} components={{ strong: <span className="font-medium text-primary" /> }} />
</p> </p>
) : null} ) : null}
{pending ? ( {pending ? (
<p className="mt-1 text-sm text-secondary"> <p className="mt-1 text-sm text-secondary">
Te mandamos un link a <span className="font-medium text-primary">{pending}</span> para confirmarlo. <Trans t={t} i18nKey="recovery.pending" values={{ email: pending }} components={{ strong: <span className="font-medium text-primary" /> }} />
</p> </p>
) : null} ) : null}
{!current && !pending ? ( {!current && !pending ? (
<p className="mt-1 text-sm text-secondary">Para pedir un link de ingreso si perdés el acceso.</p> <p className="mt-1 text-sm text-secondary">{t('recovery.hint')}</p>
) : null} ) : null}
</div> </div>
</div> </div>
@@ -53,7 +55,7 @@ export function RecoveryEmailCard() {
{showForm ? ( {showForm ? (
<form onSubmit={submit} className="mt-4 space-y-3"> <form onSubmit={submit} className="mt-4 space-y-3">
<div className="space-y-1.5"> <div className="space-y-1.5">
<Label htmlFor="profile-recovery-email">Tu mail</Label> <Label htmlFor="profile-recovery-email">{t('recovery.label')}</Label>
<Input <Input
id="profile-recovery-email" id="profile-recovery-email"
type="email" type="email"
@@ -68,28 +70,28 @@ export function RecoveryEmailCard() {
</div> </div>
{saveRecoveryEmail.isError ? ( {saveRecoveryEmail.isError ? (
<p role="alert" className="text-sm text-danger-fg"> <p role="alert" className="text-sm text-danger-fg">
No pudimos guardar el mail. Probá de nuevo en un rato. {t('recovery.error')}
</p> </p>
) : null} ) : null}
<div className="flex gap-2"> <div className="flex gap-2">
{editing ? ( {editing ? (
<Button variant="outline" className="h-11 flex-1" onClick={() => setEditing(false)}> <Button variant="outline" className="h-11 flex-1" onClick={() => setEditing(false)}>
Cancelar {t('common:actions.cancel')}
</Button> </Button>
) : null} ) : null}
<Button type="submit" variant="primary" className="h-11 flex-1" disabled={saveRecoveryEmail.isPending}> <Button type="submit" variant="primary" className="h-11 flex-1" disabled={saveRecoveryEmail.isPending}>
{saveRecoveryEmail.isPending ? <Loader2 className="size-4 animate-spin" aria-hidden="true" /> : null} {saveRecoveryEmail.isPending ? <Loader2 className="size-4 animate-spin" aria-hidden="true" /> : null}
Guardar {t('common:actions.save')}
</Button> </Button>
</div> </div>
</form> </form>
) : ( ) : (
<div className="mt-4 flex gap-2"> <div className="mt-4 flex gap-2">
<Button variant="outline" className="h-11 flex-1" onClick={() => setEditing(true)}> <Button variant="outline" className="h-11 flex-1" onClick={() => setEditing(true)}>
Cambiar {t('recovery.change')}
</Button> </Button>
<Button variant="ghost" className="h-11 flex-1" onClick={() => removeRecoveryEmail.mutate()} disabled={removeRecoveryEmail.isPending}> <Button variant="ghost" className="h-11 flex-1" onClick={() => removeRecoveryEmail.mutate()} disabled={removeRecoveryEmail.isPending}>
Quitar {t('recovery.remove')}
</Button> </Button>
</div> </div>
)} )}

View File

@@ -13,16 +13,19 @@ import { ReceiptDropzone } from './ReceiptDropzone'
import { SelectableRow } from './SelectableRow' import { SelectableRow } from './SelectableRow'
import { useStudentApp } from './StudentAppProvider' import { useStudentApp } from './StudentAppProvider'
import { TransferDetailsCard } from './TransferDetailsCard' import { TransferDetailsCard } from './TransferDetailsCard'
import { useTranslation } from 'react-i18next'
import { errorMessage } from '../../i18n'
export function ReportPaymentView() { export function ReportPaymentView() {
const { student, fees, reportPayment } = useStudentApp() const { student, fees, reportPayment } = useStudentApp()
const [selected, setSelected] = useState<string[] | null>(null) const [selected, setSelected] = useState<string[] | null>(null)
const [file, setFile] = useState<File | null>(null) const [file, setFile] = useState<File | null>(null)
const [note, setNote] = useState('') const [note, setNote] = useState('')
const { t } = useTranslation(['student', 'common'])
if (!student || !fees) { if (!student || !fees) {
return ( return (
<div className="flex justify-center py-20" role="status" aria-label="Cargando"> <div className="flex justify-center py-20" role="status" aria-label={t('loading')}>
<Loader2 className="size-8 animate-spin text-accent" aria-hidden="true" /> <Loader2 className="size-8 animate-spin text-accent" aria-hidden="true" />
</div> </div>
) )
@@ -32,12 +35,12 @@ export function ReportPaymentView() {
if (reportPayment.isSuccess) { if (reportPayment.isSuccess) {
return ( return (
<FlowDone title="Pago informado"> <FlowDone title={t('report.done')}>
<p className="text-sm text-secondary"> <p className="text-sm text-secondary">
{teacher} va a revisar el comprobante. Te avisamos acá cuando lo confirme. {t('report.doneHint', { teacher })}
</p> </p>
<Link to="/student" className="flex min-h-12 items-center justify-center rounded-xl bg-accent font-semibold text-on-accent hover:bg-accent-strong"> <Link to="/student" className="flex min-h-12 items-center justify-center rounded-xl bg-accent font-semibold text-on-accent hover:bg-accent-strong">
Volver al inicio {t('backHome')}
</Link> </Link>
</FlowDone> </FlowDone>
) )
@@ -58,26 +61,26 @@ export function ReportPaymentView() {
const errorText = const errorText =
reportPayment.error instanceof ApiError && reportPayment.error.status === 409 reportPayment.error instanceof ApiError && reportPayment.error.status === 409
? 'Ya informaste alguna de estas cuotas.' ? t('report.alreadyReported')
: reportPayment.error instanceof ApiError && reportPayment.error.status === 400 : reportPayment.error instanceof ApiError && reportPayment.error.status === 400
? reportPayment.error.problem?.detail ?? 'Revisá el comprobante.' ? errorMessage(reportPayment.error, t('report.checkReceipt'))
: 'No pudimos enviar el pago. Probá de nuevo.' : t('report.error')
return ( return (
<div className="space-y-6"> <div className="space-y-6">
<Link to="/student/payments" className="hidden items-center gap-1 text-sm text-secondary hover:text-primary lg:inline-flex"> <Link to="/student/payments" className="hidden items-center gap-1 text-sm text-secondary hover:text-primary lg:inline-flex">
<ArrowLeft className="size-4" aria-hidden="true" /> <ArrowLeft className="size-4" aria-hidden="true" />
Volver {t('back')}
</Link> </Link>
<h1 className="text-2xl font-bold text-primary">Informar pago</h1> <h1 className="text-2xl font-bold text-primary">{t('report.title')}</h1>
<section aria-labelledby="fees-label" className="space-y-2"> <section aria-labelledby="fees-label" className="space-y-2">
<h2 id="fees-label" className="text-sm font-semibold text-primary"> <h2 id="fees-label" className="text-sm font-semibold text-primary">
¿Qué cuotas pagaste? {t('report.which')}
</h2> </h2>
{reportable.length === 0 ? ( {reportable.length === 0 ? (
<p className="rounded-xl border border-dashed border-border px-4 py-6 text-center text-sm text-secondary"> <p className="rounded-xl border border-dashed border-border px-4 py-6 text-center text-sm text-secondary">
No tenés cuotas para informar. {t('report.none')}
</p> </p>
) : ( ) : (
<div className="space-y-2"> <div className="space-y-2">
@@ -91,7 +94,7 @@ export function ReportPaymentView() {
<span className="block text-sm font-medium text-primary">{feeLabel(fee)}</span> <span className="block text-sm font-medium text-primary">{feeLabel(fee)}</span>
<span className="mt-1 flex items-center gap-2 text-xs text-secondary"> <span className="mt-1 flex items-center gap-2 text-xs text-secondary">
<FeeStatusBadge status={fee.status} /> <FeeStatusBadge status={fee.status} />
Vence {formatDueDate(fee.dueDate)} {t('report.due', { date: formatDueDate(fee.dueDate) })}
</span> </span>
</SelectableRow> </SelectableRow>
))} ))}
@@ -103,27 +106,27 @@ export function ReportPaymentView() {
<section aria-labelledby="receipt-label" className="space-y-2"> <section aria-labelledby="receipt-label" className="space-y-2">
<h2 id="receipt-label" className="text-sm font-semibold text-primary"> <h2 id="receipt-label" className="text-sm font-semibold text-primary">
Comprobante {t('report.receipt')}
</h2> </h2>
<ReceiptDropzone file={file} onChange={setFile} /> <ReceiptDropzone file={file} onChange={setFile} />
</section> </section>
<div className="space-y-1.5"> <div className="space-y-1.5">
<Label htmlFor="report-note">Nota para {teacher} (opcional)</Label> <Label htmlFor="report-note">{t('report.note', { teacher })}</Label>
<textarea <textarea
id="report-note" id="report-note"
value={note} value={note}
onChange={(event) => setNote(event.target.value)} onChange={(event) => setNote(event.target.value)}
maxLength={REPORTED_PAYMENT_NOTE_MAX} maxLength={REPORTED_PAYMENT_NOTE_MAX}
rows={3} rows={3}
placeholder="Ej.: pagué desde la cuenta de mi mamá" placeholder={t('report.notePlaceholder')}
className="w-full rounded-xl border border-border bg-surface px-3 py-2 text-base text-primary placeholder:text-foreground/50 focus:border-accent focus:outline-none focus:ring-2 focus:ring-accent/30 sm:text-sm" className="w-full rounded-xl border border-border bg-surface px-3 py-2 text-base text-primary placeholder:text-foreground/50 focus:border-accent focus:outline-none focus:ring-2 focus:ring-accent/30 sm:text-sm"
/> />
</div> </div>
<p className="flex gap-2 text-xs text-secondary"> <p className="flex gap-2 text-xs text-secondary">
<Info className="mt-0.5 size-4 shrink-0" aria-hidden="true" /> <Info className="mt-0.5 size-4 shrink-0" aria-hidden="true" />
{teacher} va a confirmar el pago. Mientras tanto figura como Informado. {t('report.hint', { teacher })}
</p> </p>
{reportPayment.isError ? ( {reportPayment.isError ? (
@@ -140,7 +143,11 @@ export function ReportPaymentView() {
onClick={submit} onClick={submit}
> >
{reportPayment.isPending ? <Loader2 className="size-5 animate-spin" aria-hidden="true" /> : null} {reportPayment.isPending ? <Loader2 className="size-5 animate-spin" aria-hidden="true" /> : null}
{chosen.length === 0 ? 'Elegí al menos una cuota' : !file ? 'Adjuntá el comprobante' : `Enviar · ${formatPrice(total, currency)}`} {chosen.length === 0
? t('report.pickFee')
: !file
? t('report.attach')
: t('report.submit', { amount: formatPrice(total, currency) })}
</Button> </Button>
</FlowFooter> </FlowFooter>
</div> </div>

View File

@@ -1,13 +1,15 @@
import { Link, useLocation } from '@tanstack/react-router' import { Link, useLocation } from '@tanstack/react-router'
import { cn } from '../../lib/utils' import { cn } from '../../lib/utils'
import { isStudentNavItemActive, STUDENT_NAV_ITEMS } from './student-nav-items' import { isStudentNavItemActive, STUDENT_NAV_ITEMS } from './student-nav-items'
import { useTranslation } from 'react-i18next'
export function StudentBottomNav() { export function StudentBottomNav() {
const location = useLocation() const location = useLocation()
const { t } = useTranslation(['student', 'common'])
return ( return (
<nav <nav
aria-label="Secciones" aria-label={t('nav.label')}
className="fixed inset-x-0 bottom-0 z-40 border-t border-border bg-surface/95 pb-[env(safe-area-inset-bottom)] backdrop-blur" className="fixed inset-x-0 bottom-0 z-40 border-t border-border bg-surface/95 pb-[env(safe-area-inset-bottom)] backdrop-blur"
> >
<div className="mx-auto grid max-w-md grid-cols-4"> <div className="mx-auto grid max-w-md grid-cols-4">
@@ -31,7 +33,7 @@ export function StudentBottomNav() {
> >
<Icon className="size-5" strokeWidth={isActive ? 2.25 : 2} aria-hidden="true" /> <Icon className="size-5" strokeWidth={isActive ? 2.25 : 2} aria-hidden="true" />
</span> </span>
<span className="leading-none">{label}</span> <span className="leading-none">{t(label)}</span>
</Link> </Link>
) )
})} })}

View File

@@ -1,26 +1,28 @@
import { Link } from '@tanstack/react-router' import { Link } from '@tanstack/react-router'
import { CalendarX2, Loader2, Undo2 } from 'lucide-react' import { CalendarX2, Loader2, Undo2 } from 'lucide-react'
import { Badge, Button, useToast } from '../../components/ui' import { Badge, Button, useToast } from '../../components/ui'
import { ABSENCE_REASON_LABELS, formatShortDate, formatTime } from './format' import { absenceReasonLabel, formatShortDate, formatTime } from './format'
import { useStudentApp } from './StudentAppProvider' import { useStudentApp } from './StudentAppProvider'
import { useTranslation } from 'react-i18next'
/* Upcoming classes. A notified class can be undone while it hasn't started. */ /* Upcoming classes. A notified class can be undone while it hasn't started. */
export function StudentClassesView() { export function StudentClassesView() {
const { classes, classesPending, cancelAbsence } = useStudentApp() const { classes, classesPending, cancelAbsence } = useStudentApp()
const toast = useToast() const toast = useToast()
const { t } = useTranslation(['student', 'common'])
const upcoming = (classes?.classes ?? []).filter((item) => !item.started) const upcoming = (classes?.classes ?? []).filter((item) => !item.started)
const undo = (noticeId: string) => { const undo = (noticeId: string) => {
cancelAbsence.mutate(noticeId, { cancelAbsence.mutate(noticeId, {
onSuccess: () => toast.success('Listo, quedaste anotado/a otra vez.'), onSuccess: () => toast.success(t('classes.undone')),
onError: () => toast.error('No pudimos deshacer el aviso. Si la clase ya empezó, ya no se puede.'), onError: () => toast.error(t('classes.undoError')),
}) })
} }
return ( return (
<div className="space-y-5"> <div className="space-y-5">
<div className="flex items-center justify-between gap-3"> <div className="flex items-center justify-between gap-3">
<h1 className="text-2xl font-bold text-primary">Clases</h1> <h1 className="text-2xl font-bold text-primary">{t('classes.title')}</h1>
</div> </div>
<Link <Link
@@ -28,16 +30,16 @@ export function StudentClassesView() {
className="flex min-h-12 items-center justify-center gap-2 rounded-xl bg-accent font-semibold text-on-accent hover:bg-accent-strong" className="flex min-h-12 items-center justify-center gap-2 rounded-xl bg-accent font-semibold text-on-accent hover:bg-accent-strong"
> >
<CalendarX2 className="size-5" aria-hidden="true" /> <CalendarX2 className="size-5" aria-hidden="true" />
Avisar que no voy {t('classes.notify')}
</Link> </Link>
{classesPending || !classes ? ( {classesPending || !classes ? (
<div className="flex justify-center py-8" role="status" aria-label="Cargando clases"> <div className="flex justify-center py-8" role="status" aria-label={t('loadingClasses')}>
<Loader2 className="size-6 animate-spin text-accent" aria-hidden="true" /> <Loader2 className="size-6 animate-spin text-accent" aria-hidden="true" />
</div> </div>
) : upcoming.length === 0 ? ( ) : upcoming.length === 0 ? (
<p className="rounded-xl border border-dashed border-border px-4 py-6 text-center text-sm text-secondary"> <p className="rounded-xl border border-dashed border-border px-4 py-6 text-center text-sm text-secondary">
No hay clases programadas en las próximas semanas. {t('classes.empty')}
</p> </p>
) : ( ) : (
<ul className="divide-y divide-border rounded-2xl border border-border bg-surface"> <ul className="divide-y divide-border rounded-2xl border border-border bg-surface">
@@ -49,21 +51,21 @@ export function StudentClassesView() {
</p> </p>
<p className="truncate text-xs text-secondary"> <p className="truncate text-xs text-secondary">
{item.groupName} {item.groupName}
{item.notice?.reason ? ` · ${ABSENCE_REASON_LABELS[item.notice.reason]}` : ''} {item.notice?.reason ? ` · ${absenceReasonLabel(item.notice.reason)}` : ''}
</p> </p>
</div> </div>
{item.notice ? ( {item.notice ? (
<div className="flex shrink-0 items-center gap-2"> <div className="flex shrink-0 items-center gap-2">
<Badge variant="neutral">Avisaste</Badge> <Badge variant="neutral">{t('classes.notified')}</Badge>
<Button <Button
variant="outline" variant="outline"
className="h-11" className="h-11"
onClick={() => undo(item.notice?.id as string)} onClick={() => undo(item.notice?.id as string)}
disabled={cancelAbsence.isPending} disabled={cancelAbsence.isPending}
aria-label={`Deshacer el aviso del ${formatShortDate(item.startsAt, classes.timeZone)}`} aria-label={t('classes.undoLabel', { date: formatShortDate(item.startsAt, classes.timeZone) })}
> >
<Undo2 className="size-4" aria-hidden="true" /> <Undo2 className="size-4" aria-hidden="true" />
Deshacer {t('classes.undo')}
</Button> </Button>
</div> </div>
) : null} ) : null}

View File

@@ -6,9 +6,11 @@ import { PaymentReviewBanner } from './PaymentReviewBanner'
import { useStudentApp } from './StudentAppProvider' import { useStudentApp } from './StudentAppProvider'
import { TeacherNoticeCard } from './TeacherNoticeCard' import { TeacherNoticeCard } from './TeacherNoticeCard'
import { WeekClassesList } from './WeekClassesList' import { WeekClassesList } from './WeekClassesList'
import { useTranslation } from 'react-i18next'
export function StudentHomeView() { export function StudentHomeView() {
const { student, classes, classesPending, fees } = useStudentApp() const { student, classes, classesPending, fees } = useStudentApp()
const { t } = useTranslation(['student', 'common'])
if (!student) return null if (!student) return null
const allClasses = classes?.classes ?? [] const allClasses = classes?.classes ?? []
@@ -18,12 +20,12 @@ export function StudentHomeView() {
return ( return (
<div className="space-y-6"> <div className="space-y-6">
<h1 className="text-2xl font-bold text-primary">Hola, {firstName(student.fullName)}</h1> <h1 className="text-2xl font-bold text-primary">{t('home.greeting', { name: firstName(student.fullName) })}</h1>
{fees ? <PaymentReviewBanner reports={fees.reports} /> : null} {fees ? <PaymentReviewBanner reports={fees.reports} /> : null}
{classesPending ? ( {classesPending ? (
<div className="flex justify-center py-8" role="status" aria-label="Cargando clases"> <div className="flex justify-center py-8" role="status" aria-label={t('loadingClasses')}>
<Loader2 className="size-6 animate-spin text-accent" aria-hidden="true" /> <Loader2 className="size-6 animate-spin text-accent" aria-hidden="true" />
</div> </div>
) : nextClass && classes ? ( ) : nextClass && classes ? (

View File

@@ -6,6 +6,7 @@ import { StudentBottomNav } from './StudentBottomNav'
import { StudentPicker } from './StudentPicker' import { StudentPicker } from './StudentPicker'
import { STUDENT_FLOW_PATHS } from './student-nav-items' import { STUDENT_FLOW_PATHS } from './student-nav-items'
import { useStudentApp } from './StudentAppProvider' import { useStudentApp } from './StudentAppProvider'
import { useTranslation } from 'react-i18next'
/* Shell of the student app: same mobile-first column (`max-w-md`) as the /* Shell of the student app: same mobile-first column (`max-w-md`) as the
teacher's, with its own nav. It never mounts the teacher's header, sidebar or teacher's, with its own nav. It never mounts the teacher's header, sidebar or
@@ -13,6 +14,7 @@ import { useStudentApp } from './StudentAppProvider'
export function StudentLayout() { export function StudentLayout() {
const { me, mePending, student } = useStudentApp() const { me, mePending, student } = useStudentApp()
const location = useLocation() const location = useLocation()
const { t } = useTranslation(['student', 'common'])
const isFlow = STUDENT_FLOW_PATHS.some((path) => location.pathname.startsWith(path)) const isFlow = STUDENT_FLOW_PATHS.some((path) => location.pathname.startsWith(path))
return ( return (
@@ -31,14 +33,14 @@ export function StudentLayout() {
)} )}
> >
{mePending || !me ? ( {mePending || !me ? (
<div className="flex justify-center py-20" role="status" aria-label="Cargando"> <div className="flex justify-center py-20" role="status" aria-label={t('loading')}>
<Loader2 className="size-8 animate-spin text-accent" aria-hidden="true" /> <Loader2 className="size-8 animate-spin text-accent" aria-hidden="true" />
</div> </div>
) : !student && !location.pathname.startsWith('/student/profile') ? ( ) : !student && !location.pathname.startsWith('/student/profile') ? (
<div className="mt-10 space-y-3 rounded-2xl border border-border bg-surface p-6 text-center"> <div className="mt-10 space-y-3 rounded-2xl border border-border bg-surface p-6 text-center">
<UserX className="mx-auto size-8 text-foreground" aria-hidden="true" /> <UserX className="mx-auto size-8 text-foreground" aria-hidden="true" />
<h1 className="text-lg font-bold text-primary">No tenés grupos activos</h1> <h1 className="text-lg font-bold text-primary">{t('noGroups.title')}</h1>
<p className="text-sm text-secondary">Si creés que es un error, hablá con tu profe.</p> <p className="text-sm text-secondary">{t('noGroups.description')}</p>
</div> </div>
) : ( ) : (
<Outlet /> <Outlet />

View File

@@ -6,19 +6,23 @@ import { formatPrice } from '../../lib/format'
import { FeeStatusBadge } from './FeeStatusBadge' import { FeeStatusBadge } from './FeeStatusBadge'
import { feeLabel, formatDueDate } from './format' import { feeLabel, formatDueDate } from './format'
import { useStudentApp } from './StudentAppProvider' import { useStudentApp } from './StudentAppProvider'
import { useTranslation } from 'react-i18next'
import { useIntlLocale } from '../../i18n'
const REPORT_BADGE: Record<StudentPaymentReport['status'], { label: string; variant: 'info' | 'success' | 'danger' }> = { const REPORT_BADGE: Record<StudentPaymentReport['status'], 'info' | 'success' | 'danger'> = {
reported: { label: 'Informado', variant: 'info' }, reported: 'info',
confirmed: { label: 'Confirmado', variant: 'success' }, confirmed: 'success',
rejected: { label: 'Rechazado', variant: 'danger' }, rejected: 'danger',
} }
export function StudentPaymentsView() { export function StudentPaymentsView() {
const { fees, feesPending } = useStudentApp() const { fees, feesPending } = useStudentApp()
const { t } = useTranslation(['student', 'common'])
const locale = useIntlLocale()
if (feesPending || !fees) { if (feesPending || !fees) {
return ( return (
<div className="flex justify-center py-20" role="status" aria-label="Cargando pagos"> <div className="flex justify-center py-20" role="status" aria-label={t('loadingPayments')}>
<Loader2 className="size-8 animate-spin text-accent" aria-hidden="true" /> <Loader2 className="size-8 animate-spin text-accent" aria-hidden="true" />
</div> </div>
) )
@@ -28,15 +32,15 @@ export function StudentPaymentsView() {
return ( return (
<div className="space-y-6"> <div className="space-y-6">
<h1 className="text-2xl font-bold text-primary">Pagos</h1> <h1 className="text-2xl font-bold text-primary">{t('payments.title')}</h1>
<section aria-labelledby="unpaid-title" className="space-y-3"> <section aria-labelledby="unpaid-title" className="space-y-3">
<h2 id="unpaid-title" className="text-base font-bold text-primary"> <h2 id="unpaid-title" className="text-base font-bold text-primary">
Cuotas sin pagar {t('payments.unpaid')}
</h2> </h2>
{fees.fees.length === 0 ? ( {fees.fees.length === 0 ? (
<p className="rounded-xl border border-dashed border-border px-4 py-6 text-center text-sm text-secondary"> <p className="rounded-xl border border-dashed border-border px-4 py-6 text-center text-sm text-secondary">
Estás al día. 🎉 {t('payments.upToDate')}
</p> </p>
) : ( ) : (
<ul className="divide-y divide-border rounded-2xl border border-border bg-surface"> <ul className="divide-y divide-border rounded-2xl border border-border bg-surface">
@@ -45,7 +49,7 @@ export function StudentPaymentsView() {
<div className="flex items-center justify-between gap-3"> <div className="flex items-center justify-between gap-3">
<div className="min-w-0"> <div className="min-w-0">
<p className="truncate text-sm font-medium text-primary">{feeLabel(fee)}</p> <p className="truncate text-sm font-medium text-primary">{feeLabel(fee)}</p>
<p className="text-xs text-secondary">Vence {formatDueDate(fee.dueDate)}</p> <p className="text-xs text-secondary">{t('payments.due', { date: formatDueDate(fee.dueDate) })}</p>
</div> </div>
<div className="flex shrink-0 flex-col items-end gap-1"> <div className="flex shrink-0 flex-col items-end gap-1">
<span className="text-sm font-semibold text-primary">{formatPrice(fee.amount, fee.currency)}</span> <span className="text-sm font-semibold text-primary">{formatPrice(fee.amount, fee.currency)}</span>
@@ -59,7 +63,7 @@ export function StudentPaymentsView() {
rel="noreferrer" rel="noreferrer"
className="inline-flex min-h-11 items-center gap-1 text-sm font-medium text-accent-fg hover:underline" className="inline-flex min-h-11 items-center gap-1 text-sm font-medium text-accent-fg hover:underline"
> >
Pagar con Mercado Pago {t('payments.payMp')}
<ExternalLink className="size-4" aria-hidden="true" /> <ExternalLink className="size-4" aria-hidden="true" />
</a> </a>
) : null} ) : null}
@@ -73,7 +77,7 @@ export function StudentPaymentsView() {
className="flex min-h-12 items-center justify-center gap-2 rounded-xl bg-accent font-semibold text-on-accent hover:bg-accent-strong" className="flex min-h-12 items-center justify-center gap-2 rounded-xl bg-accent font-semibold text-on-accent hover:bg-accent-strong"
> >
<Receipt className="size-5" aria-hidden="true" /> <Receipt className="size-5" aria-hidden="true" />
Informar pago {t('payments.report')}
</Link> </Link>
) : null} ) : null}
</section> </section>
@@ -81,7 +85,7 @@ export function StudentPaymentsView() {
{fees.reports.length > 0 ? ( {fees.reports.length > 0 ? (
<section aria-labelledby="reports-title" className="space-y-3"> <section aria-labelledby="reports-title" className="space-y-3">
<h2 id="reports-title" className="text-base font-bold text-primary"> <h2 id="reports-title" className="text-base font-bold text-primary">
Pagos informados {t('payments.reported')}
</h2> </h2>
<ul className="divide-y divide-border rounded-2xl border border-border bg-surface"> <ul className="divide-y divide-border rounded-2xl border border-border bg-surface">
{fees.reports.map((report) => ( {fees.reports.map((report) => (
@@ -92,19 +96,21 @@ export function StudentPaymentsView() {
{report.fees.map((fee) => feeLabel(fee)).join(', ')} {report.fees.map((fee) => feeLabel(fee)).join(', ')}
</p> </p>
<p className="text-xs text-secondary"> <p className="text-xs text-secondary">
Informado el {new Date(report.createdAt).toLocaleDateString('es-AR', { day: 'numeric', month: 'short' })} {t('payments.reportedOn', {
date: new Date(report.createdAt).toLocaleDateString(locale, { day: 'numeric', month: 'short' }),
})}
</p> </p>
</div> </div>
<div className="flex shrink-0 flex-col items-end gap-1"> <div className="flex shrink-0 flex-col items-end gap-1">
<span className="text-sm font-semibold text-primary">{formatPrice(report.totalAmount, report.currency)}</span> <span className="text-sm font-semibold text-primary">{formatPrice(report.totalAmount, report.currency)}</span>
<Badge variant={REPORT_BADGE[report.status].variant}>{REPORT_BADGE[report.status].label}</Badge> <Badge variant={REPORT_BADGE[report.status]}>{t(`payments.status.${report.status}`)}</Badge>
</div> </div>
</div> </div>
{report.note ? ( {report.note ? (
<p className="mt-2 whitespace-pre-line break-words text-xs text-secondary">Tu nota: {report.note}</p> <p className="mt-2 whitespace-pre-line break-words text-xs text-secondary">{t('payments.yourNote', { note: report.note })}</p>
) : null} ) : null}
{report.status === 'rejected' && report.rejectionReason ? ( {report.status === 'rejected' && report.rejectionReason ? (
<p className="mt-2 rounded-lg bg-danger-soft px-3 py-2 text-xs text-primary">Motivo: {report.rejectionReason}</p> <p className="mt-2 rounded-lg bg-danger-soft px-3 py-2 text-xs text-primary">{t('payments.reason', { reason: report.rejectionReason })}</p>
) : null} ) : null}
</li> </li>
))} ))}

View File

@@ -4,12 +4,14 @@ import { Avatar } from '../../components/ui'
import { cn } from '../../lib/utils' import { cn } from '../../lib/utils'
import { firstName } from './format' import { firstName } from './format'
import { useStudentApp } from './StudentAppProvider' import { useStudentApp } from './StudentAppProvider'
import { useTranslation } from 'react-i18next'
/* Selector of the attendee the screens show, only when the account has more /* Selector of the attendee the screens show, only when the account has more
than one (a guardian with several children). */ than one (a guardian with several children). */
export function StudentPicker() { export function StudentPicker() {
const { me, student, selectStudent } = useStudentApp() const { me, student, selectStudent } = useStudentApp()
const [open, setOpen] = useState(false) const [open, setOpen] = useState(false)
const { t } = useTranslation(['student', 'common'])
const containerRef = useRef<HTMLDivElement>(null) const containerRef = useRef<HTMLDivElement>(null)
useEffect(() => { useEffect(() => {
@@ -37,7 +39,7 @@ export function StudentPicker() {
onClick={() => setOpen((value) => !value)} onClick={() => setOpen((value) => !value)}
aria-haspopup="listbox" aria-haspopup="listbox"
aria-expanded={open} aria-expanded={open}
aria-label={`Alumno: ${student.fullName}. Cambiar`} aria-label={t('picker.label', { name: student.fullName })}
className="flex min-h-11 items-center gap-2 rounded-xl px-2 hover:bg-primary-soft" className="flex min-h-11 items-center gap-2 rounded-xl px-2 hover:bg-primary-soft"
> >
<Avatar name={student.fullName} className="size-8 rounded-full text-xs" /> <Avatar name={student.fullName} className="size-8 rounded-full text-xs" />
@@ -47,7 +49,7 @@ export function StudentPicker() {
{open ? ( {open ? (
<ul <ul
role="listbox" role="listbox"
aria-label="Elegí el alumno" aria-label={t('picker.listLabel')}
className="absolute right-0 top-full z-50 mt-2 w-64 rounded-xl border border-border bg-surface p-1 shadow-xl" className="absolute right-0 top-full z-50 mt-2 w-64 rounded-xl border border-border bg-surface p-1 shadow-xl"
> >
{students.map((item) => { {students.map((item) => {

View File

@@ -3,14 +3,17 @@ import { Avatar, Button } from '../../components/ui'
import { PasskeyCard } from './PasskeyCard' import { PasskeyCard } from './PasskeyCard'
import { RecoveryEmailCard } from './RecoveryEmailCard' import { RecoveryEmailCard } from './RecoveryEmailCard'
import { useStudentApp } from './StudentAppProvider' import { useStudentApp } from './StudentAppProvider'
import { useTranslation } from 'react-i18next'
import { LanguageCard } from '../settings/LanguageCard'
export function StudentProfileView() { export function StudentProfileView() {
const { me, logout, loggingOut } = useStudentApp() const { me, logout, loggingOut } = useStudentApp()
const { t } = useTranslation(['student', 'common'])
if (!me) return null if (!me) return null
return ( return (
<div className="space-y-6"> <div className="space-y-6">
<h1 className="text-2xl font-bold text-primary">Perfil</h1> <h1 className="text-2xl font-bold text-primary">{t('profile.title')}</h1>
<section className="flex items-center gap-3 rounded-2xl border border-border bg-surface p-4"> <section className="flex items-center gap-3 rounded-2xl border border-border bg-surface p-4">
<Avatar name={me.account.name} className="size-12 rounded-full text-base" /> <Avatar name={me.account.name} className="size-12 rounded-full text-base" />
@@ -24,10 +27,11 @@ export function StudentProfileView() {
<PasskeyCard /> <PasskeyCard />
<RecoveryEmailCard /> <RecoveryEmailCard />
<LanguageCard />
<Button variant="outline" className="h-12 w-full" onClick={logout} disabled={loggingOut}> <Button variant="outline" className="h-12 w-full" onClick={logout} disabled={loggingOut}>
<LogOut className="size-5" aria-hidden="true" /> <LogOut className="size-5" aria-hidden="true" />
Cerrar sesión en este teléfono {t('profile.logout')}
</Button> </Button>
</div> </div>
) )

View File

@@ -1,16 +1,18 @@
import { Megaphone } from 'lucide-react' import { Megaphone } from 'lucide-react'
import { useTranslation } from 'react-i18next'
/* "Avisos del profe": gruperly doesn't publish announcements yet, so this is /* "Avisos del profe": gruperly doesn't publish announcements yet, so this is
the empty state the feature will fill. */ the empty state the feature will fill. */
export function TeacherNoticeCard({ teacherName }: { teacherName: string }) { export function TeacherNoticeCard({ teacherName }: { teacherName: string }) {
const { t } = useTranslation(['student', 'common'])
return ( return (
<section aria-labelledby="notices-title" className="space-y-3"> <section aria-labelledby="notices-title" className="space-y-3">
<h2 id="notices-title" className="text-base font-bold text-primary"> <h2 id="notices-title" className="text-base font-bold text-primary">
Avisos del profe {t('home.notices')}
</h2> </h2>
<div className="flex gap-3 rounded-2xl border border-dashed border-border px-4 py-5 text-sm text-secondary"> <div className="flex gap-3 rounded-2xl border border-dashed border-border px-4 py-5 text-sm text-secondary">
<Megaphone className="size-5 shrink-0" aria-hidden="true" /> <Megaphone className="size-5 shrink-0" aria-hidden="true" />
<p>Cuando {teacherName} publique un aviso, lo vas a ver acá.</p> <p>{t('home.noticesEmpty', { teacher: teacherName })}</p>
</div> </div>
</section> </section>
) )

View File

@@ -1,18 +1,20 @@
import type { TransferDetails } from '@gruperly/shared' import type { TransferDetails } from '@gruperly/shared'
import { Check, Copy } from 'lucide-react' import { Check, Copy } from 'lucide-react'
import { useCopyToClipboard } from '../attendee-detail/useCopyToClipboard' import { useCopyToClipboard } from '../attendee-detail/useCopyToClipboard'
import { Trans, useTranslation } from 'react-i18next'
export function TransferDetailsCard({ transfer }: { transfer: TransferDetails }) { export function TransferDetailsCard({ transfer }: { transfer: TransferDetails }) {
const { copied, copy } = useCopyToClipboard() const { copied, copy } = useCopyToClipboard()
const { t } = useTranslation(['student', 'common'])
return ( return (
<section aria-labelledby="transfer-title" className="rounded-2xl border border-border bg-primary-soft p-4"> <section aria-labelledby="transfer-title" className="rounded-2xl border border-border bg-primary-soft p-4">
<h2 id="transfer-title" className="text-sm font-semibold text-primary"> <h2 id="transfer-title" className="text-sm font-semibold text-primary">
Datos para transferir {t('transfer.title')}
</h2> </h2>
<div className="mt-3 flex items-center justify-between gap-3"> <div className="mt-3 flex items-center justify-between gap-3">
<div className="min-w-0"> <div className="min-w-0">
<p className="text-xs text-secondary">Alias</p> <p className="text-xs text-secondary">{t('transfer.alias')}</p>
<p className="truncate font-mono text-base font-semibold text-primary">{transfer.alias}</p> <p className="truncate font-mono text-base font-semibold text-primary">{transfer.alias}</p>
</div> </div>
<button <button
@@ -21,12 +23,17 @@ export function TransferDetailsCard({ transfer }: { transfer: TransferDetails })
className="flex min-h-11 shrink-0 items-center gap-2 rounded-xl border border-border bg-surface px-3 text-sm font-medium text-primary hover:bg-primary-soft" className="flex min-h-11 shrink-0 items-center gap-2 rounded-xl border border-border bg-surface px-3 text-sm font-medium text-primary hover:bg-primary-soft"
> >
{copied ? <Check className="size-4 text-success" aria-hidden="true" /> : <Copy className="size-4" aria-hidden="true" />} {copied ? <Check className="size-4 text-success" aria-hidden="true" /> : <Copy className="size-4" aria-hidden="true" />}
<span aria-live="polite">{copied ? 'Copiado' : 'Copiar'}</span> <span aria-live="polite">{copied ? t('transfer.copied') : t('transfer.copy')}</span>
</button> </button>
</div> </div>
{transfer.holder ? ( {transfer.holder ? (
<p className="mt-2 text-sm text-secondary"> <p className="mt-2 text-sm text-secondary">
Titular: <span className="font-medium text-primary">{transfer.holder}</span> <Trans
t={t}
i18nKey="transfer.holder"
values={{ holder: transfer.holder }}
components={{ strong: <span className="font-medium text-primary" /> }}
/>
</p> </p>
) : null} ) : null}
</section> </section>

View File

@@ -1,20 +1,22 @@
import type { StudentClass } from '@gruperly/shared' import type { StudentClass } from '@gruperly/shared'
import { cn } from '../../lib/utils' import { cn } from '../../lib/utils'
import { formatShortDate, formatTime } from './format' import { formatShortDate, formatTime } from './format'
import { useTranslation } from 'react-i18next'
type WeekClassesListProps = { classes: StudentClass[]; timeZone: string } type WeekClassesListProps = { classes: StudentClass[]; timeZone: string }
/* "Esta semana": past classes dimmed, notified ones struck through with /* "Esta semana": past classes dimmed, notified ones struck through with
"Avisaste" next to them (the word, not only the strike, carries it). */ "Avisaste" next to them (the word, not only the strike, carries it). */
export function WeekClassesList({ classes, timeZone }: WeekClassesListProps) { export function WeekClassesList({ classes, timeZone }: WeekClassesListProps) {
const { t } = useTranslation(['student', 'common'])
return ( return (
<section aria-labelledby="week-title" className="space-y-3"> <section aria-labelledby="week-title" className="space-y-3">
<h2 id="week-title" className="text-base font-bold text-primary"> <h2 id="week-title" className="text-base font-bold text-primary">
Esta semana {t('home.thisWeek')}
</h2> </h2>
{classes.length === 0 ? ( {classes.length === 0 ? (
<p className="rounded-xl border border-dashed border-border px-4 py-6 text-center text-sm text-secondary"> <p className="rounded-xl border border-dashed border-border px-4 py-6 text-center text-sm text-secondary">
No tenés clases esta semana. {t('home.noWeekClasses')}
</p> </p>
) : ( ) : (
<ul className="divide-y divide-border rounded-2xl border border-border bg-surface"> <ul className="divide-y divide-border rounded-2xl border border-border bg-surface">
@@ -27,9 +29,9 @@ export function WeekClassesList({ classes, timeZone }: WeekClassesListProps) {
</p> </p>
</div> </div>
{item.notice ? ( {item.notice ? (
<span className="shrink-0 rounded-full bg-primary-soft px-2.5 py-0.5 text-xs font-medium text-primary">Avisaste</span> <span className="shrink-0 rounded-full bg-primary-soft px-2.5 py-0.5 text-xs font-medium text-primary">{t('home.notifiedTag')}</span>
) : item.started ? ( ) : item.started ? (
<span className="shrink-0 text-xs text-secondary">Pasó</span> <span className="shrink-0 text-xs text-secondary">{t('home.past')}</span>
) : null} ) : null}
</li> </li>
))} ))}

View File

@@ -5,12 +5,14 @@ import { Button, Input, Label } from '../../components/ui'
import { FlowFooter } from './FlowFooter' import { FlowFooter } from './FlowFooter'
import { PasskeyCard } from './PasskeyCard' import { PasskeyCard } from './PasskeyCard'
import { useStudentApp } from './StudentAppProvider' import { useStudentApp } from './StudentAppProvider'
import { useTranslation } from 'react-i18next'
/* First sign-in only. Both options are skippable: "Ahora no" goes straight in. */ /* First sign-in only. Both options are skippable: "Ahora no" goes straight in. */
export function WelcomeView() { export function WelcomeView() {
const navigate = useNavigate() const navigate = useNavigate()
const { finishWelcome, saveRecoveryEmail } = useStudentApp() const { finishWelcome, saveRecoveryEmail } = useStudentApp()
const [email, setEmail] = useState('') const [email, setEmail] = useState('')
const { t } = useTranslation(['student', 'common'])
const goHome = () => const goHome = () =>
finishWelcome.mutate(undefined, { onSettled: () => void navigate({ to: '/student', replace: true }) }) finishWelcome.mutate(undefined, { onSettled: () => void navigate({ to: '/student', replace: true }) })
@@ -32,9 +34,9 @@ export function WelcomeView() {
<div className="mx-auto flex size-16 items-center justify-center rounded-full bg-success-soft text-success"> <div className="mx-auto flex size-16 items-center justify-center rounded-full bg-success-soft text-success">
<CheckCircle2 className="size-8" aria-hidden="true" /> <CheckCircle2 className="size-8" aria-hidden="true" />
</div> </div>
<h1 className="mt-4 text-2xl font-bold text-primary">¡Listo, ya estás adentro!</h1> <h1 className="mt-4 text-2xl font-bold text-primary">{t('welcome.title')}</h1>
<p className="mt-2 text-sm leading-relaxed text-secondary"> <p className="mt-2 text-sm leading-relaxed text-secondary">
Vas a quedar conectado/a en este teléfono. Si querés, sumá una de estas opciones para no perder el acceso. {t('welcome.description')}
</p> </p>
</div> </div>
@@ -42,11 +44,11 @@ export function WelcomeView() {
<section aria-labelledby="welcome-email-title" className="rounded-2xl border border-border bg-surface p-5"> <section aria-labelledby="welcome-email-title" className="rounded-2xl border border-border bg-surface p-5">
<h2 id="welcome-email-title" className="text-base font-bold text-primary"> <h2 id="welcome-email-title" className="text-base font-bold text-primary">
Mail de recuperación <span className="font-normal text-secondary">(opcional)</span> {t('recovery.title')} <span className="font-normal text-secondary">{t('recovery.optional')}</span>
</h2> </h2>
<p className="mt-1 text-sm text-secondary">Te mandamos un link para confirmarlo.</p> <p className="mt-1 text-sm text-secondary">{t('welcome.emailHint')}</p>
<div className="mt-3 space-y-1.5"> <div className="mt-3 space-y-1.5">
<Label htmlFor="welcome-email">Tu mail</Label> <Label htmlFor="welcome-email">{t('recovery.label')}</Label>
<Input <Input
id="welcome-email" id="welcome-email"
type="email" type="email"
@@ -59,7 +61,7 @@ export function WelcomeView() {
</div> </div>
{saveRecoveryEmail.isError ? ( {saveRecoveryEmail.isError ? (
<p role="alert" className="mt-2 text-sm text-danger-fg"> <p role="alert" className="mt-2 text-sm text-danger-fg">
Revisá el mail o seguí sin cargarlo. {t('welcome.emailError')}
</p> </p>
) : null} ) : null}
</section> </section>
@@ -67,11 +69,11 @@ export function WelcomeView() {
<FlowFooter> <FlowFooter>
<div className="flex gap-2"> <div className="flex gap-2">
<Button variant="outline" className="h-12 flex-1" onClick={goHome} disabled={busy}> <Button variant="outline" className="h-12 flex-1" onClick={goHome} disabled={busy}>
Ahora no {t('welcome.later')}
</Button> </Button>
<Button variant="primary" className="h-12 flex-1" onClick={handleContinue} disabled={busy}> <Button variant="primary" className="h-12 flex-1" onClick={handleContinue} disabled={busy}>
{busy ? <Loader2 className="size-5 animate-spin" aria-hidden="true" /> : null} {busy ? <Loader2 className="size-5 animate-spin" aria-hidden="true" /> : null}
Continuar {t('welcome.continue')}
</Button> </Button>
</div> </div>
</FlowFooter> </FlowFooter>

View File

@@ -1,4 +1,5 @@
import type { AbsenceReasonValue, StudentFee } from '@gruperly/shared' import type { AbsenceReasonValue, StudentFee } from '@gruperly/shared'
import { i18n } from '../../i18n/instance'
/* Dates of the student app are shown on the teacher's clock (the class time /* Dates of the student app are shown on the teacher's clock (the class time
zone the API returns), not the phone's: "18:00" is when the class starts. */ zone the API returns), not the phone's: "18:00" is when the class starts. */
@@ -18,59 +19,58 @@ export function daysFromToday(iso: string, timeZone: string, now: Date = new Dat
export function formatRelativeDay(iso: string, timeZone: string, now: Date = new Date()): string { export function formatRelativeDay(iso: string, timeZone: string, now: Date = new Date()): string {
const days = daysFromToday(iso, timeZone, now) const days = daysFromToday(iso, timeZone, now)
if (days === 0) return 'hoy' if (days === 0) return i18n.t('student:today')
if (days === 1) return 'mañana' if (days === 1) return i18n.t('student:tomorrow')
if (days === -1) return 'ayer' if (days === -1) return i18n.t('student:yesterday')
return new Intl.DateTimeFormat('es-AR', { timeZone, weekday: 'long' }).format(new Date(iso)) return new Intl.DateTimeFormat(i18n.language, { timeZone, weekday: 'long' }).format(new Date(iso))
} }
/** "Miércoles 28 de octubre" */ /** "Miércoles 28 de octubre" */
export function formatLongDate(iso: string, timeZone: string): string { export function formatLongDate(iso: string, timeZone: string): string {
const text = new Intl.DateTimeFormat('es-AR', { timeZone, weekday: 'long', day: 'numeric', month: 'long' }).format(new Date(iso)) const text = new Intl.DateTimeFormat(i18n.language, { timeZone, weekday: 'long', day: 'numeric', month: 'long' }).format(new Date(iso))
return text.charAt(0).toUpperCase() + text.slice(1) return text.charAt(0).toUpperCase() + text.slice(1)
} }
/** "mié 28 oct" */ /** "mié 28 oct" */
export function formatShortDate(iso: string, timeZone: string): string { export function formatShortDate(iso: string, timeZone: string): string {
return new Intl.DateTimeFormat('es-AR', { timeZone, weekday: 'short', day: 'numeric', month: 'short' }) return new Intl.DateTimeFormat(i18n.language, { timeZone, weekday: 'short', day: 'numeric', month: 'short' })
.format(new Date(iso)) .format(new Date(iso))
.replace(/\./g, '') .replace(/\./g, '')
} }
export function formatTime(iso: string, timeZone: string): string { export function formatTime(iso: string, timeZone: string): string {
return new Intl.DateTimeFormat('es-AR', { timeZone, hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }).format(new Date(iso)) return new Intl.DateTimeFormat(i18n.language, { timeZone, hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }).format(new Date(iso))
} }
/** Day of month and short month, for the mini date card: { day: '28', month: 'oct' }. */ /** Day of month and short month, for the mini date card: { day: '28', month: 'oct' }. */
export function dateParts(iso: string, timeZone: string): { day: string; month: string } { export function dateParts(iso: string, timeZone: string): { day: string; month: string } {
const date = new Date(iso) const date = new Date(iso)
return { return {
day: new Intl.DateTimeFormat('es-AR', { timeZone, day: 'numeric' }).format(date), day: new Intl.DateTimeFormat(i18n.language, { timeZone, day: 'numeric' }).format(date),
month: new Intl.DateTimeFormat('es-AR', { timeZone, month: 'short' }).format(date).replace('.', ''), month: new Intl.DateTimeFormat(i18n.language, { timeZone, month: 'short' }).format(date).replace('.', ''),
} }
} }
/** Fee title: its description, or the month it is due ("Noviembre"). */ /** Fee title: its description, or the month it is due ("Noviembre"). */
export function feeLabel(fee: Pick<StudentFee, 'description' | 'dueDate'>): string { export function feeLabel(fee: Pick<StudentFee, 'description' | 'dueDate'>): string {
if (fee.description) return fee.description if (fee.description) return fee.description
const month = new Intl.DateTimeFormat('es-AR', { month: 'long', timeZone: 'UTC' }).format(new Date(fee.dueDate)) const month = new Intl.DateTimeFormat(i18n.language, { month: 'long', timeZone: 'UTC' }).format(new Date(fee.dueDate))
return month.charAt(0).toUpperCase() + month.slice(1) return month.charAt(0).toUpperCase() + month.slice(1)
} }
export function formatDueDate(iso: string): string { export function formatDueDate(iso: string): string {
return new Intl.DateTimeFormat('es-AR', { day: 'numeric', month: 'short', timeZone: 'UTC' }).format(new Date(iso)).replace('.', '') return new Intl.DateTimeFormat(i18n.language, { day: 'numeric', month: 'short', timeZone: 'UTC' }).format(new Date(iso)).replace('.', '')
} }
export function formatFileSize(bytes: number): string { export function formatFileSize(bytes: number): string {
if (bytes < 1024 * 1024) return `${Math.max(1, Math.round(bytes / 1024))} KB` if (bytes < 1024 * 1024) return `${Math.max(1, Math.round(bytes / 1024))} KB`
return `${(bytes / (1024 * 1024)).toFixed(1).replace('.', ',')} MB` return `${new Intl.NumberFormat(i18n.language, { maximumFractionDigits: 1, minimumFractionDigits: 1 }).format(bytes / (1024 * 1024))} MB`
} }
export const ABSENCE_REASON_LABELS: Record<AbsenceReasonValue, string> = { export const ABSENCE_REASONS: readonly AbsenceReasonValue[] = ['health', 'travel', 'work_study', 'other']
health: 'Salud',
travel: 'Viaje', export function absenceReasonLabel(reason: AbsenceReasonValue): string {
work_study: 'Trabajo o estudio', return i18n.t(`student:reason.${reason}`)
other: 'Otro',
} }
export function firstName(fullName: string): string { export function firstName(fullName: string): string {

View File

@@ -1,13 +1,18 @@
import { CalendarDays, Home, User, Wallet, type LucideIcon } from 'lucide-react' import { CalendarDays, Home, User, Wallet, type LucideIcon } from 'lucide-react'
type StudentNavItem = { label: string; to: string; icon: LucideIcon } /** `label`: key in the `student` namespace (`nav.*`). */
type StudentNavItem = {
label: 'nav.home' | 'nav.classes' | 'nav.payments' | 'nav.profile'
to: string
icon: LucideIcon
}
// Bottom nav of the student app: the single source for StudentBottomNav. // Bottom nav of the student app: the single source for StudentBottomNav.
export const STUDENT_NAV_ITEMS: StudentNavItem[] = [ export const STUDENT_NAV_ITEMS: StudentNavItem[] = [
{ label: 'Inicio', to: '/student', icon: Home }, { label: 'nav.home', to: '/student', icon: Home },
{ label: 'Clases', to: '/student/classes', icon: CalendarDays }, { label: 'nav.classes', to: '/student/classes', icon: CalendarDays },
{ label: 'Pagos', to: '/student/payments', icon: Wallet }, { label: 'nav.payments', to: '/student/payments', icon: Wallet },
{ label: 'Perfil', to: '/student/profile', icon: User }, { label: 'nav.profile', to: '/student/profile', icon: User },
] ]
/* Flow screens with their own fixed bottom button: no nav there. */ /* Flow screens with their own fixed bottom button: no nav there. */

View File

@@ -21,6 +21,7 @@ import type onboarding from './locales/es-AR/onboarding.json'
import type account from './locales/es-AR/account.json' import type account from './locales/es-AR/account.json'
import type public from './locales/es-AR/public.json' import type public from './locales/es-AR/public.json'
import type studentAccess from './locales/es-AR/studentAccess.json' import type studentAccess from './locales/es-AR/studentAccess.json'
import type student from './locales/es-AR/student.json'
import type validation from './locales/es-AR/validation.json' import type validation from './locales/es-AR/validation.json'
// es-AR es la fuente: una clave que no exista ahí rompe el typecheck. // es-AR es la fuente: una clave que no exista ahí rompe el typecheck.
@@ -35,6 +36,7 @@ declare module 'i18next' {
pwa: typeof pwa pwa: typeof pwa
settings: typeof settings settings: typeof settings
validation: typeof validation validation: typeof validation
'student': typeof student
'studentAccess': typeof studentAccess 'studentAccess': typeof studentAccess
'public': typeof public 'public': typeof public
'account': typeof account 'account': typeof account

View File

@@ -0,0 +1,169 @@
{
"nav": {
"label": "Sections",
"home": "Home",
"classes": "Classes",
"payments": "Payments",
"profile": "Profile"
},
"loading": "Loading",
"loadingClasses": "Loading classes",
"loadingPayments": "Loading payments",
"back": "Back",
"backHome": "Back to home",
"today": "today",
"tomorrow": "tomorrow",
"yesterday": "yesterday",
"reason": {
"health": "Health",
"travel": "Travel",
"work_study": "Work or school",
"other": "Other"
},
"feeStatus": {
"pending": "Pending",
"overdue": "Overdue",
"reported": "Reported"
},
"noGroups": {
"title": "You don't have any active groups",
"description": "If you think this is a mistake, talk to your teacher."
},
"picker": {
"label": "Student: {{name}}. Change",
"listLabel": "Choose the student"
},
"home": {
"greeting": "Hi, {{name}}",
"nextClass": "Next class · {{when}}",
"notified": "You said you won't make it",
"notGoing": "I can't make it",
"thisWeek": "This week",
"noWeekClasses": "You have no classes this week.",
"notifiedTag": "Notified",
"past": "Done",
"notices": "Teacher's notices",
"noticesEmpty": "When {{teacher}} posts a notice, you'll see it here."
},
"fee": {
"yourFee": "Your fee",
"unpaid": "{{count}} unpaid fees",
"overdue": "Some are overdue",
"payMp": "Pay with Mercado Pago",
"report": "Report payment",
"awaiting": "Your teacher needs to confirm the payment you reported."
},
"review": {
"confirmed": "Your teacher confirmed your {{amount}} payment.",
"rejected": "Your teacher couldn't confirm your {{amount}} payment.",
"reason": " Reason: {{reason}}.",
"retry": " You can report it again."
},
"classes": {
"title": "Classes",
"notify": "I can't make it",
"empty": "No classes scheduled for the next few weeks.",
"notified": "Notified",
"undo": "Undo",
"undoLabel": "Undo the notice for {{date}}",
"undone": "Done, you're back on the list.",
"undoError": "We couldn't undo the notice. If the class already started, it can't be undone."
},
"payments": {
"title": "Payments",
"unpaid": "Unpaid fees",
"upToDate": "You're all caught up. 🎉",
"due": "Due {{date}}",
"payMp": "Pay with Mercado Pago",
"report": "Report payment",
"reported": "Reported payments",
"reportedOn": "Reported on {{date}}",
"yourNote": "Your note: {{note}}",
"reason": "Reason: {{reason}}",
"status": {
"reported": "Reported",
"confirmed": "Confirmed",
"rejected": "Declined"
}
},
"notify": {
"done": "Done, we let {{teacher}} know",
"doneHint": "If you change your mind, you can undo it from Classes before the class starts.",
"seeClasses": "See my classes",
"title": "I can't make it",
"which": "Which classes will you miss?",
"none": "There are no classes to report.",
"reason": "Reason",
"optional": "(optional)",
"message": "Message for {{teacher}} (optional)",
"hint": "If you let them know before class, the absence counts as excused.",
"error": "We couldn't send the notice. If a class already started, remove it and try again.",
"pick": "Choose at least one class",
"submit_one": "Report {{count}} class",
"submit_other": "Report {{count}} classes"
},
"report": {
"done": "Payment reported",
"doneHint": "{{teacher}} will review the receipt. We'll let you know here once it's confirmed.",
"title": "Report payment",
"which": "Which fees did you pay?",
"none": "You have no fees to report.",
"receipt": "Receipt",
"note": "Note for {{teacher}} (optional)",
"notePlaceholder": "E.g. I paid from my mom's account",
"hint": "{{teacher}} will confirm the payment. Until then it shows as Reported.",
"alreadyReported": "You already reported some of these fees.",
"checkReceipt": "Check the receipt.",
"error": "We couldn't send the payment. Please try again.",
"pickFee": "Choose at least one fee",
"attach": "Attach the receipt",
"submit": "Send · {{amount}}",
"due": "Due {{date}}"
},
"receipt": {
"tooBig": "The file is larger than {{max}} MB.",
"badType": "It has to be a screenshot (JPG, PNG, WEBP, HEIC) or a PDF.",
"remove": "Remove receipt",
"attach": "Attach a screenshot or PDF",
"max": "Up to {{max}} MB"
},
"transfer": {
"title": "Bank transfer details",
"alias": "Account",
"copied": "Copied",
"copy": "Copy",
"holder": "Account holder: <strong>{{holder}}</strong>"
},
"profile": {
"title": "Profile",
"logout": "Sign out on this phone"
},
"passkey": {
"active": "Face ID on",
"title": "Sign in with Face ID or fingerprint",
"activeHint": "If your session ends, you sign in with your face or fingerprint, without asking your teacher for a link.",
"hint": "If your session ends or you switch browsers, you'll be able to sign back in without asking your teacher for a link.",
"error": "We couldn't turn it on on this phone.",
"remove": "Remove Face ID or fingerprint",
"activate": "Turn on"
},
"recovery": {
"title": "Recovery email",
"optional": "(optional)",
"confirmed": "Confirmed: <strong>{{email}}</strong>",
"pending": "We sent a link to <strong>{{email}}</strong> to confirm it.",
"hint": "To request a sign-in link if you lose access.",
"label": "Your email",
"error": "We couldn't save the email. Try again in a bit.",
"change": "Change",
"remove": "Remove"
},
"welcome": {
"title": "You're in!",
"description": "You'll stay signed in on this phone. If you want, add one of these options so you don't lose access.",
"emailHint": "We'll send you a link to confirm it.",
"emailError": "Check the email or continue without it.",
"later": "Not now",
"continue": "Continue"
}
}

View File

@@ -0,0 +1,169 @@
{
"nav": {
"label": "Secciones",
"home": "Inicio",
"classes": "Clases",
"payments": "Pagos",
"profile": "Perfil"
},
"loading": "Cargando",
"loadingClasses": "Cargando clases",
"loadingPayments": "Cargando pagos",
"back": "Volver",
"backHome": "Volver al inicio",
"today": "hoy",
"tomorrow": "mañana",
"yesterday": "ayer",
"reason": {
"health": "Salud",
"travel": "Viaje",
"work_study": "Trabajo o estudio",
"other": "Otro"
},
"feeStatus": {
"pending": "Pendiente",
"overdue": "Vencida",
"reported": "Informada"
},
"noGroups": {
"title": "No tienes grupos activos",
"description": "Si crees que es un error, habla con tu profe."
},
"picker": {
"label": "Alumno: {{name}}. Cambiar",
"listLabel": "Elige el alumno"
},
"home": {
"greeting": "Hola, {{name}}",
"nextClass": "Próxima clase · {{when}}",
"notified": "Avisaste que no vas",
"notGoing": "No voy a ir",
"thisWeek": "Esta semana",
"noWeekClasses": "No tienes clases esta semana.",
"notifiedTag": "Avisaste",
"past": "Pasó",
"notices": "Avisos del profe",
"noticesEmpty": "Cuando {{teacher}} publique un aviso, lo verás aquí."
},
"fee": {
"yourFee": "Tu cuota",
"unpaid": "{{count}} cuotas sin pagar",
"overdue": "Hay vencidas",
"payMp": "Pagar con Mercado Pago",
"report": "Informar pago",
"awaiting": "Tu profe tiene que confirmar el pago que informaste."
},
"review": {
"confirmed": "Tu profe confirmó tu pago de {{amount}}.",
"rejected": "Tu profe no pudo confirmar tu pago de {{amount}}.",
"reason": " Motivo: {{reason}}.",
"retry": " Puedes volver a informarlo."
},
"classes": {
"title": "Clases",
"notify": "Avisar que no voy",
"empty": "No hay clases programadas en las próximas semanas.",
"notified": "Avisaste",
"undo": "Deshacer",
"undoLabel": "Deshacer el aviso del {{date}}",
"undone": "Listo, quedaste inscrito/a otra vez.",
"undoError": "No pudimos deshacer el aviso. Si la clase ya empezó, ya no se puede."
},
"payments": {
"title": "Pagos",
"unpaid": "Cuotas sin pagar",
"upToDate": "Estás al día. 🎉",
"due": "Vence {{date}}",
"payMp": "Pagar con Mercado Pago",
"report": "Informar pago",
"reported": "Pagos informados",
"reportedOn": "Informado el {{date}}",
"yourNote": "Tu nota: {{note}}",
"reason": "Motivo: {{reason}}",
"status": {
"reported": "Informado",
"confirmed": "Confirmado",
"rejected": "Rechazado"
}
},
"notify": {
"done": "Listo, le avisamos a {{teacher}}",
"doneHint": "Si cambias de idea, puedes deshacerlo desde Clases mientras la clase no haya empezado.",
"seeClasses": "Ver mis clases",
"title": "Avisar que no voy",
"which": "¿A qué clases no vas?",
"none": "No hay clases para avisar.",
"reason": "Motivo",
"optional": "(opcional)",
"message": "Mensaje para {{teacher}} (opcional)",
"hint": "Si avisas antes de la clase, la falta queda como justificada.",
"error": "No pudimos enviar el aviso. Si alguna clase ya empezó, quítala e inténtalo de nuevo.",
"pick": "Elige al menos una clase",
"submit_one": "Avisar {{count}} clase",
"submit_other": "Avisar {{count}} clases"
},
"report": {
"done": "Pago informado",
"doneHint": "{{teacher}} revisará el comprobante. Te avisaremos aquí cuando lo confirme.",
"title": "Informar pago",
"which": "¿Qué cuotas pagaste?",
"none": "No tenés cuotas para informar.",
"receipt": "Comprobante",
"note": "Nota para {{teacher}} (opcional)",
"notePlaceholder": "Ej.: pagué desde la cuenta de mi mamá",
"hint": "{{teacher}} confirmará el pago. Mientras tanto figura como Informado.",
"alreadyReported": "Ya informaste alguna de estas cuotas.",
"checkReceipt": "Revisa el comprobante.",
"error": "No pudimos enviar el pago. Inténtalo de nuevo.",
"pickFee": "Elige al menos una cuota",
"attach": "Adjunta el comprobante",
"submit": "Enviar · {{amount}}",
"due": "Vence {{date}}"
},
"receipt": {
"tooBig": "El archivo pesa más de {{max}} MB.",
"badType": "Tiene que ser una captura (JPG, PNG, WEBP, HEIC) o un PDF.",
"remove": "Quitar comprobante",
"attach": "Adjuntar captura o PDF",
"max": "Hasta {{max}} MB"
},
"transfer": {
"title": "Datos para transferir",
"alias": "Alias",
"copied": "Copiado",
"copy": "Copiar",
"holder": "Titular: <strong>{{holder}}</strong>"
},
"profile": {
"title": "Perfil",
"logout": "Cerrar sesión en este teléfono"
},
"passkey": {
"active": "Face ID activado",
"title": "Entrar con Face ID o huella",
"activeHint": "Si se cierra tu sesión, entras con tu cara o tu huella, sin pedirle un link a tu profe.",
"hint": "Si se cierra tu sesión o cambias de navegador, podrás volver a entrar sin pedirle un link a tu profe.",
"error": "No pudimos activarlo en este teléfono.",
"remove": "Quitar Face ID o huella",
"activate": "Activar"
},
"recovery": {
"title": "Mail de recuperación",
"optional": "(opcional)",
"confirmed": "Confirmado: <strong>{{email}}</strong>",
"pending": "Te enviamos un link a <strong>{{email}}</strong> para confirmarlo.",
"hint": "Para pedir un link de ingreso si pierdes el acceso.",
"label": "Tu mail",
"error": "No pudimos guardar el mail. Inténtalo de nuevo en un rato.",
"change": "Cambiar",
"remove": "Quitar"
},
"welcome": {
"title": "¡Listo, ya estás adentro!",
"description": "Quedarás conectado/a en este teléfono. Si quieres, agrega una de estas opciones para no perder el acceso.",
"emailHint": "Te enviaremos un link para confirmarlo.",
"emailError": "Revisa el mail o sigue sin registrarlo.",
"later": "Ahora no",
"continue": "Continuar"
}
}

View File

@@ -0,0 +1,169 @@
{
"nav": {
"label": "Secciones",
"home": "Inicio",
"classes": "Clases",
"payments": "Pagos",
"profile": "Perfil"
},
"loading": "Cargando",
"loadingClasses": "Cargando clases",
"loadingPayments": "Cargando pagos",
"back": "Volver",
"backHome": "Volver al inicio",
"today": "hoy",
"tomorrow": "mañana",
"yesterday": "ayer",
"reason": {
"health": "Salud",
"travel": "Viaje",
"work_study": "Trabajo o estudio",
"other": "Otro"
},
"feeStatus": {
"pending": "Pendiente",
"overdue": "Vencida",
"reported": "Informada"
},
"noGroups": {
"title": "No tenés grupos activos",
"description": "Si creés que es un error, hablá con tu profe."
},
"picker": {
"label": "Alumno: {{name}}. Cambiar",
"listLabel": "Elegí el alumno"
},
"home": {
"greeting": "Hola, {{name}}",
"nextClass": "Próxima clase · {{when}}",
"notified": "Avisaste que no vas",
"notGoing": "No voy a ir",
"thisWeek": "Esta semana",
"noWeekClasses": "No tenés clases esta semana.",
"notifiedTag": "Avisaste",
"past": "Pasó",
"notices": "Avisos del profe",
"noticesEmpty": "Cuando {{teacher}} publique un aviso, lo vas a ver acá."
},
"fee": {
"yourFee": "Tu cuota",
"unpaid": "{{count}} cuotas sin pagar",
"overdue": "Hay vencidas",
"payMp": "Pagar con Mercado Pago",
"report": "Informar pago",
"awaiting": "Tu profe tiene que confirmar el pago que informaste."
},
"review": {
"confirmed": "Tu profe confirmó tu pago de {{amount}}.",
"rejected": "Tu profe no pudo confirmar tu pago de {{amount}}.",
"reason": " Motivo: {{reason}}.",
"retry": " Podés volver a informarlo."
},
"classes": {
"title": "Clases",
"notify": "Avisar que no voy",
"empty": "No hay clases programadas en las próximas semanas.",
"notified": "Avisaste",
"undo": "Deshacer",
"undoLabel": "Deshacer el aviso del {{date}}",
"undone": "Listo, quedaste anotado/a otra vez.",
"undoError": "No pudimos deshacer el aviso. Si la clase ya empezó, ya no se puede."
},
"payments": {
"title": "Pagos",
"unpaid": "Cuotas sin pagar",
"upToDate": "Estás al día. 🎉",
"due": "Vence {{date}}",
"payMp": "Pagar con Mercado Pago",
"report": "Informar pago",
"reported": "Pagos informados",
"reportedOn": "Informado el {{date}}",
"yourNote": "Tu nota: {{note}}",
"reason": "Motivo: {{reason}}",
"status": {
"reported": "Informado",
"confirmed": "Confirmado",
"rejected": "Rechazado"
}
},
"notify": {
"done": "Listo, le avisamos a {{teacher}}",
"doneHint": "Si cambiás de idea, podés deshacerlo desde Clases mientras la clase no haya empezado.",
"seeClasses": "Ver mis clases",
"title": "Avisar que no voy",
"which": "¿A qué clases no vas?",
"none": "No hay clases para avisar.",
"reason": "Motivo",
"optional": "(opcional)",
"message": "Mensaje para {{teacher}} (opcional)",
"hint": "Si avisás antes de la clase, la falta queda como justificada.",
"error": "No pudimos mandar el aviso. Si alguna clase ya empezó, sacala y probá de nuevo.",
"pick": "Elegí al menos una clase",
"submit_one": "Avisar {{count}} clase",
"submit_other": "Avisar {{count}} clases"
},
"report": {
"done": "Pago informado",
"doneHint": "{{teacher}} va a revisar el comprobante. Te avisamos acá cuando lo confirme.",
"title": "Informar pago",
"which": "¿Qué cuotas pagaste?",
"none": "No tenés cuotas para informar.",
"receipt": "Comprobante",
"note": "Nota para {{teacher}} (opcional)",
"notePlaceholder": "Ej.: pagué desde la cuenta de mi mamá",
"hint": "{{teacher}} va a confirmar el pago. Mientras tanto figura como Informado.",
"alreadyReported": "Ya informaste alguna de estas cuotas.",
"checkReceipt": "Revisá el comprobante.",
"error": "No pudimos enviar el pago. Probá de nuevo.",
"pickFee": "Elegí al menos una cuota",
"attach": "Adjuntá el comprobante",
"submit": "Enviar · {{amount}}",
"due": "Vence {{date}}"
},
"receipt": {
"tooBig": "El archivo pesa más de {{max}} MB.",
"badType": "Tiene que ser una captura (JPG, PNG, WEBP, HEIC) o un PDF.",
"remove": "Quitar comprobante",
"attach": "Adjuntar captura o PDF",
"max": "Hasta {{max}} MB"
},
"transfer": {
"title": "Datos para transferir",
"alias": "Alias",
"copied": "Copiado",
"copy": "Copiar",
"holder": "Titular: <strong>{{holder}}</strong>"
},
"profile": {
"title": "Perfil",
"logout": "Cerrar sesión en este teléfono"
},
"passkey": {
"active": "Face ID activado",
"title": "Entrar con Face ID o huella",
"activeHint": "Si se cierra tu sesión, entrás con tu cara o tu huella, sin pedirle un link a tu profe.",
"hint": "Si se cierra tu sesión o cambiás de navegador, vas a poder volver a entrar sin pedirle un link a tu profe.",
"error": "No pudimos activarlo en este teléfono.",
"remove": "Quitar Face ID o huella",
"activate": "Activar"
},
"recovery": {
"title": "Mail de recuperación",
"optional": "(opcional)",
"confirmed": "Confirmado: <strong>{{email}}</strong>",
"pending": "Te mandamos un link a <strong>{{email}}</strong> para confirmarlo.",
"hint": "Para pedir un link de ingreso si perdés el acceso.",
"label": "Tu mail",
"error": "No pudimos guardar el mail. Probá de nuevo en un rato.",
"change": "Cambiar",
"remove": "Quitar"
},
"welcome": {
"title": "¡Listo, ya estás adentro!",
"description": "Vas a quedar conectado/a en este teléfono. Si querés, sumá una de estas opciones para no perder el acceso.",
"emailHint": "Te mandamos un link para confirmarlo.",
"emailError": "Revisá el mail o seguí sin cargarlo.",
"later": "Ahora no",
"continue": "Continuar"
}
}

View File

@@ -0,0 +1,169 @@
{
"nav": {
"label": "Seções",
"home": "Início",
"classes": "Aulas",
"payments": "Pagamentos",
"profile": "Perfil"
},
"loading": "Carregando",
"loadingClasses": "Carregando aulas",
"loadingPayments": "Carregando pagamentos",
"back": "Voltar",
"backHome": "Voltar ao início",
"today": "hoje",
"tomorrow": "amanhã",
"yesterday": "ontem",
"reason": {
"health": "Saúde",
"travel": "Viagem",
"work_study": "Trabalho ou estudo",
"other": "Outro"
},
"feeStatus": {
"pending": "Pendente",
"overdue": "Vencida",
"reported": "Informada"
},
"noGroups": {
"title": "Você não tem grupos ativos",
"description": "Se acha que é um erro, fale com seu professor."
},
"picker": {
"label": "Aluno: {{name}}. Trocar",
"listLabel": "Escolha o aluno"
},
"home": {
"greeting": "Olá, {{name}}",
"nextClass": "Próxima aula · {{when}}",
"notified": "Você avisou que não vai",
"notGoing": "Não vou",
"thisWeek": "Esta semana",
"noWeekClasses": "Você não tem aulas esta semana.",
"notifiedTag": "Avisou",
"past": "Já passou",
"notices": "Avisos do professor",
"noticesEmpty": "Quando {{teacher}} publicar um aviso, você vai ver aqui."
},
"fee": {
"yourFee": "Sua mensalidade",
"unpaid": "{{count}} mensalidades em aberto",
"overdue": "Há vencidas",
"payMp": "Pagar com Mercado Pago",
"report": "Informar pagamento",
"awaiting": "Seu professor precisa confirmar o pagamento que você informou."
},
"review": {
"confirmed": "Seu professor confirmou seu pagamento de {{amount}}.",
"rejected": "Seu professor não conseguiu confirmar seu pagamento de {{amount}}.",
"reason": " Motivo: {{reason}}.",
"retry": " Você pode informar de novo."
},
"classes": {
"title": "Aulas",
"notify": "Avisar que não vou",
"empty": "Não há aulas marcadas para as próximas semanas.",
"notified": "Avisou",
"undo": "Desfazer",
"undoLabel": "Desfazer o aviso de {{date}}",
"undone": "Pronto, você está inscrito de novo.",
"undoError": "Não conseguimos desfazer o aviso. Se a aula já começou, não é mais possível."
},
"payments": {
"title": "Pagamentos",
"unpaid": "Mensalidades em aberto",
"upToDate": "Você está em dia. 🎉",
"due": "Vence {{date}}",
"payMp": "Pagar com Mercado Pago",
"report": "Informar pagamento",
"reported": "Pagamentos informados",
"reportedOn": "Informado em {{date}}",
"yourNote": "Sua observação: {{note}}",
"reason": "Motivo: {{reason}}",
"status": {
"reported": "Informado",
"confirmed": "Confirmado",
"rejected": "Recusado"
}
},
"notify": {
"done": "Pronto, avisamos {{teacher}}",
"doneHint": "Se mudar de ideia, você pode desfazer em Aulas enquanto a aula não tiver começado.",
"seeClasses": "Ver minhas aulas",
"title": "Avisar que não vou",
"which": "Em quais aulas você não vai?",
"none": "Não há aulas para avisar.",
"reason": "Motivo",
"optional": "(opcional)",
"message": "Mensagem para {{teacher}} (opcional)",
"hint": "Se você avisar antes da aula, a falta fica justificada.",
"error": "Não conseguimos enviar o aviso. Se alguma aula já começou, tire-a e tente novamente.",
"pick": "Escolha pelo menos uma aula",
"submit_one": "Avisar {{count}} aula",
"submit_other": "Avisar {{count}} aulas"
},
"report": {
"done": "Pagamento informado",
"doneHint": "{{teacher}} vai revisar o comprovante. Avisamos aqui quando confirmar.",
"title": "Informar pagamento",
"which": "Quais mensalidades você pagou?",
"none": "Você não tem mensalidades para informar.",
"receipt": "Comprovante",
"note": "Observação para {{teacher}} (opcional)",
"notePlaceholder": "Ex.: paguei pela conta da minha mãe",
"hint": "{{teacher}} vai confirmar o pagamento. Enquanto isso, aparece como Informado.",
"alreadyReported": "Você já informou alguma dessas mensalidades.",
"checkReceipt": "Confira o comprovante.",
"error": "Não conseguimos enviar o pagamento. Tente novamente.",
"pickFee": "Escolha pelo menos uma mensalidade",
"attach": "Anexe o comprovante",
"submit": "Enviar · {{amount}}",
"due": "Vence {{date}}"
},
"receipt": {
"tooBig": "O arquivo tem mais de {{max}} MB.",
"badType": "Precisa ser uma captura de tela (JPG, PNG, WEBP, HEIC) ou um PDF.",
"remove": "Remover comprovante",
"attach": "Anexar captura ou PDF",
"max": "Até {{max}} MB"
},
"transfer": {
"title": "Dados para transferência",
"alias": "Chave",
"copied": "Copiado",
"copy": "Copiar",
"holder": "Titular: <strong>{{holder}}</strong>"
},
"profile": {
"title": "Perfil",
"logout": "Sair neste celular"
},
"passkey": {
"active": "Face ID ativado",
"title": "Entrar com Face ID ou digital",
"activeHint": "Se sua sessão for encerrada, você entra com o rosto ou a digital, sem pedir um link ao professor.",
"hint": "Se sua sessão for encerrada ou você trocar de navegador, vai poder entrar de novo sem pedir um link ao professor.",
"error": "Não conseguimos ativar neste celular.",
"remove": "Remover Face ID ou digital",
"activate": "Ativar"
},
"recovery": {
"title": "E-mail de recuperação",
"optional": "(opcional)",
"confirmed": "Confirmado: <strong>{{email}}</strong>",
"pending": "Enviamos um link para <strong>{{email}}</strong> para confirmar.",
"hint": "Para pedir um link de acesso se você perder o acesso.",
"label": "Seu e-mail",
"error": "Não conseguimos salvar o e-mail. Tente novamente daqui a pouco.",
"change": "Trocar",
"remove": "Remover"
},
"welcome": {
"title": "Pronto, você entrou!",
"description": "Você vai ficar conectado neste celular. Se quiser, adicione uma destas opções para não perder o acesso.",
"emailHint": "Enviamos um link para confirmar.",
"emailError": "Confira o e-mail ou continue sem cadastrá-lo.",
"later": "Agora não",
"continue": "Continuar"
}
}