feat(i18n): traducir Grupos (lista, ficha, alta de miembros y estadísticas)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { AttendeeListItem, AttendanceStatus } from '@gruperly/shared'
|
||||
import { RECENT_ATTENDANCE_LIMIT } from '@gruperly/shared'
|
||||
import { i18n } from '../../../i18n/instance'
|
||||
import { PAYMENT_DUE_SOON_DAYS } from './constants'
|
||||
|
||||
/* The listing's row does not ask the backend for presentation verdicts: it asks
|
||||
@@ -56,14 +57,14 @@ export function isOverdue(state: PaymentState | null): boolean {
|
||||
export function paymentStateLabel(state: PaymentState): string {
|
||||
switch (state.kind) {
|
||||
case 'settled':
|
||||
return 'Al día'
|
||||
return i18n.t('groupDetail:row.settled')
|
||||
case 'dueSoon':
|
||||
// "Vence en 0 d" is not natural Spanish: today and tomorrow have words.
|
||||
if (state.days === 0) return 'Vence hoy'
|
||||
if (state.days === 1) return 'Vence mañana'
|
||||
return `Vence en ${state.days} d`
|
||||
// "Vence en 0 d" is not natural: today and tomorrow have words.
|
||||
if (state.days === 0) return i18n.t('groupDetail:row.dueToday')
|
||||
if (state.days === 1) return i18n.t('groupDetail:row.dueTomorrow')
|
||||
return i18n.t('groupDetail:row.dueIn', { days: state.days })
|
||||
case 'overdue':
|
||||
return `Vencido · ${state.days} d`
|
||||
return i18n.t('groupDetail:row.overdue', { days: state.days })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +87,7 @@ export function summarizeAttendance(
|
||||
const recorded = dots.length
|
||||
|
||||
if (recorded === 0) {
|
||||
return { dots, attended: 0, recorded: 0, label: 'Sin clases aún' }
|
||||
return { dots, attended: 0, recorded: 0, label: i18n.t('groupDetail:row.noClasses') }
|
||||
}
|
||||
|
||||
const attended = dots.filter((status) => status === 'PRESENT').length
|
||||
@@ -94,7 +95,7 @@ export function summarizeAttendance(
|
||||
dots,
|
||||
attended,
|
||||
recorded,
|
||||
label: `${attended} de ${recorded} ${recorded === 1 ? 'clase' : 'clases'}`,
|
||||
label: i18n.t('groupDetail:row.attended', { attended, count: recorded }),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user