From b615c17a16c32ced719597b4b923409c39374952 Mon Sep 17 00:00:00 2001 From: Jose Selesan Date: Tue, 3 Nov 2026 14:02:02 -0300 Subject: [PATCH] =?UTF-8?q?feat(i18n):=20traducir=20inscripci=C3=B3n=20por?= =?UTF-8?q?=20link=20y=20aviso=20de=20ausencia=20p=C3=BAblico?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- .../absence-notify/AbsenceNotifyProvider.tsx | 8 +-- .../absence-notify/AbsenceNotifyView.tsx | 24 +++++---- .../absence-notify/AbsenceSessionRow.tsx | 16 +++--- .../src/features/join/GroupInviteSummary.tsx | 16 ++++-- .../src/features/join/InvalidInviteCard.tsx | 8 +-- apps/web/src/features/join/JoinForm.tsx | 26 +++++----- .../src/features/join/JoinGroupProvider.tsx | 28 +++++------ apps/web/src/features/join/JoinGroupView.tsx | 4 +- .../join/PreRegistrationNoticeCard.tsx | 15 ++++-- apps/web/src/i18n/i18next.d.ts | 2 + apps/web/src/i18n/locales/en/public.json | 49 +++++++++++++++++++ apps/web/src/i18n/locales/es-419/public.json | 49 +++++++++++++++++++ apps/web/src/i18n/locales/es-AR/public.json | 49 +++++++++++++++++++ apps/web/src/i18n/locales/pt-BR/public.json | 49 +++++++++++++++++++ 14 files changed, 281 insertions(+), 62 deletions(-) create mode 100644 apps/web/src/i18n/locales/en/public.json create mode 100644 apps/web/src/i18n/locales/es-419/public.json create mode 100644 apps/web/src/i18n/locales/es-AR/public.json create mode 100644 apps/web/src/i18n/locales/pt-BR/public.json diff --git a/apps/web/src/features/absence-notify/AbsenceNotifyProvider.tsx b/apps/web/src/features/absence-notify/AbsenceNotifyProvider.tsx index 51e68d1..bac45d5 100644 --- a/apps/web/src/features/absence-notify/AbsenceNotifyProvider.tsx +++ b/apps/web/src/features/absence-notify/AbsenceNotifyProvider.tsx @@ -4,6 +4,8 @@ import { useMutation, useQuery } from '@tanstack/react-query' import type { AbsenceDetails } from '@gruperly/shared' import { useToast } from '../../components/ui' import { ApiError, getAbsenceDetails, publicNotifyAbsence } from '../../lib/api' +import { errorMessage } from '../../i18n' +import { i18n } from '../../i18n/instance' type AbsenceNotifyContextValue = { token: string @@ -32,14 +34,14 @@ export function AbsenceNotifyProvider({ token, children }: { token: string; chil mutationFn: (sessionId: string) => publicNotifyAbsence({ token, classSessionId: sessionId }), onSuccess: (_data, sessionId) => { setLocallyNotified((prev) => [...prev, sessionId]) - toast.success('Tu profesor ya tiene registrado el aviso. Gracias por avisar.', 'Ausencia avisada') + toast.success(i18n.t('public:absence.done'), i18n.t('public:absence.doneTitle')) }, onError: (error: unknown) => { if (error instanceof ApiError && error.problem?.status === 404) { - toast.error('Este enlace ya no es válido. Consultá a tu profesor.') + toast.error(i18n.t('public:absence.invalidLink')) return } - toast.error(error instanceof Error ? error.message : 'No pudimos registrar el aviso.') + toast.error(errorMessage(error, i18n.t('public:absence.error'))) }, }) diff --git a/apps/web/src/features/absence-notify/AbsenceNotifyView.tsx b/apps/web/src/features/absence-notify/AbsenceNotifyView.tsx index 44adcde..6902e28 100644 --- a/apps/web/src/features/absence-notify/AbsenceNotifyView.tsx +++ b/apps/web/src/features/absence-notify/AbsenceNotifyView.tsx @@ -3,9 +3,11 @@ import { PublicFooter, PublicHeader } from '../../components/layout' import { Badge } from '../../components/ui' import { AbsenceSessionRow } from './AbsenceSessionRow' import { useAbsenceNotify } from './AbsenceNotifyProvider' +import { Trans, useTranslation } from 'react-i18next' export function AbsenceNotifyView() { const { details, detailsPending, detailsFailed } = useAbsenceNotify() + const { t } = useTranslation('public') return (
@@ -16,15 +18,15 @@ export function AbsenceNotifyView() { {detailsPending ? (
-

Cargando tus clases...

+

{t('absence.loading')}

) : null} {detailsFailed || (!details && !detailsPending) ? (
-

Enlace no válido

+

{t('absence.invalidTitle')}

- No pudimos identificarte con este enlace. Consultá con tu profesor para solicitar uno nuevo. + {t('absence.invalidDescription')}

) : null} @@ -36,18 +38,22 @@ export function AbsenceNotifyView() {
- Aviso de ausencia + {t('absence.badge')} -

Hola, {details.fullName}

+

{t('absence.greeting', { name: details.fullName })}

- Grupo: {details.groupName} + }} + />

{details.sessions.length === 0 ? (

- No tenés clases programadas para hoy. Si necesitás avisar de todas formas, contactá a tu - profesor. + {t('absence.noClasses')}

) : (