diff --git a/apps/web/src/features/attendee-detail/AbsenceLinkSection.tsx b/apps/web/src/features/attendee-detail/AbsenceLinkSection.tsx
index daef66f..4b9c803 100644
--- a/apps/web/src/features/attendee-detail/AbsenceLinkSection.tsx
+++ b/apps/web/src/features/attendee-detail/AbsenceLinkSection.tsx
@@ -5,10 +5,12 @@ import { useAttendeeDetail } from './AttendeeDetailProvider'
import { ACTION_BUTTON_CLASS, PRIMARY_ACTION_CLASS } from './actionButton'
import { Section } from './Section'
import { useCopyToClipboard } from './useCopyToClipboard'
+import { useTranslation } from 'react-i18next'
export function AbsenceLinkSection() {
const { attendee } = useAttendeeDetail()
const { copied, copy } = useCopyToClipboard()
+ const { t } = useTranslation(['attendeeDetail', 'common'])
const [isOpen, setIsOpen] = useState(false)
const panelId = useId()
@@ -19,14 +21,14 @@ export function AbsenceLinkSection() {
const phoneDigits = attendee.phone?.replace(/\D/g, '') ?? ''
const shareUrl = phoneDigits
? `https://wa.me/${phoneDigits}?text=${encodeURIComponent(
- `Hola ${attendee.fullName.split(' ')[0]}, desde este link podés avisar tus ausencias en ${url}`,
+ t('absenceLink.message', { name: attendee.fullName.split(' ')[0], url }),
)}`
: null
return (
- No pudimos cargar la asistencia de este miembro. + {t('attendance.loadError')}
- Todavía no hay clases registradas. + {t('attendance.empty')}
- El historial guarda las últimas {HISTORY_LIMIT} clases. + {t('attendance.capped', { count: HISTORY_LIMIT })}
) : null} @@ -110,7 +112,7 @@ export function AttendeeAttendanceSection() { aria-expanded={showAll} className="h-11 gap-1 px-3 text-sm text-accent-fg hover:text-primary" > - {showAll ? 'Ver menos' : `Ver todas (${sessions.length})`} + {showAll ? t('attendance.showLess') : t('attendance.showAll', { count: sessions.length })}- Agregá un teléfono para usar estas acciones + {t('actions.missingPhone')}
) : null} diff --git a/apps/web/src/features/attendee-detail/AttendeeContactForm.tsx b/apps/web/src/features/attendee-detail/AttendeeContactForm.tsx index 0f06617..30ae24a 100644 --- a/apps/web/src/features/attendee-detail/AttendeeContactForm.tsx +++ b/apps/web/src/features/attendee-detail/AttendeeContactForm.tsx @@ -1,6 +1,8 @@ import type { ReactNode } from 'react' import { Loader2, Mail, Phone } from 'lucide-react' import { Button, Input } from '../../components/ui' +import { validationMessage } from '../../i18n' +import { useTranslation } from 'react-i18next' type AttendeeContactFormProps = { phone: string @@ -26,26 +28,27 @@ export function AttendeeContactForm({ onCancel, onSave, }: AttendeeContactFormProps) { + const { t } = useTranslation(['attendeeDetail', 'common']) return (- No se pudo cargar la información de este miembro. + {t('notFound.description')}
- {attendee.notes || 'Sin notas todavía.'} + {attendee.notes || t('notes.empty')}
{formatNotesUpdatedAt(attendee.updatedAt)}
@@ -31,7 +33,7 @@ export function AttendeePaymentsSection() { onClick={registerPayment} className="min-h-11 shrink-0 rounded-lg px-2 text-sm font-medium text-accent-fg transition-colors hover:bg-primary-soft hover:text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent" > - Registrar pago + {t('payments.register')}
{groups.length > 1 - ? 'Ya es miembro de todos tus otros grupos.' - : `No tenés otros grupos. Creá uno para poder ${isAdd ? 'agregar' : 'mover'} a este miembro.`} + ? t('changeGroup.allGroups') + : isAdd + ? t('changeGroup.noGroupsAdd') + : t('changeGroup.noGroupsMove')}
) : (- Si tiene cobros registrados no se va a poder quitar: primero hay que gestionarlos. + {t('remove.paymentsNote')}
{canPromote && firstWaitlistEntry ? (
- Si lo quitás, podés darle el lugar a{' '}
- {firstWaitlistEntry.fullName}, el primero
- de la lista de espera.
+
- El link es personal, sirve una sola vez y vence en 72 horas. Queda conectado el primer teléfono que lo abra. + {t('inviteSheet.security')}
{mutation.isError ? (- No pudimos generar el link. Probá de nuevo. + {t('inviteSheet.error')}
) : null} @@ -122,7 +124,7 @@ export function InviteToAppSheet({ {hasPhone ? ( ) : null}{device.device}
- Desde el {formatSince(device.createdAt)} · último uso {formatAgo(device.lastUsedAt)} - {access.hasPasskey ? ' · Face ID' : ''} + {t('access.device', { since: formatSince(device.createdAt), ago: formatAgo(device.lastUsedAt) })} + {access.hasPasskey ? t('access.faceId') : ''}
Para que avise faltas e informe pagos desde su teléfono.
+{t('access.pitch')}
) : null} {invited ? (- ¿Te dice que no puede entrar? Mandale un link nuevo: cierra el acceso anterior. + {t('access.reinviteHint')}
) : null} @@ -62,7 +64,7 @@ export function StudentAccessSection() { className={invited ? `${ACTION_BUTTON_CLASS} w-full` : PRIMARY_ACTION_CLASS} > {invited ? : } - {invited ? (hasPhone ? 'Reinvitar por WhatsApp' : 'Reinvitar') : 'Invitar a la app'} + {invited ? (hasPhone ? t('access.reinviteWhatsapp') : t('access.reinvite')) : t('access.invite')} ) : null} @@ -71,7 +73,7 @@ export function StudentAccessSection() { isOpen={sheetOpen} onClose={() => setSheetOpen(false)} groupId={groupId} - groupName={groupName ?? 'tu grupo'} + groupName={groupName ?? t('access.yourGroup')} attendeeId={attendee.id} fullName={attendee.fullName} hasPhone={hasPhone} diff --git a/apps/web/src/features/attendee-detail/attendance.ts b/apps/web/src/features/attendee-detail/attendance.ts index 271851a..f875de3 100644 --- a/apps/web/src/features/attendee-detail/attendance.ts +++ b/apps/web/src/features/attendee-detail/attendance.ts @@ -1,4 +1,5 @@ import type { AttendanceHistoryItem } from '@gruperly/shared' +import { i18n } from '../../i18n/instance' /* The history endpoint cuts off at 20 sessions (HISTORY_SESSIONS_LIMIT on the backend). It is the real ceiling on what this screen can show, so "Ver todas" @@ -10,22 +11,20 @@ export type AttendanceSession = AttendanceHistoryItem export function formatSessionShortDate(iso: string): string { const date = new Date(iso) - const weekday = date.toLocaleDateString('es-MX', { weekday: 'short' }) - const day = date.toLocaleDateString('es-MX', { day: 'numeric' }) - const month = date.toLocaleDateString('es-MX', { month: 'short' }) + const weekday = date.toLocaleDateString(i18n.language, { weekday: 'short' }) + const day = date.toLocaleDateString(i18n.language, { day: 'numeric' }) + const month = date.toLocaleDateString(i18n.language, { month: 'short' }) return `${weekday} ${day} ${month}` } export function attendanceStatusLabel(status: AttendanceSession['status']): string { switch (status) { case 'PRESENT': - return 'Asistió' case 'ABSENT': - return 'Faltó' case 'EXCUSED': - return 'Faltó (avisó)' + return i18n.t(`attendeeDetail:attendance.${status}`) default: - return 'Sin registrar' + return i18n.t('attendeeDetail:attendance.NONE') } } @@ -47,7 +46,7 @@ export function attendanceStatusClass(status: AttendanceSession['status']): stri /** "28 sep 2026". It is the usual short date: it fits on one line on mobile. */ export function formatMemberSince(iso: string): string { - return new Date(iso).toLocaleDateString('es-MX', { + return new Date(iso).toLocaleDateString(i18n.language, { day: 'numeric', month: 'short', year: 'numeric', @@ -56,7 +55,7 @@ export function formatMemberSince(iso: string): string { /** "1 clase" / "2 clases". */ export function classCountLabel(count: number): string { - return count === 1 ? '1 clase' : `${count} clases` + return i18n.t('attendeeDetail:attendance.classes', { count }) } /** What is displayed: from the most recent to the oldest, with the last @@ -78,8 +77,8 @@ export type AttendanceSummary = { /** Summary of the rows being shown. The denominator deliberately includes * unmarked sessions so the counter always matches the visible list. */ export function attendanceSummary(sessions: AttendanceSession[]): AttendanceSummary { - if (sessions.length === 0) return { label: 'Sin clases registradas' } + if (sessions.length === 0) return { label: i18n.t('attendeeDetail:attendance.noClasses') } const present = sessions.filter((session) => session.status === 'PRESENT').length - return { label: `${present} de ${classCountLabel(sessions.length)}` } + return { label: i18n.t('attendeeDetail:attendance.summary', { present, classes: classCountLabel(sessions.length) }) } } diff --git a/apps/web/src/features/attendee-detail/detail.ts b/apps/web/src/features/attendee-detail/detail.ts index 23d7a51..b93dd42 100644 --- a/apps/web/src/features/attendee-detail/detail.ts +++ b/apps/web/src/features/attendee-detail/detail.ts @@ -1,6 +1,7 @@ import type { AttendeePaymentSummary } from '@gruperly/shared' import { UpdateAttendeeSchema } from '@gruperly/shared' import { validationMessage } from '../../i18n/validation' +import { i18n } from '../../i18n/instance' export function contactEmailError(email: string): string | null { const result = UpdateAttendeeSchema.safeParse({ email }) @@ -21,47 +22,50 @@ export function paymentPresentation( ): PaymentPresentation { const periodLabel = capitalize(formatMonthAndYear(today)) if (!payment) { - return { periodLabel, statusLabel: 'Sin cobro registrado', chipLabel: 'Al día', isDue: false } + return { + periodLabel, + statusLabel: i18n.t('attendeeDetail:payments.noCharge'), + chipLabel: i18n.t('attendeeDetail:payments.upToDate'), + isDue: false, + } } const isDue = payment.status === 'PENDING' || payment.status === 'OVERDUE' return { periodLabel, statusLabel: paymentStatusLabel(payment.status), - chipLabel: isDue ? `Debe ${formatMonth(new Date(payment.dueDate))}` : 'Al día', + chipLabel: isDue + ? i18n.t('attendeeDetail:payments.owes', { month: formatMonth(new Date(payment.dueDate)) }) + : i18n.t('attendeeDetail:payments.upToDate'), isDue, } } export function formatNotesUpdatedAt(updatedAt: string, today = new Date()): string { const date = new Date(updatedAt) - if (sameCalendarDate(date, today)) return 'Editado hoy' - return `Editado ${date.toLocaleDateString('es-MX', { - day: 'numeric', - month: 'short', - year: 'numeric', - })}` + if (sameCalendarDate(date, today)) return i18n.t('attendeeDetail:notes.editedToday') + return i18n.t('attendeeDetail:notes.edited', { + date: date.toLocaleDateString(i18n.language, { day: 'numeric', month: 'short', year: 'numeric' }), + }) } function paymentStatusLabel(status: AttendeePaymentSummary['status']): string { switch (status) { case 'PAID': - return 'Pagado' case 'OVERDUE': - return 'Vencido' case 'CANCELLED': - return 'Cancelado' + return i18n.t(`common:paymentStatus.${status}`) default: - return 'Pendiente' + return i18n.t('common:paymentStatus.PENDING') } } function formatMonth(date: Date): string { - return date.toLocaleDateString('es-MX', { month: 'long' }) + return date.toLocaleDateString(i18n.language, { month: 'long' }) } function formatMonthAndYear(date: Date): string { - const parts = new Intl.DateTimeFormat('es-MX', { month: 'long', year: 'numeric' }).formatToParts(date) + const parts = new Intl.DateTimeFormat(i18n.language, { month: 'long', year: 'numeric' }).formatToParts(date) const month = parts.find((part) => part.type === 'month')?.value ?? '' const year = parts.find((part) => part.type === 'year')?.value ?? '' return `${month} ${year}`.trim() diff --git a/apps/web/src/features/attendee-detail/studentAccess.ts b/apps/web/src/features/attendee-detail/studentAccess.ts index 1508991..24e7bf6 100644 --- a/apps/web/src/features/attendee-detail/studentAccess.ts +++ b/apps/web/src/features/attendee-detail/studentAccess.ts @@ -1,5 +1,6 @@ import type { StudentAccessDto } from '@gruperly/shared' import type { BadgeVariant } from '../../components/ui' +import { i18n } from '../../i18n/instance' const HOUR_MS = 3_600_000 const DAY_MS = 24 * HOUR_MS @@ -7,33 +8,36 @@ const DAY_MS = 24 * HOUR_MS export function accessBadge(access: StudentAccessDto, now: Date = new Date()): { label: string; variant: BadgeVariant } { switch (access.status) { case 'active': - return { label: 'Activo', variant: 'success' } + return { label: i18n.t('attendeeDetail:access.active'), variant: 'success' } case 'invited': { const hours = access.invitationExpiresAt ? Math.max(1, Math.ceil((Date.parse(access.invitationExpiresAt) - now.getTime()) / HOUR_MS)) : null - return { label: hours ? `Invitado · vence en ${hours} h` : 'Invitado', variant: 'info' } + return { + label: hours ? i18n.t('attendeeDetail:access.invitedExpires', { hours }) : i18n.t('attendeeDetail:access.invited'), + variant: 'info', + } } case 'expired': - return { label: 'Vencido', variant: 'warning' } + return { label: i18n.t('attendeeDetail:access.expired'), variant: 'warning' } default: - return { label: 'Sin invitar', variant: 'neutral' } + return { label: i18n.t('attendeeDetail:access.notInvited'), variant: 'neutral' } } } /** "hace 5 min", "hace 3 h", "ayer", "hace 4 días". */ export function formatAgo(iso: string, now: Date = new Date()): string { const diff = Math.max(0, now.getTime() - Date.parse(iso)) - if (diff < HOUR_MS) return `hace ${Math.max(1, Math.round(diff / 60_000))} min` - if (diff < DAY_MS) return `hace ${Math.round(diff / HOUR_MS)} h` + if (diff < HOUR_MS) return i18n.t('attendeeDetail:access.agoMinutes', { count: Math.max(1, Math.round(diff / 60_000)) }) + if (diff < DAY_MS) return i18n.t('attendeeDetail:access.agoHours', { count: Math.round(diff / HOUR_MS) }) const days = Math.round(diff / DAY_MS) - return days === 1 ? 'ayer' : `hace ${days} días` + return days === 1 ? i18n.t('attendeeDetail:access.yesterday') : i18n.t('attendeeDetail:access.agoDays', { count: days }) } export function formatSince(iso: string): string { - return new Date(iso).toLocaleDateString('es-AR', { day: 'numeric', month: 'long' }) + return new Date(iso).toLocaleDateString(i18n.language, { day: 'numeric', month: 'long' }) } export function invitationMessage(firstName: string, groupName: string, url: string): string { - return `¡Hola ${firstName}! Te invito a gruperly para avisar faltas e informar pagos de ${groupName}. ${url}` + return i18n.t('attendeeDetail:inviteSheet.message', { name: firstName, group: groupName, url }) } diff --git a/apps/web/src/i18n/i18next.d.ts b/apps/web/src/i18n/i18next.d.ts index 3077148..a93fa4c 100644 --- a/apps/web/src/i18n/i18next.d.ts +++ b/apps/web/src/i18n/i18next.d.ts @@ -11,6 +11,7 @@ import type groupDetail from './locales/es-AR/groupDetail.json' import type groupAdd from './locales/es-AR/groupAdd.json' import type analytics from './locales/es-AR/analytics.json' import type attention from './locales/es-AR/attention.json' +import type attendeeDetail from './locales/es-AR/attendeeDetail.json' import type validation from './locales/es-AR/validation.json' // es-AR es la fuente: una clave que no exista ahí rompe el typecheck. @@ -25,6 +26,7 @@ declare module 'i18next' { pwa: typeof pwa settings: typeof settings validation: typeof validation + 'attendeeDetail': typeof attendeeDetail 'attention': typeof attention 'analytics': typeof analytics 'groupAdd': typeof groupAdd diff --git a/apps/web/src/i18n/locales/en/attendeeDetail.json b/apps/web/src/i18n/locales/en/attendeeDetail.json new file mode 100644 index 0000000..e03a588 --- /dev/null +++ b/apps/web/src/i18n/locales/en/attendeeDetail.json @@ -0,0 +1,162 @@ +{ + "fallbackName": "Member", + "backToGroup": "Back to group", + "since": "Since {{date}}", + "notFound": { + "title": "Member not found", + "description": "We couldn't load this member's information." + }, + "actions": { + "whatsappLabel": "Open WhatsApp with {{name}}", + "callLabel": "Call {{name}}", + "call": "Call", + "missingPhone": "Add a phone number to use these actions", + "theMember": "the member" + }, + "phone": { + "copied": "Number copied", + "copiedLive": "Number copied to clipboard" + }, + "contact": { + "title": "Contact", + "edit": "Edit", + "phone": "Phone", + "email": "Email", + "addPhone": "Add phone", + "addEmail": "Add email", + "shared": "The change applies to all their groups.", + "phoneTaken": "That phone already belongs to someone else you've registered.", + "saveError": "We couldn't save the changes. Check your connection and try again." + }, + "otherGroups": { + "title": "Also in", + "PAUSED": "Paused", + "DROPPED": "Removed" + }, + "access": { + "title": "App access", + "active": "Active", + "invited": "Invited", + "invitedExpires": "Invited · expires in {{hours}} h", + "expired": "Expired", + "notInvited": "Not invited", + "device": "Since {{since}} · last used {{ago}}", + "faceId": " · Face ID", + "pitch": "So they can report absences and payments from their phone.", + "reinviteHint": "Can't get in? Send them a new link: it closes the previous access.", + "reinviteWhatsapp": "Re-invite on WhatsApp", + "reinvite": "Re-invite", + "invite": "Invite to the app", + "yourGroup": "your group", + "agoMinutes": "{{count}} min ago", + "agoHours": "{{count}} h ago", + "yesterday": "yesterday", + "agoDays": "{{count}} days ago" + }, + "inviteSheet": { + "titleReinvite": "Re-invite to the app", + "title": "Invite to the app", + "descriptionReinvite": "Send {{name}} a new link. The previous access stops working.", + "description": "{{name}} will be able to report absences, report payments and see their upcoming classes. No passwords or new details.", + "preview": "Message preview", + "linkPlaceholder": "🔗 personal link", + "security": "The link is personal, works only once and expires in 72 hours. The first phone that opens it stays connected.", + "error": "We couldn't create the link. Please try again.", + "sendWhatsapp": "Send on WhatsApp", + "copied": "Link copied", + "copy": "Copy link", + "message": "Hi {{name}}! I'm inviting you to gruperly to report absences and payments for {{group}}. {{url}}" + }, + "payments": { + "title": "Payments", + "register": "Record payment", + "registerPending": "Recording payments will be available once the payment flow is defined.", + "noCharge": "No charge on record", + "upToDate": "Up to date", + "owes": "Owes {{month}}" + }, + "attendance": { + "title": "Attendance", + "loadError": "We couldn't load this member's attendance.", + "empty": "No classes recorded yet.", + "capped": "The history keeps the last {{count}} classes.", + "showLess": "Show less", + "showAll": "Show all ({{count}})", + "noClasses": "No classes recorded", + "summary": "{{present}} of {{classes}}", + "classes_one": "{{count}} class", + "classes_other": "{{count}} classes", + "PRESENT": "Attended", + "ABSENT": "Absent", + "EXCUSED": "Absent (gave notice)", + "NONE": "Not recorded" + }, + "notes": { + "title": "Notes", + "edit": "Edit", + "empty": "No notes yet.", + "label": "Member notes", + "saveError": "We couldn't save the note. Check your connection and try again.", + "editedToday": "Edited today", + "edited": "Edited {{date}}" + }, + "absenceLink": { + "title": "Absence link", + "description": "So they can tell you when they can't come", + "copy": "Copy link", + "sendLabel": "Send the link to {{name}} on WhatsApp", + "send": "Send on WhatsApp", + "copied": "Link copied", + "message": "Hi {{name}}, you can report your absences using this link: {{url}}" + }, + "menu": { + "more": "More actions", + "label": "Member actions", + "changeGroup": "Change group", + "addToGroup": "Add to another group", + "editContact": "Edit contact", + "pause": "Pause membership", + "pausePending": "Pausing memberships will be available once the business rules are confirmed.", + "remove": "Remove from group" + }, + "remove": { + "title": "Remove from group", + "history": "Their history is deleted: recorded classes and absence notices no longer exist.", + "link": "The absence link stops working.", + "spotWaiting_one": "1 spot opens up. {{count}} person is on the waitlist.", + "spotWaiting_other": "1 spot opens up. {{count}} people are on the waitlist.", + "spot": "1 spot opens up in the group.", + "paymentsNote": "If they have payments on record they can't be removed: manage those first.", + "promote": "If you remove them, you can give the spot to {{name}}, first on the waitlist.", + "promoteAction": "Move {{name}} into the group", + "confirm": "Remove from group" + }, + "changeGroup": { + "titleAdd": "Add to another group", + "title": "Change group", + "loadingGroups": "Loading groups", + "allGroups": "They're already a member of all your other groups.", + "noGroupsAdd": "You don't have other groups. Create one to add this member.", + "noGroupsMove": "You don't have other groups. Create one to move this member.", + "addTo": "Add to", + "moveTo": "Move to", + "pick": "Choose a group", + "full": "{{name}} (full)", + "currentGroup": "the current group", + "addStays": "Stays in {{group}}: they'll be in both groups.", + "addShares": "Shares contact details, notes and access to the student app.", + "addSeparate": "Attendance and fees are tracked separately in each group.", + "moveKeeps": "Keeps their history, fees and access to the student app.", + "moveFees": "Pending fees from {{group}} still apply.", + "moveNotices": "Absence notices for upcoming {{group}} classes are cancelled.", + "add": "Add", + "move": "Change group", + "moved": "{{name}} moved to {{group}}.", + "added": "{{name}} is now also in {{group}}.", + "otherGroup": "another group", + "targetFull": "That group is full. Choose another or free up a spot first.", + "alreadyMember": "This person is already a member of that group.", + "moveError": "We couldn't change the group.", + "addError": "We couldn't add them to the group." + } +} diff --git a/apps/web/src/i18n/locales/es-419/attendeeDetail.json b/apps/web/src/i18n/locales/es-419/attendeeDetail.json new file mode 100644 index 0000000..2eebed3 --- /dev/null +++ b/apps/web/src/i18n/locales/es-419/attendeeDetail.json @@ -0,0 +1,162 @@ +{ + "fallbackName": "Miembro", + "backToGroup": "Volver al grupo", + "since": "Desde {{date}}", + "notFound": { + "title": "Miembro no encontrado", + "description": "No se pudo cargar la información de este miembro." + }, + "actions": { + "whatsappLabel": "Abrir WhatsApp con {{name}}", + "callLabel": "Llamar a {{name}}", + "call": "Llamar", + "missingPhone": "Agrega un teléfono para usar estas acciones", + "theMember": "el miembro" + }, + "phone": { + "copied": "Número copiado", + "copiedLive": "Número copiado al portapapeles" + }, + "contact": { + "title": "Contacto", + "edit": "Editar", + "phone": "Teléfono", + "email": "Email", + "addPhone": "Agregar teléfono", + "addEmail": "Agregar email", + "shared": "El cambio se aplica en todos sus grupos.", + "phoneTaken": "Ese teléfono ya es de otra persona que tienes registrada.", + "saveError": "No pudimos guardar los cambios. Revisa tu conexión e inténtalo de nuevo." + }, + "otherGroups": { + "title": "También está en", + "PAUSED": "En pausa", + "DROPPED": "Dado de baja" + }, + "access": { + "title": "Acceso a la app", + "active": "Activo", + "invited": "Invitado", + "invitedExpires": "Invitado · vence en {{hours}} h", + "expired": "Vencido", + "notInvited": "Sin invitar", + "device": "Desde el {{since}} · último uso {{ago}}", + "faceId": " · Face ID", + "pitch": "Para que avise faltas e informe pagos desde su teléfono.", + "reinviteHint": "¿Te dice que no puede entrar? Envíale un link nuevo: cierra el acceso anterior.", + "reinviteWhatsapp": "Reinvitar por WhatsApp", + "reinvite": "Reinvitar", + "invite": "Invitar a la app", + "yourGroup": "tu grupo", + "agoMinutes": "hace {{count}} min", + "agoHours": "hace {{count}} h", + "yesterday": "ayer", + "agoDays": "hace {{count}} días" + }, + "inviteSheet": { + "titleReinvite": "Reinvitar a la app", + "title": "Invitar a la app", + "descriptionReinvite": "Envíale un link nuevo a {{name}}. El acceso anterior deja de funcionar.", + "description": "{{name}} podrá avisar faltas, informar pagos y ver sus próximas clases. Sin contraseñas ni datos nuevos.", + "preview": "Vista previa del mensaje", + "linkPlaceholder": "🔗 link personal", + "security": "El link es personal, sirve una sola vez y vence en 72 horas. Queda conectado el primer teléfono que lo abra.", + "error": "No pudimos generar el link. Inténtalo de nuevo.", + "sendWhatsapp": "Enviar por WhatsApp", + "copied": "Link copiado", + "copy": "Copiar link", + "message": "¡Hola {{name}}! Te invito a gruperly para avisar faltas e informar pagos de {{group}}. {{url}}" + }, + "payments": { + "title": "Cobros", + "register": "Registrar pago", + "registerPending": "Registrar pagos estará disponible cuando se defina el flujo de cobros.", + "noCharge": "Sin cobro registrado", + "upToDate": "Al día", + "owes": "Debe {{month}}" + }, + "attendance": { + "title": "Asistencia", + "loadError": "No pudimos cargar la asistencia de este miembro.", + "empty": "Todavía no hay clases registradas.", + "capped": "El historial guarda las últimas {{count}} clases.", + "showLess": "Ver menos", + "showAll": "Ver todas ({{count}})", + "noClasses": "Sin clases registradas", + "summary": "{{present}} de {{classes}}", + "classes_one": "{{count}} clase", + "classes_other": "{{count}} clases", + "PRESENT": "Asistió", + "ABSENT": "Faltó", + "EXCUSED": "Faltó (avisó)", + "NONE": "Sin registrar" + }, + "notes": { + "title": "Notas", + "edit": "Editar", + "empty": "Sin notas todavía.", + "label": "Notas del miembro", + "saveError": "No pudimos guardar la nota. Revisa tu conexión e inténtalo de nuevo.", + "editedToday": "Editado hoy", + "edited": "Editado {{date}}" + }, + "absenceLink": { + "title": "Link de ausencias", + "description": "Para que avise si no puede venir", + "copy": "Copiar link", + "sendLabel": "Enviar el link por WhatsApp a {{name}}", + "send": "Enviar por WhatsApp", + "copied": "Link copiado", + "message": "Hola {{name}}, desde este link puedes avisar tus ausencias en {{url}}" + }, + "menu": { + "more": "Más acciones", + "label": "Acciones del miembro", + "changeGroup": "Cambiar de grupo", + "addToGroup": "Agregar a otro grupo", + "editContact": "Editar contacto", + "pause": "Pausar membresía", + "pausePending": "Pausar la membresía estará disponible cuando se confirme su lógica de negocio.", + "remove": "Quitar del grupo" + }, + "remove": { + "title": "Quitar del grupo", + "history": "Se borra su historial: las clases registradas y las ausencias que avisó dejan de existir.", + "link": "El link de ausencias deja de funcionar.", + "spotWaiting_one": "Se libera 1 lugar. Hay {{count}} persona en lista de espera.", + "spotWaiting_other": "Se libera 1 lugar. Hay {{count}} personas en lista de espera.", + "spot": "Se libera 1 lugar en el grupo.", + "paymentsNote": "Si tiene cobros registrados no se podrá quitar: primero hay que gestionarlos.", + "promote": "Si lo quitas, puedes darle el lugar a {{name}}, el primero de la lista de espera.", + "promoteAction": "Pasar a {{name}} al grupo", + "confirm": "Quitar del grupo" + }, + "changeGroup": { + "titleAdd": "Agregar a otro grupo", + "title": "Cambiar de grupo", + "loadingGroups": "Cargando grupos", + "allGroups": "Ya es miembro de todos tus otros grupos.", + "noGroupsAdd": "No tienes otros grupos. Crea uno para poder agregar a este miembro.", + "noGroupsMove": "No tienes otros grupos. Crea uno para poder mover a este miembro.", + "addTo": "Agregar a", + "moveTo": "Mover a", + "pick": "Elige un grupo", + "full": "{{name}} (sin cupo)", + "currentGroup": "el grupo actual", + "addStays": "Sigue en {{group}}: estará en los dos grupos.", + "addShares": "Comparte el contacto, las notas y el acceso a la app de alumnos.", + "addSeparate": "La asistencia y las cuotas se llevan por separado en cada grupo.", + "moveKeeps": "Conserva su historial, sus cuotas y su acceso a la app de alumnos.", + "moveFees": "Las cuotas pendientes de {{group}} siguen vigentes.", + "moveNotices": "Se cancelan las faltas avisadas para clases futuras de {{group}}.", + "add": "Agregar", + "move": "Cambiar de grupo", + "moved": "{{name}} pasó a {{group}}.", + "added": "{{name}} ahora también está en {{group}}.", + "otherGroup": "otro grupo", + "targetFull": "Ese grupo alcanzó su cupo. Elige otro o libera un lugar primero.", + "alreadyMember": "Esta persona ya es miembro de ese grupo.", + "moveError": "No se pudo cambiar de grupo.", + "addError": "No se pudo agregar al grupo." + } +} diff --git a/apps/web/src/i18n/locales/es-AR/attendeeDetail.json b/apps/web/src/i18n/locales/es-AR/attendeeDetail.json new file mode 100644 index 0000000..d542155 --- /dev/null +++ b/apps/web/src/i18n/locales/es-AR/attendeeDetail.json @@ -0,0 +1,162 @@ +{ + "fallbackName": "Miembro", + "backToGroup": "Volver al grupo", + "since": "Desde {{date}}", + "notFound": { + "title": "Miembro no encontrado", + "description": "No se pudo cargar la información de este miembro." + }, + "actions": { + "whatsappLabel": "Abrir WhatsApp con {{name}}", + "callLabel": "Llamar a {{name}}", + "call": "Llamar", + "missingPhone": "Agregá un teléfono para usar estas acciones", + "theMember": "el miembro" + }, + "phone": { + "copied": "Número copiado", + "copiedLive": "Número copiado al portapapeles" + }, + "contact": { + "title": "Contacto", + "edit": "Editar", + "phone": "Teléfono", + "email": "Email", + "addPhone": "Agregar teléfono", + "addEmail": "Agregar email", + "shared": "El cambio se aplica en todos sus grupos.", + "phoneTaken": "Ese teléfono ya es de otra persona que tenés registrada.", + "saveError": "No pudimos guardar los cambios. Revisá tu conexión e intentá de nuevo." + }, + "otherGroups": { + "title": "También está en", + "PAUSED": "En pausa", + "DROPPED": "Dado de baja" + }, + "access": { + "title": "Acceso a la app", + "active": "Activo", + "invited": "Invitado", + "invitedExpires": "Invitado · vence en {{hours}} h", + "expired": "Vencido", + "notInvited": "Sin invitar", + "device": "Desde el {{since}} · último uso {{ago}}", + "faceId": " · Face ID", + "pitch": "Para que avise faltas e informe pagos desde su teléfono.", + "reinviteHint": "¿Te dice que no puede entrar? Mandale un link nuevo: cierra el acceso anterior.", + "reinviteWhatsapp": "Reinvitar por WhatsApp", + "reinvite": "Reinvitar", + "invite": "Invitar a la app", + "yourGroup": "tu grupo", + "agoMinutes": "hace {{count}} min", + "agoHours": "hace {{count}} h", + "yesterday": "ayer", + "agoDays": "hace {{count}} días" + }, + "inviteSheet": { + "titleReinvite": "Reinvitar a la app", + "title": "Invitar a la app", + "descriptionReinvite": "Mandale un link nuevo a {{name}}. El acceso anterior deja de funcionar.", + "description": "{{name}} va a poder avisar faltas, informar pagos y ver sus próximas clases. Sin contraseñas ni datos nuevos.", + "preview": "Vista previa del mensaje", + "linkPlaceholder": "🔗 link personal", + "security": "El link es personal, sirve una sola vez y vence en 72 horas. Queda conectado el primer teléfono que lo abra.", + "error": "No pudimos generar el link. Probá de nuevo.", + "sendWhatsapp": "Enviar por WhatsApp", + "copied": "Link copiado", + "copy": "Copiar link", + "message": "¡Hola {{name}}! Te invito a gruperly para avisar faltas e informar pagos de {{group}}. {{url}}" + }, + "payments": { + "title": "Cobros", + "register": "Registrar pago", + "registerPending": "Registrar pagos estará disponible cuando se defina el flujo de cobros.", + "noCharge": "Sin cobro registrado", + "upToDate": "Al día", + "owes": "Debe {{month}}" + }, + "attendance": { + "title": "Asistencia", + "loadError": "No pudimos cargar la asistencia de este miembro.", + "empty": "Todavía no hay clases registradas.", + "capped": "El historial guarda las últimas {{count}} clases.", + "showLess": "Ver menos", + "showAll": "Ver todas ({{count}})", + "noClasses": "Sin clases registradas", + "summary": "{{present}} de {{classes}}", + "classes_one": "{{count}} clase", + "classes_other": "{{count}} clases", + "PRESENT": "Asistió", + "ABSENT": "Faltó", + "EXCUSED": "Faltó (avisó)", + "NONE": "Sin registrar" + }, + "notes": { + "title": "Notas", + "edit": "Editar", + "empty": "Sin notas todavía.", + "label": "Notas del miembro", + "saveError": "No pudimos guardar la nota. Revisá tu conexión e intentá de nuevo.", + "editedToday": "Editado hoy", + "edited": "Editado {{date}}" + }, + "absenceLink": { + "title": "Link de ausencias", + "description": "Para que avise si no puede venir", + "copy": "Copiar link", + "sendLabel": "Enviar el link por WhatsApp a {{name}}", + "send": "Enviar por WhatsApp", + "copied": "Link copiado", + "message": "Hola {{name}}, desde este link podés avisar tus ausencias en {{url}}" + }, + "menu": { + "more": "Más acciones", + "label": "Acciones del miembro", + "changeGroup": "Cambiar de grupo", + "addToGroup": "Agregar a otro grupo", + "editContact": "Editar contacto", + "pause": "Pausar membresía", + "pausePending": "Pausar la membresía estará disponible cuando se confirme su lógica de negocio.", + "remove": "Quitar del grupo" + }, + "remove": { + "title": "Quitar del grupo", + "history": "Se borra su historial: las clases registradas y las ausencias que avisó dejan de existir.", + "link": "El link de ausencias deja de funcionar.", + "spotWaiting_one": "Se libera 1 lugar. Hay {{count}} persona en lista de espera.", + "spotWaiting_other": "Se libera 1 lugar. Hay {{count}} personas en lista de espera.", + "spot": "Se libera 1 lugar en el grupo.", + "paymentsNote": "Si tiene cobros registrados no se va a poder quitar: primero hay que gestionarlos.", + "promote": "Si lo quitás, podés darle el lugar a {{name}}, el primero de la lista de espera.", + "promoteAction": "Pasar a {{name}} al grupo", + "confirm": "Quitar del grupo" + }, + "changeGroup": { + "titleAdd": "Agregar a otro grupo", + "title": "Cambiar de grupo", + "loadingGroups": "Cargando grupos", + "allGroups": "Ya es miembro de todos tus otros grupos.", + "noGroupsAdd": "No tenés otros grupos. Creá uno para poder agregar a este miembro.", + "noGroupsMove": "No tenés otros grupos. Creá uno para poder mover a este miembro.", + "addTo": "Agregar a", + "moveTo": "Mover a", + "pick": "Elegí un grupo", + "full": "{{name}} (sin cupo)", + "currentGroup": "el grupo actual", + "addStays": "Sigue en {{group}}: va a estar en los dos grupos.", + "addShares": "Comparte el contacto, las notas y el acceso a la app de alumnos.", + "addSeparate": "La asistencia y las cuotas se llevan por separado en cada grupo.", + "moveKeeps": "Conserva su historial, sus cuotas y su acceso a la app de alumnos.", + "moveFees": "Las cuotas pendientes de {{group}} siguen vigentes.", + "moveNotices": "Se cancelan las faltas avisadas para clases futuras de {{group}}.", + "add": "Agregar", + "move": "Cambiar de grupo", + "moved": "{{name}} pasó a {{group}}.", + "added": "{{name}} ahora también está en {{group}}.", + "otherGroup": "otro grupo", + "targetFull": "Ese grupo alcanzó su cupo. Elegí otro o liberá un lugar primero.", + "alreadyMember": "Esta persona ya es miembro de ese grupo.", + "moveError": "No se pudo cambiar de grupo.", + "addError": "No se pudo agregar al grupo." + } +} diff --git a/apps/web/src/i18n/locales/pt-BR/attendeeDetail.json b/apps/web/src/i18n/locales/pt-BR/attendeeDetail.json new file mode 100644 index 0000000..018fc4a --- /dev/null +++ b/apps/web/src/i18n/locales/pt-BR/attendeeDetail.json @@ -0,0 +1,162 @@ +{ + "fallbackName": "Membro", + "backToGroup": "Voltar ao grupo", + "since": "Desde {{date}}", + "notFound": { + "title": "Membro não encontrado", + "description": "Não foi possível carregar as informações deste membro." + }, + "actions": { + "whatsappLabel": "Abrir WhatsApp com {{name}}", + "callLabel": "Ligar para {{name}}", + "call": "Ligar", + "missingPhone": "Adicione um telefone para usar estas ações", + "theMember": "o membro" + }, + "phone": { + "copied": "Número copiado", + "copiedLive": "Número copiado para a área de transferência" + }, + "contact": { + "title": "Contato", + "edit": "Editar", + "phone": "Telefone", + "email": "E-mail", + "addPhone": "Adicionar telefone", + "addEmail": "Adicionar e-mail", + "shared": "A alteração vale para todos os grupos dele.", + "phoneTaken": "Esse telefone já é de outra pessoa cadastrada.", + "saveError": "Não conseguimos salvar as alterações. Verifique sua conexão e tente novamente." + }, + "otherGroups": { + "title": "Também está em", + "PAUSED": "Pausado", + "DROPPED": "Desligado" + }, + "access": { + "title": "Acesso ao app", + "active": "Ativo", + "invited": "Convidado", + "invitedExpires": "Convidado · vence em {{hours}} h", + "expired": "Vencido", + "notInvited": "Não convidado", + "device": "Desde {{since}} · último uso {{ago}}", + "faceId": " · Face ID", + "pitch": "Para avisar faltas e informar pagamentos pelo celular.", + "reinviteHint": "Diz que não consegue entrar? Envie um novo link: ele encerra o acesso anterior.", + "reinviteWhatsapp": "Convidar de novo pelo WhatsApp", + "reinvite": "Convidar de novo", + "invite": "Convidar para o app", + "yourGroup": "seu grupo", + "agoMinutes": "há {{count}} min", + "agoHours": "há {{count}} h", + "yesterday": "ontem", + "agoDays": "há {{count}} dias" + }, + "inviteSheet": { + "titleReinvite": "Convidar de novo para o app", + "title": "Convidar para o app", + "descriptionReinvite": "Envie um novo link para {{name}}. O acesso anterior deixa de funcionar.", + "description": "{{name}} vai poder avisar faltas, informar pagamentos e ver as próximas aulas. Sem senhas nem dados novos.", + "preview": "Prévia da mensagem", + "linkPlaceholder": "🔗 link pessoal", + "security": "O link é pessoal, vale uma única vez e vence em 72 horas. Fica conectado o primeiro celular que abrir.", + "error": "Não conseguimos gerar o link. Tente novamente.", + "sendWhatsapp": "Enviar pelo WhatsApp", + "copied": "Link copiado", + "copy": "Copiar link", + "message": "Olá, {{name}}! Te convido para o gruperly para avisar faltas e informar pagamentos de {{group}}. {{url}}" + }, + "payments": { + "title": "Cobranças", + "register": "Registrar pagamento", + "registerPending": "Registrar pagamentos estará disponível quando o fluxo de cobranças for definido.", + "noCharge": "Nenhuma cobrança registrada", + "upToDate": "Em dia", + "owes": "Deve {{month}}" + }, + "attendance": { + "title": "Presença", + "loadError": "Não conseguimos carregar a presença deste membro.", + "empty": "Ainda não há aulas registradas.", + "capped": "O histórico guarda as últimas {{count}} aulas.", + "showLess": "Ver menos", + "showAll": "Ver todas ({{count}})", + "noClasses": "Nenhuma aula registrada", + "summary": "{{present}} de {{classes}}", + "classes_one": "{{count}} aula", + "classes_other": "{{count}} aulas", + "PRESENT": "Presente", + "ABSENT": "Faltou", + "EXCUSED": "Faltou (avisou)", + "NONE": "Sem registro" + }, + "notes": { + "title": "Observações", + "edit": "Editar", + "empty": "Nenhuma observação ainda.", + "label": "Observações do membro", + "saveError": "Não conseguimos salvar a observação. Verifique sua conexão e tente novamente.", + "editedToday": "Editado hoje", + "edited": "Editado em {{date}}" + }, + "absenceLink": { + "title": "Link de faltas", + "description": "Para avisar se não puder vir", + "copy": "Copiar link", + "sendLabel": "Enviar o link pelo WhatsApp para {{name}}", + "send": "Enviar pelo WhatsApp", + "copied": "Link copiado", + "message": "Olá, {{name}}! Por este link você pode avisar suas faltas: {{url}}" + }, + "menu": { + "more": "Mais ações", + "label": "Ações do membro", + "changeGroup": "Mudar de grupo", + "addToGroup": "Adicionar a outro grupo", + "editContact": "Editar contato", + "pause": "Pausar matrícula", + "pausePending": "Pausar a matrícula estará disponível quando a regra de negócio for confirmada.", + "remove": "Remover do grupo" + }, + "remove": { + "title": "Remover do grupo", + "history": "O histórico é apagado: as aulas registradas e as faltas avisadas deixam de existir.", + "link": "O link de faltas deixa de funcionar.", + "spotWaiting_one": "Libera 1 vaga. Há {{count}} pessoa na lista de espera.", + "spotWaiting_other": "Libera 1 vaga. Há {{count}} pessoas na lista de espera.", + "spot": "Libera 1 vaga no grupo.", + "paymentsNote": "Se tiver cobranças registradas, não poderá ser removido: primeiro é preciso gerenciá-las.", + "promote": "Se remover, você pode dar a vaga para {{name}}, o primeiro da lista de espera.", + "promoteAction": "Passar {{name}} para o grupo", + "confirm": "Remover do grupo" + }, + "changeGroup": { + "titleAdd": "Adicionar a outro grupo", + "title": "Mudar de grupo", + "loadingGroups": "Carregando grupos", + "allGroups": "Já é membro de todos os seus outros grupos.", + "noGroupsAdd": "Você não tem outros grupos. Crie um para poder adicionar este membro.", + "noGroupsMove": "Você não tem outros grupos. Crie um para poder mover este membro.", + "addTo": "Adicionar a", + "moveTo": "Mover para", + "pick": "Escolha um grupo", + "full": "{{name}} (sem vagas)", + "currentGroup": "o grupo atual", + "addStays": "Continua em {{group}}: vai estar nos dois grupos.", + "addShares": "Compartilha o contato, as observações e o acesso ao app de alunos.", + "addSeparate": "A presença e as mensalidades são controladas separadamente em cada grupo.", + "moveKeeps": "Mantém o histórico, as mensalidades e o acesso ao app de alunos.", + "moveFees": "As mensalidades pendentes de {{group}} continuam valendo.", + "moveNotices": "As faltas avisadas para aulas futuras de {{group}} são canceladas.", + "add": "Adicionar", + "move": "Mudar de grupo", + "moved": "{{name}} passou para {{group}}.", + "added": "{{name}} agora também está em {{group}}.", + "otherGroup": "outro grupo", + "targetFull": "Esse grupo atingiu o limite de vagas. Escolha outro ou libere uma vaga primeiro.", + "alreadyMember": "Esta pessoa já é membro desse grupo.", + "moveError": "Não foi possível mudar de grupo.", + "addError": "Não foi possível adicionar ao grupo." + } +} diff --git a/apps/web/test/attendee-attendance.test.ts b/apps/web/test/attendee-attendance.test.ts index 9b76957..a21c78a 100644 --- a/apps/web/test/attendee-attendance.test.ts +++ b/apps/web/test/attendee-attendance.test.ts @@ -112,12 +112,12 @@ describe('visibleSessions', () => { describe('formatSessionShortDate', () => { test('fecha corta con día de la semana', () => { - expect(formatSessionShortDate(fecha(28))).toBe('lun 28 sep') + expect(formatSessionShortDate(fecha(28))).toBe('lun 28 sept') }) }) describe('formatMemberSince', () => { test('fecha abreviada con año, en una sola línea', () => { - expect(formatMemberSince(fecha(18))).toBe('18 sep 2026') + expect(formatMemberSince(fecha(18))).toBe('18 de sept de 2026') }) }) diff --git a/apps/web/test/attendee-detail.test.ts b/apps/web/test/attendee-detail.test.ts index 71cc4da..7be7d74 100644 --- a/apps/web/test/attendee-detail.test.ts +++ b/apps/web/test/attendee-detail.test.ts @@ -69,7 +69,7 @@ describe('formatNotesUpdatedAt', () => { test('usa una fecha corta para ediciones anteriores', () => { expect( formatNotesUpdatedAt('2026-09-29T08:00:00.000Z', new Date('2026-10-01T18:00:00.000Z')), - ).toBe('Editado 29 sep 2026') + ).toBe('Editado 29 de sept de 2026') }) })