@@ -58,16 +60,20 @@ export function VerifyEmailPage() {
{status === 'success' ? (
- Tu cuenta quedó verificada. Te estamos llevando a Gruperly…
+ {t('verify.success')}
) : status === 'error' ? (
- El vínculo de verificación no es válido o expiró.
+ {t('verify.error')}
) : (
- Te enviamos un correo a {email} para
- confirmar tu cuenta.
+ }}
+ />
)}
@@ -76,13 +82,13 @@ export function VerifyEmailPage() {
to="/"
className="w-full rounded-xl bg-accent py-2 text-center text-sm font-medium text-on-accent hover:bg-accent-strong"
>
- Ir a Gruperly
+ {t('verify.goToApp')}
) : null}
{status === 'error' ? (
- Intentar iniciar sesión
+ {t('verify.tryLogin')}
) : null}
diff --git a/apps/web/src/features/groups/GroupForm.tsx b/apps/web/src/features/groups/GroupForm.tsx
index 000ac88..1393d57 100644
--- a/apps/web/src/features/groups/GroupForm.tsx
+++ b/apps/web/src/features/groups/GroupForm.tsx
@@ -5,7 +5,7 @@ import { CreateFirstGroupSchema, DEFAULT_COUNTRY } from '@gruperly/shared'
import { ArrowLeft, Check, Loader2 } from 'lucide-react'
import { sortWeekDays } from '../../lib/format'
import { cn } from '../../lib/utils'
-import { Button, Input, Label } from '../../components/ui'
+import { Button, FieldError, Input, Label } from '../../components/ui'
import { BILLING_TYPES, WEEK_DAY_CHIPS } from '../onboarding/constants'
type GroupFormProps = {
@@ -84,7 +84,7 @@ export function GroupForm({
invalid={!!errors.name}
{...register('name')}
/>
- {errors.name ? {errors.name.message}
: null}
+
@@ -110,7 +110,7 @@ export function GroupForm({
)
})}
- {errors.days ? {errors.days.message}
: null}
+
@@ -121,7 +121,7 @@ export function GroupForm({
invalid={!!errors.time}
{...register('time')}
/>
- {errors.time ?
{errors.time.message}
: null}
+
@@ -136,9 +136,7 @@ export function GroupForm({
invalid={!!errors.capacity}
{...register('capacity', { valueAsNumber: true })}
/>
- {errors.capacity ? (
-
{errors.capacity.message}
- ) : null}
+
@@ -159,9 +157,7 @@ export function GroupForm({
{...register('price', { valueAsNumber: true })}
/>
- {errors.price ? (
- {errors.price.message}
- ) : null}
+
@@ -213,9 +209,7 @@ export function GroupForm({
Los cobros vencerán el día {isFinite(dueDay) && dueDay ? dueDay : '1'} de cada mes.
- {errors.dueDay ? (
- {errors.dueDay.message}
- ) : null}
+
{errorMessage ? (
diff --git a/apps/web/src/features/groups/detail/GroupInfoCard.tsx b/apps/web/src/features/groups/detail/GroupInfoCard.tsx
index 5e033fa..3eff0c0 100644
--- a/apps/web/src/features/groups/detail/GroupInfoCard.tsx
+++ b/apps/web/src/features/groups/detail/GroupInfoCard.tsx
@@ -2,7 +2,7 @@ import { CalendarClock, CircleDollarSign, Users } from 'lucide-react'
import {
formatBillingMeta,
formatPrice,
- WEEK_DAY_FULL_LABELS,
+ weekDayLabel,
sortWeekDays,
} from '../../../lib/format'
import { cn } from '../../../lib/utils'
@@ -19,7 +19,7 @@ export function GroupInfoCard() {
const { group, attendeesTotal, attendeesPending, waitlistTotal } = useGroupDetail()
if (!group) return null
- const daysLabel = sortWeekDays(group.days ?? []).map((day) => WEEK_DAY_FULL_LABELS[day]).join(', ')
+ const daysLabel = sortWeekDays(group.days ?? []).map(weekDayLabel).join(', ')
const capacity = group.capacity
const isFull = capacity != null && attendeesTotal >= capacity
const freeSpots = capacity != null ? Math.max(capacity - attendeesTotal, 0) : null
diff --git a/apps/web/src/features/home/UpcomingPaymentRow.tsx b/apps/web/src/features/home/UpcomingPaymentRow.tsx
index 7571ad9..de49f13 100644
--- a/apps/web/src/features/home/UpcomingPaymentRow.tsx
+++ b/apps/web/src/features/home/UpcomingPaymentRow.tsx
@@ -1,6 +1,6 @@
import type { UpcomingPaymentDto } from '@gruperly/shared'
import { Badge } from '../../components/ui'
-import { formatPrice, formatRelativeDateTime, PAYMENT_STATUS_LABELS } from '../../lib/format'
+import { formatPrice, formatRelativeDateTime, paymentStatusLabel } from '../../lib/format'
import { PAYMENT_BADGE_VARIANT } from './constants'
export function UpcomingPaymentRow({ payment }: { payment: UpcomingPaymentDto }) {
@@ -15,7 +15,7 @@ export function UpcomingPaymentRow({ payment }: { payment: UpcomingPaymentDto })
{formatPrice(payment.amount)}
- {PAYMENT_STATUS_LABELS[payment.status]}
+ {paymentStatusLabel(payment.status)}
diff --git a/apps/web/src/features/join/GroupInviteSummary.tsx b/apps/web/src/features/join/GroupInviteSummary.tsx
index cdb9440..22dfb36 100644
--- a/apps/web/src/features/join/GroupInviteSummary.tsx
+++ b/apps/web/src/features/join/GroupInviteSummary.tsx
@@ -1,6 +1,6 @@
import { CalendarClock, GraduationCap, Users } from 'lucide-react'
import { Badge } from '../../components/ui'
-import { BILLING_LABELS, formatPrice, formatSchedule } from '../../lib/format'
+import { billingTypeLabel, formatPrice, formatSchedule } from '../../lib/format'
import { useJoinGroup } from './JoinGroupProvider'
export function GroupInviteSummary() {
@@ -32,7 +32,7 @@ export function GroupInviteSummary() {
{group.price != null ? (
{formatPrice(group.price)}
- {group.billingType ? · {BILLING_LABELS[group.billingType]} : ''}
+ {group.billingType ? · {billingTypeLabel(group.billingType)} : ''}
) : null}
diff --git a/apps/web/src/features/onboarding/ConfirmationStep.tsx b/apps/web/src/features/onboarding/ConfirmationStep.tsx
index bd8a363..05ad397 100644
--- a/apps/web/src/features/onboarding/ConfirmationStep.tsx
+++ b/apps/web/src/features/onboarding/ConfirmationStep.tsx
@@ -7,7 +7,7 @@ import { useAuth } from '../../context/AuthProvider'
import { PLAN_NAMES } from '../billing'
import { MP_PROVIDER_NAME, useMpStatus } from '../mp'
import { useWhatsappStatus } from '../whatsapp'
-import { BILLING_LABELS, formatPrice, formatSchedule } from './constants'
+import { billingTypeLabel, formatPrice, formatSchedule } from './constants'
import { useOnboarding } from './OnboardingProvider'
type ConfirmationStepProps = {
@@ -59,7 +59,7 @@ export function ConfirmationStep({ group }: ConfirmationStepProps) {
Precio
{formatPrice(group.price)}
- {group.billingType ? ` · ${BILLING_LABELS[group.billingType]}` : ''}
+ {group.billingType ? ` · ${billingTypeLabel(group.billingType)}` : ''}
diff --git a/apps/web/src/features/onboarding/constants.ts b/apps/web/src/features/onboarding/constants.ts
index 9ea72f7..2903d60 100644
--- a/apps/web/src/features/onboarding/constants.ts
+++ b/apps/web/src/features/onboarding/constants.ts
@@ -1,6 +1,6 @@
import type { BillingType, WeekDay } from '@gruperly/shared'
-export { BILLING_LABELS, formatPrice, formatSchedule, WEEK_DAY_FULL_LABELS } from '../../lib/format'
+export { billingTypeLabel, formatPrice, formatSchedule, weekDayLabel } from '../../lib/format'
export const WEEK_DAYS: readonly WeekDay[] = [
'MONDAY',
diff --git a/apps/web/src/features/payments/PaymentRow.tsx b/apps/web/src/features/payments/PaymentRow.tsx
index 3f7714c..5e12597 100644
--- a/apps/web/src/features/payments/PaymentRow.tsx
+++ b/apps/web/src/features/payments/PaymentRow.tsx
@@ -3,7 +3,7 @@ import { Check, Copy, Link2, Loader2, RefreshCw } from 'lucide-react'
import { useState } from 'react'
import { Badge, Button } from '../../components/ui'
import { cn } from '../../lib/utils'
-import { formatPrice, PAYMENT_STATUS_LABELS } from '../../lib/format'
+import { formatPrice, paymentStatusLabel } from '../../lib/format'
import { paymentDateLabel, paymentPeriodLabel, PAYMENT_STATUS_BADGE } from './copy'
type PaymentRowProps = {
@@ -49,7 +49,7 @@ export function PaymentRow({ payment, showGroup, isRenewing, onRenew }: PaymentR
{paymentDateLabel(payment)}
- {PAYMENT_STATUS_LABELS[payment.status]}
+ {paymentStatusLabel(payment.status)}
diff --git a/apps/web/src/features/pwa/InstallBanner.tsx b/apps/web/src/features/pwa/InstallBanner.tsx
index 589c819..09f95eb 100644
--- a/apps/web/src/features/pwa/InstallBanner.tsx
+++ b/apps/web/src/features/pwa/InstallBanner.tsx
@@ -1,4 +1,5 @@
import { Download, X } from 'lucide-react'
+import { useTranslation } from 'react-i18next'
import { Button } from '../../components/ui'
type InstallBannerProps = {
@@ -7,6 +8,7 @@ type InstallBannerProps = {
}
export function InstallBanner({ onInstall, onDismiss }: InstallBannerProps) {
+ const { t } = useTranslation('pwa')
return (
-
Instalá Gruperly
+
{t('banner.title')}
- Abrila directo desde tu pantalla de inicio, sin barra de navegador.
+ {t('banner.description')}
- Instalar app
+ {t('banner.install')}
- Ahora no
+ {t('banner.later')}
@@ -33,7 +35,7 @@ export function InstallBanner({ onInstall, onDismiss }: InstallBannerProps) {
diff --git a/apps/web/src/features/pwa/IosInstallHint.tsx b/apps/web/src/features/pwa/IosInstallHint.tsx
index 91551bc..51eb532 100644
--- a/apps/web/src/features/pwa/IosInstallHint.tsx
+++ b/apps/web/src/features/pwa/IosInstallHint.tsx
@@ -1,4 +1,5 @@
import { Share, X } from 'lucide-react'
+import { Trans, useTranslation } from 'react-i18next'
type IosInstallHintProps = {
onDismiss: () => void
@@ -10,6 +11,7 @@ type IosInstallHintProps = {
* no action button.
*/
export function IosInstallHint({ onDismiss }: IosInstallHintProps) {
+ const { t } = useTranslation('pwa')
return (
-
Instalá Gruperly en el iPhone
+
{t('ios.title')}
- Tocá Compartir y elegí{' '}
- Agregar a pantalla de inicio para
- abrirla como app.
+ }} />
diff --git a/apps/web/src/features/pwa/PwaProvider.tsx b/apps/web/src/features/pwa/PwaProvider.tsx
index bbcb36b..4986a30 100644
--- a/apps/web/src/features/pwa/PwaProvider.tsx
+++ b/apps/web/src/features/pwa/PwaProvider.tsx
@@ -11,6 +11,7 @@ import { registerSW } from 'virtual:pwa-register'
import { router } from '../../router'
import { useAuth } from '../../context/AuthProvider'
import { useToast } from '../../components/ui'
+import { i18n } from '../../i18n/instance'
import { InstallPrompt } from './InstallPrompt'
/** `beforeinstallprompt` is not in lib.dom yet (Chromium >= 108). */
@@ -94,7 +95,7 @@ export function PwaProvider({ children }: { children: ReactNode }) {
registerSW({
immediate: true,
onOfflineReady() {
- success('La app quedó lista para abrirse sin conexión', 'Ya podés usar Gruperly offline.')
+ success(i18n.t('pwa:offlineReady'), i18n.t('pwa:offlineReadyDetail'))
},
onRegisterError(error) {
console.error('No se pudo registrar el service worker', error)
@@ -153,14 +154,14 @@ export function PwaProvider({ children }: { children: ReactNode }) {
if (outcome === 'accepted') {
localStorage.setItem(DISMISSED_KEY, '1')
setDismissed(true)
- success('App instalada', 'Ahora tenés Gruperly en tu pantalla de inicio.')
+ success(i18n.t('pwa:installed'), i18n.t('pwa:installedDetail'))
}
}, [installEvent, success])
const dismiss = useCallback(() => {
setDismissed(true)
localStorage.setItem(DISMISSED_KEY, '1')
- info('Podés instalarla más adelante desde el menú del navegador.')
+ info(i18n.t('pwa:installLater'))
}, [info])
/**
diff --git a/apps/web/src/features/security/SecurityPage.tsx b/apps/web/src/features/security/SecurityPage.tsx
index 58b4d2f..c5b67da 100644
--- a/apps/web/src/features/security/SecurityPage.tsx
+++ b/apps/web/src/features/security/SecurityPage.tsx
@@ -4,7 +4,7 @@ import { z } from 'zod'
import { zodResolver } from '@hookform/resolvers/zod'
import { Fingerprint, KeyRound, Loader2, Plus } from 'lucide-react'
import { authClient } from '../../lib/auth-client'
-import { Button, Input, Label } from '../../components/ui'
+import { Button, FieldError, Input, Label } from '../../components/ui'
import { PasskeyList } from './PasskeyList'
import { changePasswordSchema } from './schema'
import type { ChangePasswordValues } from './schema'
@@ -81,9 +81,7 @@ export function SecurityPage() {
invalid={!!errors.currentPassword}
{...register('currentPassword')}
/>
- {errors.currentPassword ? (
- {errors.currentPassword.message}
- ) : null}
+
Nueva contraseña
@@ -94,9 +92,7 @@ export function SecurityPage() {
invalid={!!errors.newPassword}
{...register('newPassword')}
/>
- {errors.newPassword ? (
-
{errors.newPassword.message}
- ) : null}
+
{isSubmitting ? : null}
diff --git a/apps/web/src/features/settings/AppearanceCard.tsx b/apps/web/src/features/settings/AppearanceCard.tsx
index f3fbfa0..9d697b8 100644
--- a/apps/web/src/features/settings/AppearanceCard.tsx
+++ b/apps/web/src/features/settings/AppearanceCard.tsx
@@ -1,16 +1,18 @@
import { Check } from 'lucide-react'
+import { useTranslation } from 'react-i18next'
import { useTheme } from '../../context/ThemeProvider'
import { cn } from '../../lib/utils'
import { THEME_ICONS, THEME_OPTIONS } from './constants'
export function AppearanceCard() {
const { theme, setTheme } = useTheme()
+ const { t } = useTranslation('settings')
return (
-
Apariencia
-
Tema claro u oscuro
+
{t('appearance.title')}
+
{t('appearance.description')}
{THEME_OPTIONS.map((option) => {
const Icon = THEME_ICONS[option.value]
@@ -29,9 +31,9 @@ export function AppearanceCard() {
- {option.label}
+ {t(option.label)}
-
{option.description}
+
{t(option.description)}
{isSelected ?
: null}
diff --git a/apps/web/src/features/settings/LanguageCard.tsx b/apps/web/src/features/settings/LanguageCard.tsx
new file mode 100644
index 0000000..298761a
--- /dev/null
+++ b/apps/web/src/features/settings/LanguageCard.tsx
@@ -0,0 +1,79 @@
+import { SUPPORTED_LOCALES } from '@gruperly/shared'
+import { Check, Languages } from 'lucide-react'
+import { useTranslation } from 'react-i18next'
+import { useToast } from '../../components/ui'
+import { useAuth } from '../../context/AuthProvider'
+import { useLocale, type LocalePreference } from '../../i18n'
+import { LOCALE_NAMES } from '../../i18n/locales'
+import { authClient } from '../../lib/auth-client'
+import { cn } from '../../lib/utils'
+
+const OPTIONS: LocalePreference[] = ['system', ...SUPPORTED_LOCALES]
+
+type LanguageCardProps = {
+ /** Guarda la elección en la cuenta del profe (Better Auth). La app de
+ * alumnos no tiene esa sesión: ahí queda solo en el dispositivo. */
+ syncProfile?: boolean
+}
+
+export function LanguageCard({ syncProfile = false }: LanguageCardProps) {
+ const { t } = useTranslation('settings')
+ const { preference, device, setPreference } = useLocale()
+ const { user } = useAuth()
+ const toast = useToast()
+
+ const select = (next: LocalePreference) => {
+ if (next === preference) return
+ // Optimista: el idioma cambia ya; la cuenta se actualiza por detrás.
+ setPreference(next)
+ if (!syncProfile || !user) return
+ void authClient.updateUser({ locale: next === 'system' ? null : next }).then(({ error }) => {
+ if (error) toast.error(t('language.saveError'))
+ })
+ }
+
+ return (
+
+
+
+
+
+
+
{t('language.title')}
+
{t('language.description')}
+
+
+
+ {OPTIONS.map((option) => {
+ const isSelected = preference === option
+ const isSystem = option === 'system'
+ return (
+
select(option)}
+ className="flex w-full items-center gap-3 px-4 py-3 text-left transition-colors hover:bg-primary-soft"
+ >
+
+
+ {isSystem ? t('language.system') : LOCALE_NAMES[option]}
+
+ {isSystem ? (
+
+ {t('language.systemDescription', { language: LOCALE_NAMES[device] })}
+
+ ) : null}
+
+ {isSelected ? : null}
+
+ )
+ })}
+
+
+ )
+}
diff --git a/apps/web/src/features/settings/SettingsView.tsx b/apps/web/src/features/settings/SettingsView.tsx
index e19597f..bedeccf 100644
--- a/apps/web/src/features/settings/SettingsView.tsx
+++ b/apps/web/src/features/settings/SettingsView.tsx
@@ -1,16 +1,19 @@
import { Link } from '@tanstack/react-router'
import { ChevronRight, Fingerprint } from 'lucide-react'
+import { useTranslation } from 'react-i18next'
import { Button } from '../../components/ui'
import { signOut } from '../../lib/auth-client'
import { PlanSettingsCard } from '../billing'
import { MpStatusCard } from '../mp'
import { WhatsappStatusCard } from '../whatsapp'
import { AppearanceCard } from './AppearanceCard'
+import { LanguageCard } from './LanguageCard'
import { TransferDetailsSettingsCard } from './TransferDetailsSettingsCard'
import { useCallbackFeedbackToast } from './useCallbackFeedbackToast'
export function SettingsView() {
useCallbackFeedbackToast()
+ const { t } = useTranslation('settings')
const handleSignOut = async () => {
await signOut({
@@ -22,8 +25,8 @@ export function SettingsView() {
return (
-
Ajustes
-
Configurá tu cuenta y tus grupos.
+
{t('title')}
+
{t('subtitle')}
@@ -32,8 +35,8 @@ export function SettingsView() {
-
Seguridad
-
Contraseña y passkeys
+
{t('security.title')}
+
{t('security.description')}
@@ -49,8 +52,10 @@ export function SettingsView() {
+
+
- Cerrar sesión
+ {t('signOut')}
)
diff --git a/apps/web/src/features/settings/TransferDetailsSettingsCard.tsx b/apps/web/src/features/settings/TransferDetailsSettingsCard.tsx
index 5d03d5f..bb7a8f1 100644
--- a/apps/web/src/features/settings/TransferDetailsSettingsCard.tsx
+++ b/apps/web/src/features/settings/TransferDetailsSettingsCard.tsx
@@ -1,6 +1,7 @@
import { useState, type FormEvent } from 'react'
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
import { Landmark, Loader2 } from 'lucide-react'
+import { useTranslation } from 'react-i18next'
import { Button, Input, Label, useToast } from '../../components/ui'
import { getTransferDetails, updateTransferDetails } from '../../lib/api'
@@ -11,6 +12,7 @@ const KEY = ['transfer-details'] as const
export function TransferDetailsSettingsCard() {
const queryClient = useQueryClient()
const toast = useToast()
+ const { t } = useTranslation(['settings', 'common'])
const query = useQuery({ queryKey: KEY, queryFn: getTransferDetails })
const [editing, setEditing] = useState(false)
const [alias, setAlias] = useState('')
@@ -21,9 +23,9 @@ export function TransferDetailsSettingsCard() {
onSuccess: (data) => {
queryClient.setQueryData(KEY, data)
setEditing(false)
- toast.success('Datos para transferir guardados')
+ toast.success(t('transfer.saved'))
},
- onError: () => toast.error('No pudimos guardar los datos'),
+ onError: () => toast.error(t('transfer.saveError')),
})
const startEditing = () => {
@@ -44,12 +46,12 @@ export function TransferDetailsSettingsCard() {
-
Datos para transferir
-
Los ven tus alumnos cuando informan un pago
+
{t('transfer.title')}
+
{t('transfer.description')}
{!editing ? (
- {query.data?.alias ? 'Editar' : 'Agregar'}
+ {query.data?.alias ? t('common:actions.edit') : t('common:actions.add')}
) : null}
@@ -57,32 +59,32 @@ export function TransferDetailsSettingsCard() {
{editing ? (
) : query.data?.alias ? (
-
Alias
+ {t('transfer.aliasShort')}
{query.data.alias}
{query.data.holder ? (
-
Titular
+ {t('transfer.holder')}
{query.data.holder}
) : null}
diff --git a/apps/web/src/features/settings/constants.ts b/apps/web/src/features/settings/constants.ts
index e20dd69..6c6a33b 100644
--- a/apps/web/src/features/settings/constants.ts
+++ b/apps/web/src/features/settings/constants.ts
@@ -1,14 +1,15 @@
import { Monitor, Moon, Sun } from 'lucide-react'
import type { Theme } from '../../context/ThemeProvider'
-export const THEME_OPTIONS: { value: Theme; label: string; description: string }[] = [
- { value: 'light', label: 'Claro', description: 'Interfaz en tonos claros' },
- { value: 'dark', label: 'Oscuro', description: 'Interfaz en tonos oscuros' },
- { value: 'system', label: 'Sistema', description: 'Sigue la preferencia de tu dispositivo' },
-]
+/** Claves en el namespace `settings` (`appearance.*`). */
+export const THEME_OPTIONS = [
+ { value: 'light', label: 'appearance.light', description: 'appearance.lightDescription' },
+ { value: 'dark', label: 'appearance.dark', description: 'appearance.darkDescription' },
+ { value: 'system', label: 'appearance.system', description: 'appearance.systemDescription' },
+] as const satisfies readonly { value: Theme; label: string; description: string }[]
export const THEME_ICONS: Record = {
light: Sun,
dark: Moon,
system: Monitor,
-}
\ No newline at end of file
+}
diff --git a/apps/web/src/features/settings/useCallbackFeedbackToast.ts b/apps/web/src/features/settings/useCallbackFeedbackToast.ts
index b26c769..2320769 100644
--- a/apps/web/src/features/settings/useCallbackFeedbackToast.ts
+++ b/apps/web/src/features/settings/useCallbackFeedbackToast.ts
@@ -1,6 +1,7 @@
import { useQueryClient } from '@tanstack/react-query'
import { useNavigate, useSearch } from '@tanstack/react-router'
import { useEffect } from 'react'
+import { useTranslation } from 'react-i18next'
import { useToast } from '../../components/ui'
import { mpCallbackErrorMessage, mpStatusQueryKey, readMpCallbackFeedback } from '../mp'
import {
@@ -19,6 +20,7 @@ export function useCallbackFeedbackToast() {
const navigate = useNavigate()
const queryClient = useQueryClient()
const toast = useToast()
+ const { t } = useTranslation('settings')
useEffect(() => {
const mp = readMpCallbackFeedback(search.mp, search.reason)
@@ -26,12 +28,12 @@ export function useCallbackFeedbackToast() {
if (!mp && !wa) return
if (mp) {
- if (mp.kind === 'success') toast.success('Tu cuenta de Mercado Pago quedó vinculada.')
+ if (mp.kind === 'success') toast.success(t('callback.mpLinked'))
else toast.error(mpCallbackErrorMessage(mp.reason))
void queryClient.invalidateQueries({ queryKey: mpStatusQueryKey })
}
if (wa) {
- if (wa.kind === 'success') toast.success('Tu WhatsApp quedó vinculado.')
+ if (wa.kind === 'success') toast.success(t('callback.whatsappLinked'))
else toast.error(whatsappCallbackErrorMessage(wa.reason))
void queryClient.invalidateQueries({ queryKey: whatsappStatusQueryKey })
}
diff --git a/apps/web/src/features/student-app/student-nav-items.ts b/apps/web/src/features/student-app/student-nav-items.ts
index 22f4af7..59d6301 100644
--- a/apps/web/src/features/student-app/student-nav-items.ts
+++ b/apps/web/src/features/student-app/student-nav-items.ts
@@ -1,8 +1,9 @@
-import { CalendarDays, Home, User, Wallet } from 'lucide-react'
-import type { NavItem } from '../../components/layout/nav-items'
+import { CalendarDays, Home, User, Wallet, type LucideIcon } from 'lucide-react'
+
+type StudentNavItem = { label: string; to: string; icon: LucideIcon }
// Bottom nav of the student app: the single source for StudentBottomNav.
-export const STUDENT_NAV_ITEMS: NavItem[] = [
+export const STUDENT_NAV_ITEMS: StudentNavItem[] = [
{ label: 'Inicio', to: '/student', icon: Home },
{ label: 'Clases', to: '/student/classes', icon: CalendarDays },
{ label: 'Pagos', to: '/student/payments', icon: Wallet },
diff --git a/apps/web/src/i18n/I18nProvider.tsx b/apps/web/src/i18n/I18nProvider.tsx
new file mode 100644
index 0000000..5aef515
--- /dev/null
+++ b/apps/web/src/i18n/I18nProvider.tsx
@@ -0,0 +1,63 @@
+import { createContext, useCallback, useContext, useEffect, useMemo, useState, type ReactNode } from 'react'
+import type { AppLocale } from '@gruperly/shared'
+import { activateLocale } from './load'
+import {
+ deviceLocale,
+ localeFor,
+ readStoredPreference,
+ storePreference,
+ type LocalePreference,
+} from './preference'
+
+type I18nContextValue = {
+ /** Lo que eligió la persona ('system' = idioma del dispositivo). */
+ preference: LocalePreference
+ /** El idioma en el que está la UI ahora. */
+ locale: AppLocale
+ /** El idioma del dispositivo, para la opción "Idioma del dispositivo". */
+ device: AppLocale
+ setPreference: (preference: LocalePreference) => void
+}
+
+const I18nContext = createContext(null)
+
+/** Se monta por fuera de AuthProvider: el login, la app de alumnos y las
+ * páginas públicas también se traducen. main.tsx activa el idioma inicial antes
+ * del primer render, así no se ve un flash en otro idioma. */
+export function I18nProvider({ children }: { children: ReactNode }) {
+ const [preference, setPreferenceState] = useState(readStoredPreference)
+ const [device, setDevice] = useState(deviceLocale)
+ const locale = preference === 'system' ? device : preference
+
+ useEffect(() => {
+ const update = () => setDevice(deviceLocale())
+ window.addEventListener('languagechange', update)
+ return () => window.removeEventListener('languagechange', update)
+ }, [])
+
+ useEffect(() => {
+ void activateLocale(locale)
+ }, [locale])
+
+ const setPreference = useCallback((next: LocalePreference) => {
+ storePreference(next)
+ setPreferenceState(next)
+ }, [])
+
+ const value = useMemo(
+ () => ({ preference, locale, device, setPreference }),
+ [preference, locale, device, setPreference],
+ )
+ return {children}
+}
+
+export function useLocale() {
+ const context = useContext(I18nContext)
+ if (!context) throw new Error('useLocale debe usarse dentro de ')
+ return context
+}
+
+/** Idioma con el que arranca la app (antes de montar React). */
+export function initialLocale(): AppLocale {
+ return localeFor(readStoredPreference())
+}
diff --git a/apps/web/src/i18n/LocaleProfileSync.tsx b/apps/web/src/i18n/LocaleProfileSync.tsx
new file mode 100644
index 0000000..37347f7
--- /dev/null
+++ b/apps/web/src/i18n/LocaleProfileSync.tsx
@@ -0,0 +1,37 @@
+import { useEffect, useRef } from 'react'
+import { appLocaleSchema } from '@gruperly/shared'
+import { useAuth } from '../context/AuthProvider'
+import { authClient } from '../lib/auth-client'
+import { useLocale } from './I18nProvider'
+
+/**
+ * Sincroniza el idioma con el perfil del profe al iniciar sesión:
+ * - si la cuenta tiene un idioma guardado, manda ese (sigue a la persona entre
+ * dispositivos);
+ * - si no tiene y en este dispositivo se eligió uno a mano, se guarda en la
+ * cuenta.
+ * Corre una vez por usuario; después los cambios se guardan desde Ajustes.
+ */
+export function LocaleProfileSync() {
+ const { user } = useAuth()
+ const { preference, setPreference } = useLocale()
+ const syncedUserId = useRef(null)
+
+ useEffect(() => {
+ if (!user) {
+ syncedUserId.current = null
+ return
+ }
+ if (syncedUserId.current === user.id) return
+ syncedUserId.current = user.id
+
+ const stored = appLocaleSchema.safeParse(user.locale)
+ if (stored.success) {
+ if (stored.data !== preference) setPreference(stored.data)
+ } else if (preference !== 'system') {
+ void authClient.updateUser({ locale: preference })
+ }
+ }, [user, preference, setPreference])
+
+ return null
+}
diff --git a/apps/web/src/i18n/errors.ts b/apps/web/src/i18n/errors.ts
new file mode 100644
index 0000000..37032b3
--- /dev/null
+++ b/apps/web/src/i18n/errors.ts
@@ -0,0 +1,85 @@
+import { ApiError } from '../lib/api'
+import { i18n } from './instance'
+
+type AuthClientError = { code?: string; message?: string; status?: number }
+
+function isAuthClientError(error: unknown): error is AuthClientError {
+ return typeof error === 'object' && error !== null && 'code' in error && !(error instanceof ApiError)
+}
+
+type TranslateOptions = Record
+
+function translate(key: string, options: TranslateOptions = {}): string | null {
+ const opts = { ns: 'errors' as const, ...options }
+ return i18n.exists(key, opts) ? String(i18n.t(key as never, opts as never)) : null
+}
+
+/** Un `code` con `params` puede tener variante (`plan_limit_reached_groups`) y
+ * plural (`count` = el número del problema). Se prueba la variante y después
+ * la clave base. */
+function translateCode(code: string, params: Record = {}): string | null {
+ const variant = params.limit ?? params.feature
+ const count = params.max ?? params.capacity
+ const options: TranslateOptions = { ...params, ...(typeof count === 'number' ? { count } : {}) }
+ return (
+ (variant ? translate(`codes.${code}_${variant}`, options) : null) ??
+ translate(`codes.${code}`, options) ??
+ translate(`codes.${code}`)
+ )
+}
+
+/**
+ * Mensaje para mostrarle a la persona ante un error de la API o de Better Auth,
+ * en el idioma de la UI. Orden:
+ * 1. el `code` del Problem Details (o de Better Auth) traducido;
+ * 2. con la UI en español, el `detail` del backend (que está en español) si es
+ * un mensaje de dominio y no uno técnico;
+ * 3. el `fallback` de la pantalla, o uno genérico por status.
+ *
+ * Usa la instancia global: se llama desde callbacks (`onError`) y siempre toma
+ * el idioma vigente.
+ */
+export function errorMessage(error: unknown, fallback?: string): string {
+ if (error instanceof ApiError) {
+ const code = error.problem?.code
+ const byCode = code ? translateCode(code, error.problem?.params) : null
+ if (byCode) return byCode
+
+ const detail = error.problem?.detail
+ if (detail && isDomainDetail(error.status, detail) && i18n.language.startsWith('es')) return detail
+
+ return fallback ?? genericByStatus(error.status)
+ }
+
+ if (isAuthClientError(error) && error.code) {
+ const byCode = translate(`auth.${error.code}`)
+ if (byCode) return byCode
+ }
+
+ return fallback ?? i18n.t('generic', { ns: 'errors' })
+}
+
+/** El backend deja mensajes técnicos en inglés ("Invalid json data", "Group
+ * abc123") para validaciones de forma y 404: esos nunca se muestran. */
+function isDomainDetail(status: number, detail: string): boolean {
+ if (status === 404 || status >= 500) return false
+ return !/^Invalid\b/.test(detail)
+}
+
+function genericByStatus(status: number): string {
+ const key =
+ status === 0
+ ? 'network'
+ : status === 401
+ ? 'status.unauthorized'
+ : status === 403
+ ? 'status.forbidden'
+ : status === 404
+ ? 'status.notFound'
+ : status === 429
+ ? 'status.tooManyRequests'
+ : status >= 500
+ ? 'status.server'
+ : 'generic'
+ return i18n.t(key as never, { ns: 'errors' })
+}
diff --git a/apps/web/src/i18n/i18next.d.ts b/apps/web/src/i18n/i18next.d.ts
new file mode 100644
index 0000000..7bd3341
--- /dev/null
+++ b/apps/web/src/i18n/i18next.d.ts
@@ -0,0 +1,24 @@
+import 'i18next'
+import type auth from './locales/es-AR/auth.json'
+import type common from './locales/es-AR/common.json'
+import type errors from './locales/es-AR/errors.json'
+import type layout from './locales/es-AR/layout.json'
+import type pwa from './locales/es-AR/pwa.json'
+import type settings from './locales/es-AR/settings.json'
+import type validation from './locales/es-AR/validation.json'
+
+// es-AR es la fuente: una clave que no exista ahí rompe el typecheck.
+declare module 'i18next' {
+ interface CustomTypeOptions {
+ defaultNS: 'common'
+ resources: {
+ auth: typeof auth
+ common: typeof common
+ errors: typeof errors
+ layout: typeof layout
+ pwa: typeof pwa
+ settings: typeof settings
+ validation: typeof validation
+ }
+ }
+}
diff --git a/apps/web/src/i18n/index.ts b/apps/web/src/i18n/index.ts
new file mode 100644
index 0000000..4f852fd
--- /dev/null
+++ b/apps/web/src/i18n/index.ts
@@ -0,0 +1,7 @@
+export { i18n, NAMESPACES, type Namespace } from './instance'
+export { activateLocale } from './load'
+export { I18nProvider, initialLocale, useLocale } from './I18nProvider'
+export { useIntlLocale } from './useIntlLocale'
+export { errorMessage } from './errors'
+export { installZodErrorMap, validationMessage } from './validation'
+export type { LocalePreference } from './preference'
diff --git a/apps/web/src/i18n/instance.ts b/apps/web/src/i18n/instance.ts
new file mode 100644
index 0000000..54dc2d9
--- /dev/null
+++ b/apps/web/src/i18n/instance.ts
@@ -0,0 +1,35 @@
+import i18next from 'i18next'
+import { initReactI18next } from 'react-i18next'
+import { FALLBACK_LOCALE } from '@gruperly/shared'
+
+/** Namespaces: uno por feature. Sumar uno implica un JSON por idioma en
+ * `locales//` y una entrada en `i18next.d.ts`. */
+export const NAMESPACES = [
+ 'common',
+ 'layout',
+ 'settings',
+ 'auth',
+ 'pwa',
+ 'errors',
+ 'validation',
+] as const
+export type Namespace = (typeof NAMESPACES)[number]
+
+/** Única instancia de i18next de la app. Los recursos se agregan por idioma al
+ * cargarlos (ver load.ts); los tests cargan es-AR de forma síncrona. */
+export const i18n = i18next.createInstance()
+
+void i18n.use(initReactI18next).init({
+ resources: {},
+ partialBundledLanguages: true,
+ lng: FALLBACK_LOCALE,
+ fallbackLng: FALLBACK_LOCALE,
+ ns: NAMESPACES,
+ defaultNS: 'common',
+ // Los tags son exactos (es-AR, es-419): que i18next no busque "es" a secas.
+ load: 'currentOnly',
+ interpolation: { escapeValue: false },
+ returnNull: false,
+ react: { useSuspense: false },
+ initAsync: false,
+})
diff --git a/apps/web/src/i18n/load.ts b/apps/web/src/i18n/load.ts
new file mode 100644
index 0000000..ccc5a9b
--- /dev/null
+++ b/apps/web/src/i18n/load.ts
@@ -0,0 +1,37 @@
+import type { AppLocale } from '@gruperly/shared'
+import { FALLBACK_LOCALE } from '@gruperly/shared'
+import { i18n } from './instance'
+
+type Bundle = Record
+
+// Vite separa cada JSON en su propio chunk: solo se baja el idioma activo (y el
+// inglés de fallback). Workbox igual los precachea todos, así que cambiar de
+// idioma funciona offline. Va dentro de una función porque `import.meta.glob`
+// solo existe con Vite (en bun test este módulo se importa pero no se usa).
+let bundles: Record Promise> | undefined
+function getBundles() {
+ bundles ??= import.meta.glob('./locales/*/*.json', { import: 'default' })
+ return bundles
+}
+
+const loaded = new Set()
+
+async function loadOne(locale: AppLocale): Promise {
+ if (loaded.has(locale)) return
+ const prefix = `./locales/${locale}/`
+ const entries = Object.entries(getBundles()).filter(([path]) => path.startsWith(prefix))
+ await Promise.all(
+ entries.map(async ([path, load]) => {
+ const ns = path.slice(prefix.length, -'.json'.length)
+ i18n.addResourceBundle(locale, ns, await load(), true, true)
+ }),
+ )
+ loaded.add(locale)
+}
+
+/** Carga el idioma (más el inglés de fallback) y lo activa. */
+export async function activateLocale(locale: AppLocale): Promise {
+ await Promise.all([loadOne(locale), loadOne(FALLBACK_LOCALE)])
+ if (i18n.language !== locale) await i18n.changeLanguage(locale)
+ document.documentElement.lang = locale
+}
diff --git a/apps/web/src/i18n/locales.ts b/apps/web/src/i18n/locales.ts
new file mode 100644
index 0000000..0ed448f
--- /dev/null
+++ b/apps/web/src/i18n/locales.ts
@@ -0,0 +1,10 @@
+import type { AppLocale } from '@gruperly/shared'
+
+/** Cada idioma se nombra en su propia lengua (así lo encuentra quien no
+ * entiende el idioma actual de la UI); no se traduce. */
+export const LOCALE_NAMES: Record = {
+ 'es-AR': 'Español (Argentina y Uruguay)',
+ 'es-419': 'Español (Latinoamérica)',
+ 'pt-BR': 'Português (Brasil)',
+ en: 'English',
+}
diff --git a/apps/web/src/i18n/locales/en/auth.json b/apps/web/src/i18n/locales/en/auth.json
new file mode 100644
index 0000000..783c2ce
--- /dev/null
+++ b/apps/web/src/i18n/locales/en/auth.json
@@ -0,0 +1,65 @@
+{
+ "email": "Email",
+ "emailPlaceholder": "you@example.com",
+ "password": "Password",
+ "or": "or",
+ "continueWithGoogle": "Continue with Google",
+ "backToLogin": "Back to sign in",
+ "login": {
+ "title": "Sign in",
+ "subtitle": "Access your group payments",
+ "resetOk": "Your password was updated. Sign in with the new one.",
+ "forgot": "Forgot your password?",
+ "submit": "Sign in",
+ "submitting": "Signing in…",
+ "passkey": "Sign in with a passkey",
+ "noAccount": "Don't have an account?",
+ "signUp": "Sign up",
+ "error": "We couldn't sign you in",
+ "passkeyError": "We couldn't authenticate with your passkey"
+ },
+ "signup": {
+ "title": "Create account",
+ "subtitle": "Start collecting group payments in minutes",
+ "name": "Name",
+ "namePlaceholder": "Full name",
+ "passwordPlaceholder": "At least 8 characters",
+ "confirmPassword": "Repeat the password",
+ "submit": "Create account",
+ "submitting": "Creating…",
+ "hasAccount": "Already have an account?",
+ "signIn": "Sign in",
+ "error": "We couldn't create your account"
+ },
+ "forgot": {
+ "title": "Reset password",
+ "subtitle": "We'll send you a link to choose a new one",
+ "submit": "Send link",
+ "submitting": "Sending…",
+ "sentTitle": "Check your email",
+ "sent": "If there's an account for {{email}} , we sent you a link to choose a new password. It expires in 1 hour.",
+ "error": "We couldn't send the email"
+ },
+ "reset": {
+ "title": "New password",
+ "subtitle": "Choose a password for your account",
+ "newPassword": "New password",
+ "confirmPassword": "Repeat password",
+ "submit": "Save password",
+ "submitting": "Saving…",
+ "invalidTitle": "Invalid link",
+ "invalid": "The password reset link is invalid or has expired.",
+ "requestNew": "Request a new link",
+ "error": "We couldn't change the password"
+ },
+ "verify": {
+ "title": "Verify your email",
+ "successTitle": "Email verified",
+ "errorTitle": "Invalid link",
+ "success": "Your account is verified. Taking you to Gruperly…",
+ "error": "The verification link is invalid or has expired.",
+ "sent": "We sent an email to {{email}} to confirm your account.",
+ "goToApp": "Go to Gruperly",
+ "tryLogin": "Try signing in"
+ }
+}
diff --git a/apps/web/src/i18n/locales/en/common.json b/apps/web/src/i18n/locales/en/common.json
new file mode 100644
index 0000000..322bc65
--- /dev/null
+++ b/apps/web/src/i18n/locales/en/common.json
@@ -0,0 +1,42 @@
+{
+ "actions": {
+ "cancel": "Cancel",
+ "save": "Save",
+ "edit": "Edit",
+ "add": "Add",
+ "close": "Close",
+ "back": "Back",
+ "retry": "Try again"
+ },
+ "user": {
+ "fallbackName": "User"
+ },
+ "toast": {
+ "close": "Dismiss notification"
+ },
+ "weekDay": {
+ "MONDAY": "Monday",
+ "TUESDAY": "Tuesday",
+ "WEDNESDAY": "Wednesday",
+ "THURSDAY": "Thursday",
+ "FRIDAY": "Friday",
+ "SATURDAY": "Saturday",
+ "SUNDAY": "Sunday"
+ },
+ "billingType": {
+ "MONTHLY": "Monthly",
+ "PER_CLASS": "Per class"
+ },
+ "paymentStatus": {
+ "PENDING": "Pending",
+ "PAID": "Paid",
+ "OVERDUE": "Overdue",
+ "CANCELLED": "Cancelled"
+ },
+ "relativeDay": {
+ "today": "Today · {{time}}",
+ "tomorrow": "Tomorrow · {{time}}",
+ "other": "{{date}} · {{time}}"
+ },
+ "billingDueDay": "Due on day {{day}} of each month"
+}
diff --git a/apps/web/src/i18n/locales/en/errors.json b/apps/web/src/i18n/locales/en/errors.json
new file mode 100644
index 0000000..5557d83
--- /dev/null
+++ b/apps/web/src/i18n/locales/en/errors.json
@@ -0,0 +1,79 @@
+{
+ "generic": "Something went wrong. Please try again.",
+ "network": "You're offline. Check your connection and try again.",
+ "status": {
+ "unauthorized": "Your session expired. Please sign in again.",
+ "forbidden": "You don't have permission to do this.",
+ "notFound": "We couldn't find what you were looking for.",
+ "tooManyRequests": "Too many requests in a row. Try again in a few minutes.",
+ "server": "We ran into a problem. Try again in a few minutes."
+ },
+ "codes": {
+ "admin_required": "Only the Gruperly team can access the back office.",
+ "already_waitlisted": "This phone number is already on the group's waitlist.",
+ "attendee_already_registered": "This person is already a member of this group.",
+ "attendee_has_payments": "This member has payments on record. Manage or cancel them before removing the member from the group.",
+ "attendee_same_group": "The member already belongs to this group.",
+ "billing_not_available": "The Pro subscription isn't available in your country yet.",
+ "billing_provider_error": "We couldn't reach the payment processor. Try again in a few minutes.",
+ "class_already_started": "The class has already started: notices can only be given or undone before it starts.",
+ "cross_origin_request": "Origin not allowed.",
+ "database_unavailable": "We ran into a problem. Try again in a few minutes.",
+ "group_access_denied": "You don't have access to this group.",
+ "group_capacity_reached": "The group is full.",
+ "group_capacity_reached_one": "The group is full ({{count}} member max).",
+ "group_capacity_reached_other": "The group is full ({{count}} members max).",
+ "group_owner_required": "Only the group's creator can change its automations.",
+ "group_without_price": "Set the group's price before creating payments.",
+ "mp_account_in_use": "That Mercado Pago account is already linked to another teacher.",
+ "mp_not_configured": "Linking with Mercado Pago isn't available right now.",
+ "mp_not_connected": "You don't have a Mercado Pago account linked.",
+ "mp_provider_error": "We couldn't finish linking with Mercado Pago.",
+ "mp_requires_reauth": "Your Mercado Pago account needs to be linked again.",
+ "no_active_subscription": "You don't have a subscription to cancel.",
+ "no_attendees_to_bill": "There are no active members with a pending payment in this group.",
+ "onboarding_already_completed": "You've already finished setting up Gruperly.",
+ "passkey_invalid": "We couldn't verify the passkey.",
+ "payment_already_reported": "You've already reported a payment for some of these fees.",
+ "payment_report_already_reviewed": "This payment has already been reviewed.",
+ "person_exists": "You already have someone registered with this phone number.",
+ "person_phone_taken": "Someone else you've registered already uses this phone number.",
+ "plan_feature_required": "This feature is available on the Pro plan.",
+ "plan_feature_required_mpCharges": "Collecting with Mercado Pago is available on the Pro plan.",
+ "plan_feature_required_whatsappAutomations": "Automatic WhatsApp messages are available on the Pro plan.",
+ "plan_limit_reached": "You've reached the Free plan's limit. Upgrade to Pro to keep growing.",
+ "plan_limit_reached_groups_one": "The Free plan allows up to {{count}} group. Upgrade to Pro to create more.",
+ "plan_limit_reached_groups_other": "The Free plan allows up to {{count}} groups. Upgrade to Pro to create more.",
+ "plan_limit_reached_attendees_one": "The Free plan allows up to {{count}} active student. Upgrade to Pro to add more.",
+ "plan_limit_reached_attendees_other": "The Free plan allows up to {{count}} active students. Upgrade to Pro to add more.",
+ "plan_not_selected": "Choose a plan before creating your first group.",
+ "plan_read_only": "Your account is read-only because it's over the Free plan's limits. Upgrade to Pro or reduce your usage to edit again.",
+ "pre_registration_already_reviewed": "This pre-registration has already been reviewed.",
+ "review_undo_expired": "It can no longer be undone.",
+ "storage_not_available": "Receipts can't be attached right now.",
+ "student_link_invalid": "This link has already been used or has expired.",
+ "subscription_already_active": "You already have an active Pro subscription.",
+ "too_many_requests": "Too many requests in a row. Try again in a few minutes.",
+ "unauthorized": "Your session expired. Please sign in again.",
+ "user_not_found": "User not found.",
+ "whatsapp_linking_not_started": "Start linking WhatsApp before requesting the code.",
+ "whatsapp_not_configured": "Linking with WhatsApp isn't available right now.",
+ "whatsapp_not_connected": "You don't have a WhatsApp linked.",
+ "whatsapp_number_in_use": "That WhatsApp number is already linked to another teacher.",
+ "whatsapp_pairing_not_ready": "WhatsApp is still getting ready to link. Try again in a few seconds.",
+ "whatsapp_pairing_unsupported": "This WhatsApp provider doesn't support linking by phone number.",
+ "whatsapp_provider_error": "We couldn't reach WhatsApp. Try again in a few minutes."
+ },
+ "auth": {
+ "INVALID_EMAIL_OR_PASSWORD": "The email or password is incorrect.",
+ "EMAIL_NOT_VERIFIED": "You haven't verified your email yet. Check your inbox.",
+ "USER_ALREADY_EXISTS": "There's already an account with that email.",
+ "USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL": "There's already an account with that email.",
+ "INVALID_EMAIL": "Enter a valid email.",
+ "PASSWORD_TOO_SHORT": "The password must be at least 8 characters.",
+ "PASSWORD_TOO_LONG": "The password is too long.",
+ "INVALID_PASSWORD": "Your current password is incorrect.",
+ "INVALID_TOKEN": "The link is invalid or has expired.",
+ "TOO_MANY_REQUESTS": "Too many requests in a row. Try again in a few minutes."
+ }
+}
diff --git a/apps/web/src/i18n/locales/en/layout.json b/apps/web/src/i18n/locales/en/layout.json
new file mode 100644
index 0000000..ccd7f7e
--- /dev/null
+++ b/apps/web/src/i18n/locales/en/layout.json
@@ -0,0 +1,26 @@
+{
+ "nav": {
+ "home": "Home",
+ "groups": "Groups",
+ "payments": "Payments",
+ "settings": "Settings",
+ "security": "Security",
+ "profile": "My profile"
+ },
+ "breadcrumb": "Breadcrumb",
+ "homeLink": "Gruperly home",
+ "reportedPayments_one": "{{count}} payment to verify",
+ "reportedPayments_other": "{{count}} payments to verify",
+ "theme": {
+ "toLight": "Switch to light theme",
+ "toDark": "Switch to dark theme"
+ },
+ "userMenu": {
+ "close": "Close menu",
+ "profile": "My profile",
+ "settings": "Settings",
+ "admin": "Back office",
+ "signOut": "Sign out"
+ },
+ "publicFooter": "Gruperly — Simple group billing and management"
+}
diff --git a/apps/web/src/i18n/locales/en/pwa.json b/apps/web/src/i18n/locales/en/pwa.json
new file mode 100644
index 0000000..3306020
--- /dev/null
+++ b/apps/web/src/i18n/locales/en/pwa.json
@@ -0,0 +1,18 @@
+{
+ "banner": {
+ "title": "Install Gruperly",
+ "description": "Open it straight from your home screen, without the browser bar.",
+ "install": "Install app",
+ "later": "Not now",
+ "close": "Dismiss install prompt"
+ },
+ "ios": {
+ "title": "Install Gruperly on your iPhone",
+ "description": "Tap Share and choose Add to Home Screen to open it as an app."
+ },
+ "offlineReady": "The app is ready to open offline",
+ "offlineReadyDetail": "You can now use Gruperly offline.",
+ "installed": "App installed",
+ "installedDetail": "Gruperly is now on your home screen.",
+ "installLater": "You can install it later from your browser's menu."
+}
diff --git a/apps/web/src/i18n/locales/en/settings.json b/apps/web/src/i18n/locales/en/settings.json
new file mode 100644
index 0000000..cb823e4
--- /dev/null
+++ b/apps/web/src/i18n/locales/en/settings.json
@@ -0,0 +1,39 @@
+{
+ "title": "Settings",
+ "subtitle": "Set up your account and your groups.",
+ "security": {
+ "title": "Security",
+ "description": "Password and passkeys"
+ },
+ "signOut": "Sign out",
+ "appearance": {
+ "title": "Appearance",
+ "description": "Light or dark theme",
+ "light": "Light",
+ "lightDescription": "Light interface",
+ "dark": "Dark",
+ "darkDescription": "Dark interface",
+ "system": "System",
+ "systemDescription": "Follows your device's setting"
+ },
+ "language": {
+ "title": "Language",
+ "description": "The app's language",
+ "system": "Device language",
+ "systemDescription": "Currently: {{language}}",
+ "saveError": "We couldn't save the language to your account"
+ },
+ "transfer": {
+ "title": "Bank transfer details",
+ "description": "Your students see them when they report a payment",
+ "alias": "Account or payment alias",
+ "aliasShort": "Account",
+ "holder": "Account holder",
+ "saved": "Bank transfer details saved",
+ "saveError": "We couldn't save the details"
+ },
+ "callback": {
+ "mpLinked": "Your Mercado Pago account is linked.",
+ "whatsappLinked": "Your WhatsApp is linked."
+ }
+}
diff --git a/apps/web/src/i18n/locales/en/validation.json b/apps/web/src/i18n/locales/en/validation.json
new file mode 100644
index 0000000..32db12b
--- /dev/null
+++ b/apps/web/src/i18n/locales/en/validation.json
@@ -0,0 +1,52 @@
+{
+ "zod": {
+ "required": "This field is required",
+ "invalidType": "This value isn't valid",
+ "invalid": "This value isn't valid",
+ "tooShort": "It's too short",
+ "tooLong": "It's too long",
+ "tooSmall": "The value is too low",
+ "tooBig": "The value is too high"
+ },
+ "email": {
+ "invalid": "Enter a valid email"
+ },
+ "phone": {
+ "invalid": "Enter a valid phone number"
+ },
+ "name": {
+ "required": "Name is required",
+ "enter": "Enter your name"
+ },
+ "password": {
+ "min": "The password must be at least 8 characters",
+ "mismatch": "The passwords don't match"
+ },
+ "update": {
+ "empty": "Send at least one field to update"
+ },
+ "group": {
+ "nameMin": "The name must be at least 3 characters",
+ "nameMax": "The name is too long (60 characters max)",
+ "daysMin": "Choose at least one class day",
+ "timeInvalid": "Choose a valid time (e.g. 09:00)",
+ "capacityInvalid": "Enter a valid capacity",
+ "capacityInt": "Capacity must be a whole number",
+ "capacityMin": "Capacity must be at least 1",
+ "priceInvalid": "Enter a valid price",
+ "priceMin": "The price can't be negative",
+ "dueDayInvalid": "Enter a valid day",
+ "dueDayInt": "The day must be a whole number",
+ "dueDayRange": "The due day must be between 1 and 28"
+ },
+ "whatsapp": {
+ "phoneRequired": "Enter your WhatsApp number",
+ "automationRequired": "Pick at least one automation"
+ },
+ "timezone": {
+ "invalid": "Invalid time zone"
+ },
+ "payment": {
+ "descriptionMax": "The description is too long"
+ }
+}
diff --git a/apps/web/src/i18n/locales/es-419/auth.json b/apps/web/src/i18n/locales/es-419/auth.json
new file mode 100644
index 0000000..83360aa
--- /dev/null
+++ b/apps/web/src/i18n/locales/es-419/auth.json
@@ -0,0 +1,65 @@
+{
+ "email": "Email",
+ "emailPlaceholder": "tu@ejemplo.com",
+ "password": "Contraseña",
+ "or": "o",
+ "continueWithGoogle": "Continuar con Google",
+ "backToLogin": "Volver a iniciar sesión",
+ "login": {
+ "title": "Iniciar sesión",
+ "subtitle": "Accede a tus cobros grupales",
+ "resetOk": "Tu contraseña se actualizó. Ingresa con la nueva.",
+ "forgot": "¿Olvidaste tu contraseña?",
+ "submit": "Ingresar",
+ "submitting": "Ingresando…",
+ "passkey": "Entrar con passkey",
+ "noAccount": "¿No tienes cuenta?",
+ "signUp": "Regístrate",
+ "error": "No se pudo iniciar sesión",
+ "passkeyError": "No se pudo autenticar con passkey"
+ },
+ "signup": {
+ "title": "Crear cuenta",
+ "subtitle": "Empieza a cobrar en grupo en minutos",
+ "name": "Nombre",
+ "namePlaceholder": "Nombre completo",
+ "passwordPlaceholder": "Mínimo 8 caracteres",
+ "confirmPassword": "Repite la contraseña",
+ "submit": "Crear cuenta",
+ "submitting": "Creando…",
+ "hasAccount": "¿Ya tienes cuenta?",
+ "signIn": "Inicia sesión",
+ "error": "No se pudo registrar"
+ },
+ "forgot": {
+ "title": "Recuperar contraseña",
+ "subtitle": "Te enviamos un enlace para elegir una nueva",
+ "submit": "Enviar enlace",
+ "submitting": "Enviando…",
+ "sentTitle": "Revisa tu email",
+ "sent": "Si hay una cuenta con {{email}} , te enviamos un enlace para elegir una nueva contraseña. Vence en 1 hora.",
+ "error": "No se pudo enviar el email"
+ },
+ "reset": {
+ "title": "Nueva contraseña",
+ "subtitle": "Elige una contraseña para tu cuenta",
+ "newPassword": "Nueva contraseña",
+ "confirmPassword": "Repetir contraseña",
+ "submit": "Guardar contraseña",
+ "submitting": "Guardando…",
+ "invalidTitle": "Enlace inválido",
+ "invalid": "El enlace para restablecer la contraseña no es válido o venció.",
+ "requestNew": "Pedir un enlace nuevo",
+ "error": "No se pudo cambiar la contraseña"
+ },
+ "verify": {
+ "title": "Verifica tu email",
+ "successTitle": "Email verificado",
+ "errorTitle": "Enlace inválido",
+ "success": "Tu cuenta quedó verificada. Te estamos llevando a Gruperly…",
+ "error": "El enlace de verificación no es válido o expiró.",
+ "sent": "Te enviamos un correo a {{email}} para confirmar tu cuenta.",
+ "goToApp": "Ir a Gruperly",
+ "tryLogin": "Intentar iniciar sesión"
+ }
+}
diff --git a/apps/web/src/i18n/locales/es-419/common.json b/apps/web/src/i18n/locales/es-419/common.json
new file mode 100644
index 0000000..082ed34
--- /dev/null
+++ b/apps/web/src/i18n/locales/es-419/common.json
@@ -0,0 +1,42 @@
+{
+ "actions": {
+ "cancel": "Cancelar",
+ "save": "Guardar",
+ "edit": "Editar",
+ "add": "Agregar",
+ "close": "Cerrar",
+ "back": "Volver",
+ "retry": "Reintentar"
+ },
+ "user": {
+ "fallbackName": "Usuario"
+ },
+ "toast": {
+ "close": "Cerrar notificación"
+ },
+ "weekDay": {
+ "MONDAY": "Lunes",
+ "TUESDAY": "Martes",
+ "WEDNESDAY": "Miércoles",
+ "THURSDAY": "Jueves",
+ "FRIDAY": "Viernes",
+ "SATURDAY": "Sábado",
+ "SUNDAY": "Domingo"
+ },
+ "billingType": {
+ "MONTHLY": "Mensual",
+ "PER_CLASS": "Por clase"
+ },
+ "paymentStatus": {
+ "PENDING": "Pendiente",
+ "PAID": "Pagado",
+ "OVERDUE": "Vencido",
+ "CANCELLED": "Cancelado"
+ },
+ "relativeDay": {
+ "today": "Hoy · {{time}}",
+ "tomorrow": "Mañana · {{time}}",
+ "other": "{{date}} · {{time}}"
+ },
+ "billingDueDay": "Vence el día {{day}} de cada mes"
+}
diff --git a/apps/web/src/i18n/locales/es-419/errors.json b/apps/web/src/i18n/locales/es-419/errors.json
new file mode 100644
index 0000000..b828e1f
--- /dev/null
+++ b/apps/web/src/i18n/locales/es-419/errors.json
@@ -0,0 +1,79 @@
+{
+ "generic": "Algo salió mal. Inténtalo de nuevo.",
+ "network": "No hay conexión. Revisa tu internet e inténtalo de nuevo.",
+ "status": {
+ "unauthorized": "Tu sesión venció. Vuelve a iniciar sesión.",
+ "forbidden": "No tienes permiso para hacer esto.",
+ "notFound": "No encontramos lo que buscabas.",
+ "tooManyRequests": "Hiciste muchas solicitudes seguidas. Inténtalo de nuevo en unos minutos.",
+ "server": "Tuvimos un problema. Inténtalo de nuevo en unos minutos."
+ },
+ "codes": {
+ "admin_required": "Solo el equipo de Gruperly puede entrar al backoffice.",
+ "already_waitlisted": "Este número de teléfono ya está en la lista de espera del grupo.",
+ "attendee_already_registered": "Esta persona ya es miembro de este grupo.",
+ "attendee_has_payments": "Este miembro tiene cobros asociados. Gestiona o cancela sus cobros antes de quitarlo del grupo.",
+ "attendee_same_group": "El miembro ya pertenece a este grupo.",
+ "billing_not_available": "La suscripción a Pro todavía no está disponible en tu país.",
+ "billing_provider_error": "No pudimos comunicarnos con el procesador de pagos. Inténtalo de nuevo en unos minutos.",
+ "class_already_started": "La clase ya empezó: el aviso solo se puede dar o deshacer antes.",
+ "cross_origin_request": "Origen no permitido.",
+ "database_unavailable": "Tuvimos un problema. Inténtalo de nuevo en unos minutos.",
+ "group_access_denied": "No tienes acceso a este grupo.",
+ "group_capacity_reached": "El grupo alcanzó su cupo máximo de miembros.",
+ "group_capacity_reached_one": "El grupo alcanzó su cupo máximo de {{count}} miembro.",
+ "group_capacity_reached_other": "El grupo alcanzó su cupo máximo de {{count}} miembros.",
+ "group_owner_required": "Solo quien creó el grupo puede cambiar sus automatizaciones.",
+ "group_without_price": "Define el precio del grupo antes de generar los cobros.",
+ "mp_account_in_use": "Esa cuenta de Mercado Pago ya está vinculada a otro profesor.",
+ "mp_not_configured": "La vinculación con Mercado Pago no está disponible en este momento.",
+ "mp_not_connected": "No tienes una cuenta de Mercado Pago vinculada.",
+ "mp_provider_error": "No pudimos completar la vinculación con Mercado Pago.",
+ "mp_requires_reauth": "Tu cuenta de Mercado Pago necesita volver a vincularse.",
+ "no_active_subscription": "No tienes una suscripción para cancelar.",
+ "no_attendees_to_bill": "No hay miembros activos con un cobro pendiente para este grupo.",
+ "onboarding_already_completed": "Ya completaste la configuración inicial de Gruperly.",
+ "passkey_invalid": "No pudimos verificar la llave de acceso.",
+ "payment_already_reported": "Ya informaste el pago de alguna de estas cuotas.",
+ "payment_report_already_reviewed": "Este pago ya fue revisado.",
+ "person_exists": "Ya tienes registrada a una persona con este número de teléfono.",
+ "person_phone_taken": "Otra persona que tienes registrada ya usa este número de teléfono.",
+ "plan_feature_required": "Esta función está disponible en el plan Pro.",
+ "plan_feature_required_mpCharges": "Cobrar con Mercado Pago está disponible en el plan Pro.",
+ "plan_feature_required_whatsappAutomations": "Los mensajes automáticos de WhatsApp están disponibles en el plan Pro.",
+ "plan_limit_reached": "Llegaste al límite del plan Free. Cámbiate a Pro para seguir creciendo.",
+ "plan_limit_reached_groups_one": "El plan Free permite hasta {{count}} grupo. Cámbiate a Pro para crear más.",
+ "plan_limit_reached_groups_other": "El plan Free permite hasta {{count}} grupos. Cámbiate a Pro para crear más.",
+ "plan_limit_reached_attendees_one": "El plan Free permite hasta {{count}} alumno activo. Cámbiate a Pro para sumar más.",
+ "plan_limit_reached_attendees_other": "El plan Free permite hasta {{count}} alumnos activos. Cámbiate a Pro para sumar más.",
+ "plan_not_selected": "Elige un plan antes de crear tu primer grupo.",
+ "plan_read_only": "Tu cuenta está en solo lectura porque superas los límites del plan Free. Cámbiate a Pro o reduce el uso para volver a editar.",
+ "pre_registration_already_reviewed": "Esta preinscripción ya fue revisada.",
+ "review_undo_expired": "Ya no se puede deshacer.",
+ "storage_not_available": "Por ahora no se pueden adjuntar comprobantes.",
+ "student_link_invalid": "Este enlace ya se usó o venció.",
+ "subscription_already_active": "Ya tienes una suscripción a Pro activa.",
+ "too_many_requests": "Hiciste muchas solicitudes seguidas. Inténtalo de nuevo en unos minutos.",
+ "unauthorized": "Tu sesión venció. Vuelve a iniciar sesión.",
+ "user_not_found": "Usuario no encontrado.",
+ "whatsapp_linking_not_started": "Empieza la vinculación de WhatsApp antes de pedir el código.",
+ "whatsapp_not_configured": "La vinculación con WhatsApp no está disponible en este momento.",
+ "whatsapp_not_connected": "No tienes un WhatsApp vinculado.",
+ "whatsapp_number_in_use": "Ese número de WhatsApp ya está vinculado a otro profesor.",
+ "whatsapp_pairing_not_ready": "WhatsApp todavía está preparando la vinculación. Inténtalo de nuevo en unos segundos.",
+ "whatsapp_pairing_unsupported": "Este proveedor de WhatsApp no permite vincular con el número de teléfono.",
+ "whatsapp_provider_error": "No pudimos comunicarnos con WhatsApp. Inténtalo de nuevo en unos minutos."
+ },
+ "auth": {
+ "INVALID_EMAIL_OR_PASSWORD": "El email o la contraseña no son correctos.",
+ "EMAIL_NOT_VERIFIED": "Todavía no verificaste tu email. Revisa tu correo.",
+ "USER_ALREADY_EXISTS": "Ya hay una cuenta con ese email.",
+ "USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL": "Ya hay una cuenta con ese email.",
+ "INVALID_EMAIL": "Ingresa un email válido.",
+ "PASSWORD_TOO_SHORT": "La contraseña debe tener al menos 8 caracteres.",
+ "PASSWORD_TOO_LONG": "La contraseña es demasiado larga.",
+ "INVALID_PASSWORD": "La contraseña actual no es correcta.",
+ "INVALID_TOKEN": "El enlace no es válido o venció.",
+ "TOO_MANY_REQUESTS": "Hiciste muchas solicitudes seguidas. Inténtalo de nuevo en unos minutos."
+ }
+}
diff --git a/apps/web/src/i18n/locales/es-419/layout.json b/apps/web/src/i18n/locales/es-419/layout.json
new file mode 100644
index 0000000..2926248
--- /dev/null
+++ b/apps/web/src/i18n/locales/es-419/layout.json
@@ -0,0 +1,26 @@
+{
+ "nav": {
+ "home": "Inicio",
+ "groups": "Grupos",
+ "payments": "Cobros",
+ "settings": "Ajustes",
+ "security": "Seguridad",
+ "profile": "Mi perfil"
+ },
+ "breadcrumb": "Ruta de navegación",
+ "homeLink": "Gruperly inicio",
+ "reportedPayments_one": "{{count}} pago por verificar",
+ "reportedPayments_other": "{{count}} pagos por verificar",
+ "theme": {
+ "toLight": "Cambiar a tema claro",
+ "toDark": "Cambiar a tema oscuro"
+ },
+ "userMenu": {
+ "close": "Cerrar menú",
+ "profile": "Mi perfil",
+ "settings": "Ajustes",
+ "admin": "Backoffice",
+ "signOut": "Cerrar sesión"
+ },
+ "publicFooter": "Gruperly — Gestión sencilla de cobros y grupos"
+}
diff --git a/apps/web/src/i18n/locales/es-419/pwa.json b/apps/web/src/i18n/locales/es-419/pwa.json
new file mode 100644
index 0000000..7f8d2ad
--- /dev/null
+++ b/apps/web/src/i18n/locales/es-419/pwa.json
@@ -0,0 +1,18 @@
+{
+ "banner": {
+ "title": "Instala Gruperly",
+ "description": "Ábrela directo desde tu pantalla de inicio, sin barra del navegador.",
+ "install": "Instalar app",
+ "later": "Ahora no",
+ "close": "Cerrar aviso de instalación"
+ },
+ "ios": {
+ "title": "Instala Gruperly en el iPhone",
+ "description": "Toca Compartir y elige Agregar a pantalla de inicio para abrirla como app."
+ },
+ "offlineReady": "La app quedó lista para abrirse sin conexión",
+ "offlineReadyDetail": "Ya puedes usar Gruperly sin conexión.",
+ "installed": "App instalada",
+ "installedDetail": "Ahora tienes Gruperly en tu pantalla de inicio.",
+ "installLater": "Puedes instalarla más adelante desde el menú del navegador."
+}
diff --git a/apps/web/src/i18n/locales/es-419/settings.json b/apps/web/src/i18n/locales/es-419/settings.json
new file mode 100644
index 0000000..c7f5104
--- /dev/null
+++ b/apps/web/src/i18n/locales/es-419/settings.json
@@ -0,0 +1,39 @@
+{
+ "title": "Ajustes",
+ "subtitle": "Configura tu cuenta y tus grupos.",
+ "security": {
+ "title": "Seguridad",
+ "description": "Contraseña y passkeys"
+ },
+ "signOut": "Cerrar sesión",
+ "appearance": {
+ "title": "Apariencia",
+ "description": "Tema claro u oscuro",
+ "light": "Claro",
+ "lightDescription": "Interfaz en tonos claros",
+ "dark": "Oscuro",
+ "darkDescription": "Interfaz en tonos oscuros",
+ "system": "Sistema",
+ "systemDescription": "Sigue la preferencia de tu dispositivo"
+ },
+ "language": {
+ "title": "Idioma",
+ "description": "El idioma de la app",
+ "system": "Idioma del dispositivo",
+ "systemDescription": "Ahora: {{language}}",
+ "saveError": "No pudimos guardar el idioma en tu cuenta"
+ },
+ "transfer": {
+ "title": "Datos para transferencias",
+ "description": "Tus alumnos los ven cuando informan un pago",
+ "alias": "Alias, CLABE o número de cuenta",
+ "aliasShort": "Cuenta",
+ "holder": "Titular",
+ "saved": "Datos para transferencias guardados",
+ "saveError": "No pudimos guardar los datos"
+ },
+ "callback": {
+ "mpLinked": "Tu cuenta de Mercado Pago quedó vinculada.",
+ "whatsappLinked": "Tu WhatsApp quedó vinculado."
+ }
+}
diff --git a/apps/web/src/i18n/locales/es-419/validation.json b/apps/web/src/i18n/locales/es-419/validation.json
new file mode 100644
index 0000000..f9ff72e
--- /dev/null
+++ b/apps/web/src/i18n/locales/es-419/validation.json
@@ -0,0 +1,52 @@
+{
+ "zod": {
+ "required": "Este campo es obligatorio",
+ "invalidType": "El valor no es válido",
+ "invalid": "El valor no es válido",
+ "tooShort": "Es demasiado corto",
+ "tooLong": "Es demasiado largo",
+ "tooSmall": "El valor es demasiado pequeño",
+ "tooBig": "El valor es demasiado grande"
+ },
+ "email": {
+ "invalid": "Ingresa un email válido"
+ },
+ "phone": {
+ "invalid": "Ingresa un número de teléfono válido"
+ },
+ "name": {
+ "required": "El nombre es obligatorio",
+ "enter": "Ingresa tu nombre"
+ },
+ "password": {
+ "min": "La contraseña debe tener al menos 8 caracteres",
+ "mismatch": "Las contraseñas no coinciden"
+ },
+ "update": {
+ "empty": "Envía al menos un campo para actualizar"
+ },
+ "group": {
+ "nameMin": "El nombre debe tener al menos 3 caracteres",
+ "nameMax": "El nombre es demasiado largo (máximo 60 caracteres)",
+ "daysMin": "Elige al menos un día de clase",
+ "timeInvalid": "Elige un horario válido (ej.: 09:00)",
+ "capacityInvalid": "Ingresa un cupo válido",
+ "capacityInt": "El cupo debe ser un número entero",
+ "capacityMin": "El cupo debe ser de al menos 1",
+ "priceInvalid": "Ingresa un precio válido",
+ "priceMin": "El precio no puede ser negativo",
+ "dueDayInvalid": "Ingresa un día válido",
+ "dueDayInt": "El día debe ser un número entero",
+ "dueDayRange": "El día de vencimiento debe estar entre 1 y 28"
+ },
+ "whatsapp": {
+ "phoneRequired": "Ingresa tu número de WhatsApp",
+ "automationRequired": "Indica al menos una automatización"
+ },
+ "timezone": {
+ "invalid": "Zona horaria inválida"
+ },
+ "payment": {
+ "descriptionMax": "La descripción es demasiado larga"
+ }
+}
diff --git a/apps/web/src/i18n/locales/es-AR/auth.json b/apps/web/src/i18n/locales/es-AR/auth.json
new file mode 100644
index 0000000..7eaf88a
--- /dev/null
+++ b/apps/web/src/i18n/locales/es-AR/auth.json
@@ -0,0 +1,65 @@
+{
+ "email": "Email",
+ "emailPlaceholder": "vos@ejemplo.com",
+ "password": "Contraseña",
+ "or": "o",
+ "continueWithGoogle": "Continuar con Google",
+ "backToLogin": "Volver a iniciar sesión",
+ "login": {
+ "title": "Iniciar sesión",
+ "subtitle": "Accedé a tus cobros grupales",
+ "resetOk": "Tu contraseña se actualizó. Ingresá con la nueva.",
+ "forgot": "¿Olvidaste tu contraseña?",
+ "submit": "Ingresar",
+ "submitting": "Ingresando…",
+ "passkey": "Entrar con passkey",
+ "noAccount": "¿No tenés cuenta?",
+ "signUp": "Registrate",
+ "error": "No se pudo iniciar sesión",
+ "passkeyError": "No se pudo autenticar con passkey"
+ },
+ "signup": {
+ "title": "Crear cuenta",
+ "subtitle": "Empezá a cobrar en grupo en minutos",
+ "name": "Nombre",
+ "namePlaceholder": "Nombre completo",
+ "passwordPlaceholder": "Mínimo 8 caracteres",
+ "confirmPassword": "Repetí la contraseña",
+ "submit": "Crear cuenta",
+ "submitting": "Creando…",
+ "hasAccount": "¿Ya tenés cuenta?",
+ "signIn": "Iniciá sesión",
+ "error": "No se pudo registrar"
+ },
+ "forgot": {
+ "title": "Recuperar contraseña",
+ "subtitle": "Te enviamos un enlace para elegir una nueva",
+ "submit": "Enviar enlace",
+ "submitting": "Enviando…",
+ "sentTitle": "Revisá tu email",
+ "sent": "Si hay una cuenta con {{email}} , te enviamos un enlace para elegir una nueva contraseña. Vence en 1 hora.",
+ "error": "No se pudo enviar el email"
+ },
+ "reset": {
+ "title": "Nueva contraseña",
+ "subtitle": "Elegí una contraseña para tu cuenta",
+ "newPassword": "Nueva contraseña",
+ "confirmPassword": "Repetir contraseña",
+ "submit": "Guardar contraseña",
+ "submitting": "Guardando…",
+ "invalidTitle": "Vínculo inválido",
+ "invalid": "El enlace para restablecer la contraseña no es válido o venció.",
+ "requestNew": "Pedir un enlace nuevo",
+ "error": "No se pudo cambiar la contraseña"
+ },
+ "verify": {
+ "title": "Verificá tu email",
+ "successTitle": "Email verificado",
+ "errorTitle": "Vínculo inválido",
+ "success": "Tu cuenta quedó verificada. Te estamos llevando a Gruperly…",
+ "error": "El vínculo de verificación no es válido o expiró.",
+ "sent": "Te enviamos un correo a {{email}} para confirmar tu cuenta.",
+ "goToApp": "Ir a Gruperly",
+ "tryLogin": "Intentar iniciar sesión"
+ }
+}
diff --git a/apps/web/src/i18n/locales/es-AR/common.json b/apps/web/src/i18n/locales/es-AR/common.json
new file mode 100644
index 0000000..082ed34
--- /dev/null
+++ b/apps/web/src/i18n/locales/es-AR/common.json
@@ -0,0 +1,42 @@
+{
+ "actions": {
+ "cancel": "Cancelar",
+ "save": "Guardar",
+ "edit": "Editar",
+ "add": "Agregar",
+ "close": "Cerrar",
+ "back": "Volver",
+ "retry": "Reintentar"
+ },
+ "user": {
+ "fallbackName": "Usuario"
+ },
+ "toast": {
+ "close": "Cerrar notificación"
+ },
+ "weekDay": {
+ "MONDAY": "Lunes",
+ "TUESDAY": "Martes",
+ "WEDNESDAY": "Miércoles",
+ "THURSDAY": "Jueves",
+ "FRIDAY": "Viernes",
+ "SATURDAY": "Sábado",
+ "SUNDAY": "Domingo"
+ },
+ "billingType": {
+ "MONTHLY": "Mensual",
+ "PER_CLASS": "Por clase"
+ },
+ "paymentStatus": {
+ "PENDING": "Pendiente",
+ "PAID": "Pagado",
+ "OVERDUE": "Vencido",
+ "CANCELLED": "Cancelado"
+ },
+ "relativeDay": {
+ "today": "Hoy · {{time}}",
+ "tomorrow": "Mañana · {{time}}",
+ "other": "{{date}} · {{time}}"
+ },
+ "billingDueDay": "Vence el día {{day}} de cada mes"
+}
diff --git a/apps/web/src/i18n/locales/es-AR/errors.json b/apps/web/src/i18n/locales/es-AR/errors.json
new file mode 100644
index 0000000..a6c87ae
--- /dev/null
+++ b/apps/web/src/i18n/locales/es-AR/errors.json
@@ -0,0 +1,79 @@
+{
+ "generic": "Algo salió mal. Probá de nuevo.",
+ "network": "No hay conexión. Revisá tu internet y probá de nuevo.",
+ "status": {
+ "unauthorized": "Tu sesión venció. Volvé a iniciar sesión.",
+ "forbidden": "No tenés permiso para hacer esto.",
+ "notFound": "No encontramos lo que buscabas.",
+ "tooManyRequests": "Hiciste muchos pedidos seguidos. Probá de nuevo en unos minutos.",
+ "server": "Tuvimos un problema. Probá de nuevo en unos minutos."
+ },
+ "codes": {
+ "admin_required": "Solo el equipo de Gruperly puede entrar al backoffice.",
+ "already_waitlisted": "Este número de teléfono ya está en la lista de espera del grupo.",
+ "attendee_already_registered": "Esta persona ya es miembro de este grupo.",
+ "attendee_has_payments": "Este miembro tiene cobros asociados. Gestioná o cancelá sus cobros antes de quitarlo del grupo.",
+ "attendee_same_group": "El miembro ya pertenece a este grupo.",
+ "billing_not_available": "La suscripción a Pro todavía no está disponible en tu país.",
+ "billing_provider_error": "No pudimos comunicarnos con el procesador de pagos. Intentá de nuevo en unos minutos.",
+ "class_already_started": "La clase ya empezó: el aviso solo se puede dar o deshacer antes.",
+ "cross_origin_request": "Origen no permitido.",
+ "database_unavailable": "Tuvimos un problema. Probá de nuevo en unos minutos.",
+ "group_access_denied": "No tenés acceso a este grupo.",
+ "group_capacity_reached": "El grupo alcanzó su cupo máximo de miembros.",
+ "group_capacity_reached_one": "El grupo alcanzó su cupo máximo de {{count}} miembro.",
+ "group_capacity_reached_other": "El grupo alcanzó su cupo máximo de {{count}} miembros.",
+ "group_owner_required": "Solo quien creó el grupo puede cambiar sus automatizaciones.",
+ "group_without_price": "Definí el precio del grupo antes de generar los cobros.",
+ "mp_account_in_use": "Esa cuenta de Mercado Pago ya está vinculada a otro profesor.",
+ "mp_not_configured": "La vinculación con Mercado Pago no está disponible en este momento.",
+ "mp_not_connected": "No tenés una cuenta de Mercado Pago vinculada.",
+ "mp_provider_error": "No pudimos completar la vinculación con Mercado Pago.",
+ "mp_requires_reauth": "Tu cuenta de Mercado Pago necesita volver a vincularse.",
+ "no_active_subscription": "No tenés una suscripción para cancelar.",
+ "no_attendees_to_bill": "No hay miembros activos con un cobro pendiente para este grupo.",
+ "onboarding_already_completed": "Ya completaste el onboarding de Gruperly.",
+ "passkey_invalid": "No pudimos verificar la llave de acceso.",
+ "payment_already_reported": "Ya informaste el pago de alguna de estas cuotas.",
+ "payment_report_already_reviewed": "Este pago ya fue revisado.",
+ "person_exists": "Ya tenés registrada a una persona con este número de teléfono.",
+ "person_phone_taken": "Otra persona que tenés registrada ya usa este número de teléfono.",
+ "plan_feature_required": "Esta función está disponible en el plan Pro.",
+ "plan_feature_required_mpCharges": "Cobrar con Mercado Pago está disponible en el plan Pro.",
+ "plan_feature_required_whatsappAutomations": "Los mensajes automáticos de WhatsApp están disponibles en el plan Pro.",
+ "plan_limit_reached": "Llegaste al límite del plan Free. Pasate a Pro para seguir creciendo.",
+ "plan_limit_reached_groups_one": "El plan Free permite hasta {{count}} grupo. Pasate a Pro para crear más.",
+ "plan_limit_reached_groups_other": "El plan Free permite hasta {{count}} grupos. Pasate a Pro para crear más.",
+ "plan_limit_reached_attendees_one": "El plan Free permite hasta {{count}} alumno activo. Pasate a Pro para sumar más.",
+ "plan_limit_reached_attendees_other": "El plan Free permite hasta {{count}} alumnos activos. Pasate a Pro para sumar más.",
+ "plan_not_selected": "Elegí un plan antes de crear tu primer grupo.",
+ "plan_read_only": "Tu cuenta está en solo lectura porque superás los límites del plan Free. Pasate a Pro o reducí el uso para volver a editar.",
+ "pre_registration_already_reviewed": "Esta pre-inscripción ya fue revisada.",
+ "review_undo_expired": "Ya no se puede deshacer.",
+ "storage_not_available": "Por ahora no se pueden adjuntar comprobantes.",
+ "student_link_invalid": "Este link ya fue usado o venció.",
+ "subscription_already_active": "Ya tenés una suscripción a Pro activa.",
+ "too_many_requests": "Hiciste muchos pedidos seguidos. Probá de nuevo en unos minutos.",
+ "unauthorized": "Tu sesión venció. Volvé a iniciar sesión.",
+ "user_not_found": "Usuario no encontrado.",
+ "whatsapp_linking_not_started": "Empezá la vinculación de WhatsApp antes de pedir el código.",
+ "whatsapp_not_configured": "La vinculación con WhatsApp no está disponible en este momento.",
+ "whatsapp_not_connected": "No tenés un WhatsApp vinculado.",
+ "whatsapp_number_in_use": "Ese número de WhatsApp ya está vinculado a otro profesor.",
+ "whatsapp_pairing_not_ready": "WhatsApp todavía está preparando la vinculación. Intentá de nuevo en unos segundos.",
+ "whatsapp_pairing_unsupported": "Este proveedor de WhatsApp no permite vincular con el número de teléfono.",
+ "whatsapp_provider_error": "No pudimos comunicarnos con WhatsApp. Intentá de nuevo en unos minutos."
+ },
+ "auth": {
+ "INVALID_EMAIL_OR_PASSWORD": "El email o la contraseña no son correctos.",
+ "EMAIL_NOT_VERIFIED": "Todavía no verificaste tu email. Revisá tu correo.",
+ "USER_ALREADY_EXISTS": "Ya hay una cuenta con ese email.",
+ "USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL": "Ya hay una cuenta con ese email.",
+ "INVALID_EMAIL": "Ingresá un email válido.",
+ "PASSWORD_TOO_SHORT": "La contraseña debe tener al menos 8 caracteres.",
+ "PASSWORD_TOO_LONG": "La contraseña es demasiado larga.",
+ "INVALID_PASSWORD": "La contraseña actual no es correcta.",
+ "INVALID_TOKEN": "El enlace no es válido o venció.",
+ "TOO_MANY_REQUESTS": "Hiciste muchos pedidos seguidos. Probá de nuevo en unos minutos."
+ }
+}
diff --git a/apps/web/src/i18n/locales/es-AR/layout.json b/apps/web/src/i18n/locales/es-AR/layout.json
new file mode 100644
index 0000000..77dac05
--- /dev/null
+++ b/apps/web/src/i18n/locales/es-AR/layout.json
@@ -0,0 +1,26 @@
+{
+ "nav": {
+ "home": "Inicio",
+ "groups": "Grupos",
+ "payments": "Cobros",
+ "settings": "Ajustes",
+ "security": "Seguridad",
+ "profile": "Mi perfil"
+ },
+ "breadcrumb": "Ruta de navegación",
+ "homeLink": "Gruperly inicio",
+ "reportedPayments_one": "{{count}} pago para verificar",
+ "reportedPayments_other": "{{count}} pagos para verificar",
+ "theme": {
+ "toLight": "Cambiar a tema claro",
+ "toDark": "Cambiar a tema oscuro"
+ },
+ "userMenu": {
+ "close": "Cerrar menú",
+ "profile": "Mi perfil",
+ "settings": "Ajustes",
+ "admin": "Backoffice",
+ "signOut": "Cerrar sesión"
+ },
+ "publicFooter": "Gruperly — Gestión sencilla de cobros y grupos"
+}
diff --git a/apps/web/src/i18n/locales/es-AR/pwa.json b/apps/web/src/i18n/locales/es-AR/pwa.json
new file mode 100644
index 0000000..6b59506
--- /dev/null
+++ b/apps/web/src/i18n/locales/es-AR/pwa.json
@@ -0,0 +1,18 @@
+{
+ "banner": {
+ "title": "Instalá Gruperly",
+ "description": "Abrila directo desde tu pantalla de inicio, sin barra de navegador.",
+ "install": "Instalar app",
+ "later": "Ahora no",
+ "close": "Cerrar aviso de instalación"
+ },
+ "ios": {
+ "title": "Instalá Gruperly en el iPhone",
+ "description": "Tocá Compartir y elegí Agregar a pantalla de inicio para abrirla como app."
+ },
+ "offlineReady": "La app quedó lista para abrirse sin conexión",
+ "offlineReadyDetail": "Ya podés usar Gruperly offline.",
+ "installed": "App instalada",
+ "installedDetail": "Ahora tenés Gruperly en tu pantalla de inicio.",
+ "installLater": "Podés instalarla más adelante desde el menú del navegador."
+}
diff --git a/apps/web/src/i18n/locales/es-AR/settings.json b/apps/web/src/i18n/locales/es-AR/settings.json
new file mode 100644
index 0000000..f9e59d8
--- /dev/null
+++ b/apps/web/src/i18n/locales/es-AR/settings.json
@@ -0,0 +1,39 @@
+{
+ "title": "Ajustes",
+ "subtitle": "Configurá tu cuenta y tus grupos.",
+ "security": {
+ "title": "Seguridad",
+ "description": "Contraseña y passkeys"
+ },
+ "signOut": "Cerrar sesión",
+ "appearance": {
+ "title": "Apariencia",
+ "description": "Tema claro u oscuro",
+ "light": "Claro",
+ "lightDescription": "Interfaz en tonos claros",
+ "dark": "Oscuro",
+ "darkDescription": "Interfaz en tonos oscuros",
+ "system": "Sistema",
+ "systemDescription": "Sigue la preferencia de tu dispositivo"
+ },
+ "language": {
+ "title": "Idioma",
+ "description": "El idioma de la app",
+ "system": "Idioma del dispositivo",
+ "systemDescription": "Ahora: {{language}}",
+ "saveError": "No pudimos guardar el idioma en tu cuenta"
+ },
+ "transfer": {
+ "title": "Datos para transferir",
+ "description": "Los ven tus alumnos cuando informan un pago",
+ "alias": "Alias o CBU/CVU",
+ "aliasShort": "Alias",
+ "holder": "Titular",
+ "saved": "Datos para transferir guardados",
+ "saveError": "No pudimos guardar los datos"
+ },
+ "callback": {
+ "mpLinked": "Tu cuenta de Mercado Pago quedó vinculada.",
+ "whatsappLinked": "Tu WhatsApp quedó vinculado."
+ }
+}
diff --git a/apps/web/src/i18n/locales/es-AR/validation.json b/apps/web/src/i18n/locales/es-AR/validation.json
new file mode 100644
index 0000000..46252c9
--- /dev/null
+++ b/apps/web/src/i18n/locales/es-AR/validation.json
@@ -0,0 +1,52 @@
+{
+ "zod": {
+ "required": "Este campo es obligatorio",
+ "invalidType": "El valor no es válido",
+ "invalid": "El valor no es válido",
+ "tooShort": "Es demasiado corto",
+ "tooLong": "Es demasiado largo",
+ "tooSmall": "El valor es demasiado chico",
+ "tooBig": "El valor es demasiado grande"
+ },
+ "email": {
+ "invalid": "Ingresá un email válido"
+ },
+ "phone": {
+ "invalid": "Ingresá un número de teléfono válido"
+ },
+ "name": {
+ "required": "El nombre es obligatorio",
+ "enter": "Ingresá tu nombre"
+ },
+ "password": {
+ "min": "La contraseña debe tener al menos 8 caracteres",
+ "mismatch": "Las contraseñas no coinciden"
+ },
+ "update": {
+ "empty": "Enviá al menos un campo para actualizar"
+ },
+ "group": {
+ "nameMin": "El nombre debe tener al menos 3 caracteres",
+ "nameMax": "El nombre es demasiado largo (máximo 60 caracteres)",
+ "daysMin": "Elegí al menos un día de clase",
+ "timeInvalid": "Elegí un horario válido (ej: 09:00)",
+ "capacityInvalid": "Ingresá un cupo válido",
+ "capacityInt": "El cupo debe ser un número entero",
+ "capacityMin": "El cupo debe ser al menos 1",
+ "priceInvalid": "Ingresá un precio válido",
+ "priceMin": "El precio no puede ser negativo",
+ "dueDayInvalid": "Ingresá un día válido",
+ "dueDayInt": "El día debe ser un número entero",
+ "dueDayRange": "El día de vencimiento debe estar entre 1 y 28"
+ },
+ "whatsapp": {
+ "phoneRequired": "Ingresá tu número de WhatsApp",
+ "automationRequired": "Indicá al menos una automatización"
+ },
+ "timezone": {
+ "invalid": "Zona horaria inválida"
+ },
+ "payment": {
+ "descriptionMax": "La descripción es demasiado larga"
+ }
+}
diff --git a/apps/web/src/i18n/locales/pt-BR/auth.json b/apps/web/src/i18n/locales/pt-BR/auth.json
new file mode 100644
index 0000000..d2b47c4
--- /dev/null
+++ b/apps/web/src/i18n/locales/pt-BR/auth.json
@@ -0,0 +1,65 @@
+{
+ "email": "E-mail",
+ "emailPlaceholder": "voce@exemplo.com",
+ "password": "Senha",
+ "or": "ou",
+ "continueWithGoogle": "Continuar com o Google",
+ "backToLogin": "Voltar para o login",
+ "login": {
+ "title": "Entrar",
+ "subtitle": "Acesse suas cobranças em grupo",
+ "resetOk": "Sua senha foi atualizada. Entre com a nova.",
+ "forgot": "Esqueceu sua senha?",
+ "submit": "Entrar",
+ "submitting": "Entrando…",
+ "passkey": "Entrar com passkey",
+ "noAccount": "Não tem uma conta?",
+ "signUp": "Cadastre-se",
+ "error": "Não foi possível entrar",
+ "passkeyError": "Não foi possível autenticar com a passkey"
+ },
+ "signup": {
+ "title": "Criar conta",
+ "subtitle": "Comece a cobrar seus grupos em minutos",
+ "name": "Nome",
+ "namePlaceholder": "Nome completo",
+ "passwordPlaceholder": "Mínimo de 8 caracteres",
+ "confirmPassword": "Repita a senha",
+ "submit": "Criar conta",
+ "submitting": "Criando…",
+ "hasAccount": "Já tem uma conta?",
+ "signIn": "Entre",
+ "error": "Não foi possível cadastrar"
+ },
+ "forgot": {
+ "title": "Recuperar senha",
+ "subtitle": "Enviamos um link para você escolher uma nova",
+ "submit": "Enviar link",
+ "submitting": "Enviando…",
+ "sentTitle": "Confira seu e-mail",
+ "sent": "Se houver uma conta com {{email}} , enviamos um link para escolher uma nova senha. Ele vence em 1 hora.",
+ "error": "Não foi possível enviar o e-mail"
+ },
+ "reset": {
+ "title": "Nova senha",
+ "subtitle": "Escolha uma senha para sua conta",
+ "newPassword": "Nova senha",
+ "confirmPassword": "Repetir senha",
+ "submit": "Salvar senha",
+ "submitting": "Salvando…",
+ "invalidTitle": "Link inválido",
+ "invalid": "O link para redefinir a senha não é válido ou expirou.",
+ "requestNew": "Pedir um novo link",
+ "error": "Não foi possível alterar a senha"
+ },
+ "verify": {
+ "title": "Confirme seu e-mail",
+ "successTitle": "E-mail confirmado",
+ "errorTitle": "Link inválido",
+ "success": "Sua conta foi confirmada. Estamos levando você ao Gruperly…",
+ "error": "O link de confirmação não é válido ou expirou.",
+ "sent": "Enviamos um e-mail para {{email}} para confirmar sua conta.",
+ "goToApp": "Ir para o Gruperly",
+ "tryLogin": "Tentar entrar"
+ }
+}
diff --git a/apps/web/src/i18n/locales/pt-BR/common.json b/apps/web/src/i18n/locales/pt-BR/common.json
new file mode 100644
index 0000000..d8f592f
--- /dev/null
+++ b/apps/web/src/i18n/locales/pt-BR/common.json
@@ -0,0 +1,42 @@
+{
+ "actions": {
+ "cancel": "Cancelar",
+ "save": "Salvar",
+ "edit": "Editar",
+ "add": "Adicionar",
+ "close": "Fechar",
+ "back": "Voltar",
+ "retry": "Tentar novamente"
+ },
+ "user": {
+ "fallbackName": "Usuário"
+ },
+ "toast": {
+ "close": "Fechar notificação"
+ },
+ "weekDay": {
+ "MONDAY": "Segunda-feira",
+ "TUESDAY": "Terça-feira",
+ "WEDNESDAY": "Quarta-feira",
+ "THURSDAY": "Quinta-feira",
+ "FRIDAY": "Sexta-feira",
+ "SATURDAY": "Sábado",
+ "SUNDAY": "Domingo"
+ },
+ "billingType": {
+ "MONTHLY": "Mensal",
+ "PER_CLASS": "Por aula"
+ },
+ "paymentStatus": {
+ "PENDING": "Pendente",
+ "PAID": "Pago",
+ "OVERDUE": "Vencido",
+ "CANCELLED": "Cancelado"
+ },
+ "relativeDay": {
+ "today": "Hoje · {{time}}",
+ "tomorrow": "Amanhã · {{time}}",
+ "other": "{{date}} · {{time}}"
+ },
+ "billingDueDay": "Vence todo dia {{day}}"
+}
diff --git a/apps/web/src/i18n/locales/pt-BR/errors.json b/apps/web/src/i18n/locales/pt-BR/errors.json
new file mode 100644
index 0000000..d6598d9
--- /dev/null
+++ b/apps/web/src/i18n/locales/pt-BR/errors.json
@@ -0,0 +1,79 @@
+{
+ "generic": "Algo deu errado. Tente novamente.",
+ "network": "Sem conexão. Verifique sua internet e tente novamente.",
+ "status": {
+ "unauthorized": "Sua sessão expirou. Entre novamente.",
+ "forbidden": "Você não tem permissão para fazer isso.",
+ "notFound": "Não encontramos o que você procurava.",
+ "tooManyRequests": "Você fez muitas solicitações seguidas. Tente novamente em alguns minutos.",
+ "server": "Tivemos um problema. Tente novamente em alguns minutos."
+ },
+ "codes": {
+ "admin_required": "Só a equipe do Gruperly pode acessar o backoffice.",
+ "already_waitlisted": "Este número de telefone já está na lista de espera do grupo.",
+ "attendee_already_registered": "Esta pessoa já é membro deste grupo.",
+ "attendee_has_payments": "Este membro tem cobranças associadas. Gerencie ou cancele as cobranças antes de removê-lo do grupo.",
+ "attendee_same_group": "O membro já faz parte deste grupo.",
+ "billing_not_available": "A assinatura Pro ainda não está disponível no seu país.",
+ "billing_provider_error": "Não conseguimos falar com o processador de pagamentos. Tente novamente em alguns minutos.",
+ "class_already_started": "A aula já começou: o aviso só pode ser dado ou desfeito antes.",
+ "cross_origin_request": "Origem não permitida.",
+ "database_unavailable": "Tivemos um problema. Tente novamente em alguns minutos.",
+ "group_access_denied": "Você não tem acesso a este grupo.",
+ "group_capacity_reached": "O grupo atingiu o limite máximo de membros.",
+ "group_capacity_reached_one": "O grupo atingiu o limite máximo de {{count}} membro.",
+ "group_capacity_reached_other": "O grupo atingiu o limite máximo de {{count}} membros.",
+ "group_owner_required": "Só quem criou o grupo pode mudar as automações.",
+ "group_without_price": "Defina o preço do grupo antes de gerar as cobranças.",
+ "mp_account_in_use": "Essa conta do Mercado Pago já está vinculada a outro professor.",
+ "mp_not_configured": "A vinculação com o Mercado Pago não está disponível no momento.",
+ "mp_not_connected": "Você não tem uma conta do Mercado Pago vinculada.",
+ "mp_provider_error": "Não conseguimos concluir a vinculação com o Mercado Pago.",
+ "mp_requires_reauth": "Sua conta do Mercado Pago precisa ser vinculada novamente.",
+ "no_active_subscription": "Você não tem uma assinatura para cancelar.",
+ "no_attendees_to_bill": "Não há membros ativos com cobrança pendente neste grupo.",
+ "onboarding_already_completed": "Você já concluiu a configuração inicial do Gruperly.",
+ "passkey_invalid": "Não conseguimos verificar a chave de acesso.",
+ "payment_already_reported": "Você já informou o pagamento de alguma dessas parcelas.",
+ "payment_report_already_reviewed": "Este pagamento já foi revisado.",
+ "person_exists": "Você já tem uma pessoa cadastrada com este número de telefone.",
+ "person_phone_taken": "Outra pessoa cadastrada já usa este número de telefone.",
+ "plan_feature_required": "Este recurso está disponível no plano Pro.",
+ "plan_feature_required_mpCharges": "Cobrar pelo Mercado Pago está disponível no plano Pro.",
+ "plan_feature_required_whatsappAutomations": "As mensagens automáticas de WhatsApp estão disponíveis no plano Pro.",
+ "plan_limit_reached": "Você atingiu o limite do plano Free. Mude para o Pro para continuar crescendo.",
+ "plan_limit_reached_groups_one": "O plano Free permite até {{count}} grupo. Mude para o Pro para criar mais.",
+ "plan_limit_reached_groups_other": "O plano Free permite até {{count}} grupos. Mude para o Pro para criar mais.",
+ "plan_limit_reached_attendees_one": "O plano Free permite até {{count}} aluno ativo. Mude para o Pro para adicionar mais.",
+ "plan_limit_reached_attendees_other": "O plano Free permite até {{count}} alunos ativos. Mude para o Pro para adicionar mais.",
+ "plan_not_selected": "Escolha um plano antes de criar seu primeiro grupo.",
+ "plan_read_only": "Sua conta está somente leitura porque ultrapassa os limites do plano Free. Mude para o Pro ou reduza o uso para voltar a editar.",
+ "pre_registration_already_reviewed": "Esta pré-inscrição já foi revisada.",
+ "review_undo_expired": "Não é mais possível desfazer.",
+ "storage_not_available": "Por enquanto não é possível anexar comprovantes.",
+ "student_link_invalid": "Este link já foi usado ou expirou.",
+ "subscription_already_active": "Você já tem uma assinatura Pro ativa.",
+ "too_many_requests": "Você fez muitas solicitações seguidas. Tente novamente em alguns minutos.",
+ "unauthorized": "Sua sessão expirou. Entre novamente.",
+ "user_not_found": "Usuário não encontrado.",
+ "whatsapp_linking_not_started": "Comece a vinculação do WhatsApp antes de pedir o código.",
+ "whatsapp_not_configured": "A vinculação com o WhatsApp não está disponível no momento.",
+ "whatsapp_not_connected": "Você não tem um WhatsApp vinculado.",
+ "whatsapp_number_in_use": "Esse número de WhatsApp já está vinculado a outro professor.",
+ "whatsapp_pairing_not_ready": "O WhatsApp ainda está preparando a vinculação. Tente novamente em alguns segundos.",
+ "whatsapp_pairing_unsupported": "Este provedor de WhatsApp não permite vincular pelo número de telefone.",
+ "whatsapp_provider_error": "Não conseguimos falar com o WhatsApp. Tente novamente em alguns minutos."
+ },
+ "auth": {
+ "INVALID_EMAIL_OR_PASSWORD": "E-mail ou senha incorretos.",
+ "EMAIL_NOT_VERIFIED": "Você ainda não confirmou seu e-mail. Confira sua caixa de entrada.",
+ "USER_ALREADY_EXISTS": "Já existe uma conta com esse e-mail.",
+ "USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL": "Já existe uma conta com esse e-mail.",
+ "INVALID_EMAIL": "Informe um e-mail válido.",
+ "PASSWORD_TOO_SHORT": "A senha deve ter pelo menos 8 caracteres.",
+ "PASSWORD_TOO_LONG": "A senha é muito longa.",
+ "INVALID_PASSWORD": "A senha atual não está correta.",
+ "INVALID_TOKEN": "O link não é válido ou expirou.",
+ "TOO_MANY_REQUESTS": "Você fez muitas solicitações seguidas. Tente novamente em alguns minutos."
+ }
+}
diff --git a/apps/web/src/i18n/locales/pt-BR/layout.json b/apps/web/src/i18n/locales/pt-BR/layout.json
new file mode 100644
index 0000000..4e71a37
--- /dev/null
+++ b/apps/web/src/i18n/locales/pt-BR/layout.json
@@ -0,0 +1,26 @@
+{
+ "nav": {
+ "home": "Início",
+ "groups": "Grupos",
+ "payments": "Cobranças",
+ "settings": "Ajustes",
+ "security": "Segurança",
+ "profile": "Meu perfil"
+ },
+ "breadcrumb": "Trilha de navegação",
+ "homeLink": "Início do Gruperly",
+ "reportedPayments_one": "{{count}} pagamento para verificar",
+ "reportedPayments_other": "{{count}} pagamentos para verificar",
+ "theme": {
+ "toLight": "Mudar para tema claro",
+ "toDark": "Mudar para tema escuro"
+ },
+ "userMenu": {
+ "close": "Fechar menu",
+ "profile": "Meu perfil",
+ "settings": "Ajustes",
+ "admin": "Backoffice",
+ "signOut": "Sair"
+ },
+ "publicFooter": "Gruperly — Gestão simples de cobranças e grupos"
+}
diff --git a/apps/web/src/i18n/locales/pt-BR/pwa.json b/apps/web/src/i18n/locales/pt-BR/pwa.json
new file mode 100644
index 0000000..f8790e3
--- /dev/null
+++ b/apps/web/src/i18n/locales/pt-BR/pwa.json
@@ -0,0 +1,18 @@
+{
+ "banner": {
+ "title": "Instale o Gruperly",
+ "description": "Abra direto da sua tela inicial, sem a barra do navegador.",
+ "install": "Instalar app",
+ "later": "Agora não",
+ "close": "Fechar aviso de instalação"
+ },
+ "ios": {
+ "title": "Instale o Gruperly no iPhone",
+ "description": "Toque em Compartilhar e escolha Adicionar à Tela de Início para abrir como app."
+ },
+ "offlineReady": "O app está pronto para abrir sem conexão",
+ "offlineReadyDetail": "Agora você pode usar o Gruperly offline.",
+ "installed": "App instalado",
+ "installedDetail": "Agora o Gruperly está na sua tela inicial.",
+ "installLater": "Você pode instalar mais tarde pelo menu do navegador."
+}
diff --git a/apps/web/src/i18n/locales/pt-BR/settings.json b/apps/web/src/i18n/locales/pt-BR/settings.json
new file mode 100644
index 0000000..bd99b83
--- /dev/null
+++ b/apps/web/src/i18n/locales/pt-BR/settings.json
@@ -0,0 +1,39 @@
+{
+ "title": "Ajustes",
+ "subtitle": "Configure sua conta e seus grupos.",
+ "security": {
+ "title": "Segurança",
+ "description": "Senha e passkeys"
+ },
+ "signOut": "Sair",
+ "appearance": {
+ "title": "Aparência",
+ "description": "Tema claro ou escuro",
+ "light": "Claro",
+ "lightDescription": "Interface em tons claros",
+ "dark": "Escuro",
+ "darkDescription": "Interface em tons escuros",
+ "system": "Sistema",
+ "systemDescription": "Segue a preferência do seu dispositivo"
+ },
+ "language": {
+ "title": "Idioma",
+ "description": "O idioma do app",
+ "system": "Idioma do dispositivo",
+ "systemDescription": "Agora: {{language}}",
+ "saveError": "Não conseguimos salvar o idioma na sua conta"
+ },
+ "transfer": {
+ "title": "Dados para transferência",
+ "description": "Seus alunos veem esses dados ao informar um pagamento",
+ "alias": "Chave Pix ou dados bancários",
+ "aliasShort": "Chave",
+ "holder": "Titular",
+ "saved": "Dados para transferência salvos",
+ "saveError": "Não conseguimos salvar os dados"
+ },
+ "callback": {
+ "mpLinked": "Sua conta do Mercado Pago foi vinculada.",
+ "whatsappLinked": "Seu WhatsApp foi vinculado."
+ }
+}
diff --git a/apps/web/src/i18n/locales/pt-BR/validation.json b/apps/web/src/i18n/locales/pt-BR/validation.json
new file mode 100644
index 0000000..84ff49e
--- /dev/null
+++ b/apps/web/src/i18n/locales/pt-BR/validation.json
@@ -0,0 +1,52 @@
+{
+ "zod": {
+ "required": "Este campo é obrigatório",
+ "invalidType": "O valor não é válido",
+ "invalid": "O valor não é válido",
+ "tooShort": "É muito curto",
+ "tooLong": "É muito longo",
+ "tooSmall": "O valor é muito baixo",
+ "tooBig": "O valor é muito alto"
+ },
+ "email": {
+ "invalid": "Informe um e-mail válido"
+ },
+ "phone": {
+ "invalid": "Informe um número de telefone válido"
+ },
+ "name": {
+ "required": "O nome é obrigatório",
+ "enter": "Informe seu nome"
+ },
+ "password": {
+ "min": "A senha deve ter pelo menos 8 caracteres",
+ "mismatch": "As senhas não coincidem"
+ },
+ "update": {
+ "empty": "Envie pelo menos um campo para atualizar"
+ },
+ "group": {
+ "nameMin": "O nome deve ter pelo menos 3 caracteres",
+ "nameMax": "O nome é muito longo (máximo de 60 caracteres)",
+ "daysMin": "Escolha pelo menos um dia de aula",
+ "timeInvalid": "Escolha um horário válido (ex.: 09:00)",
+ "capacityInvalid": "Informe um número de vagas válido",
+ "capacityInt": "O número de vagas deve ser inteiro",
+ "capacityMin": "O grupo deve ter pelo menos 1 vaga",
+ "priceInvalid": "Informe um preço válido",
+ "priceMin": "O preço não pode ser negativo",
+ "dueDayInvalid": "Informe um dia válido",
+ "dueDayInt": "O dia deve ser um número inteiro",
+ "dueDayRange": "O dia de vencimento deve estar entre 1 e 28"
+ },
+ "whatsapp": {
+ "phoneRequired": "Informe seu número de WhatsApp",
+ "automationRequired": "Indique pelo menos uma automação"
+ },
+ "timezone": {
+ "invalid": "Fuso horário inválido"
+ },
+ "payment": {
+ "descriptionMax": "A descrição é muito longa"
+ }
+}
diff --git a/apps/web/src/i18n/preference.ts b/apps/web/src/i18n/preference.ts
new file mode 100644
index 0000000..d5d74b9
--- /dev/null
+++ b/apps/web/src/i18n/preference.ts
@@ -0,0 +1,35 @@
+import { appLocaleSchema, resolveLocale, type AppLocale } from '@gruperly/shared'
+
+/** 'system' sigue los idiomas del dispositivo; si no, el idioma elegido. */
+export type LocalePreference = 'system' | AppLocale
+
+const STORAGE_KEY = 'locale'
+
+export function readStoredPreference(): LocalePreference {
+ try {
+ const value = localStorage.getItem(STORAGE_KEY)
+ if (value === 'system') return 'system'
+ const parsed = appLocaleSchema.safeParse(value)
+ return parsed.success ? parsed.data : 'system'
+ } catch {
+ return 'system'
+ }
+}
+
+export function storePreference(preference: LocalePreference): void {
+ try {
+ localStorage.setItem(STORAGE_KEY, preference)
+ } catch {
+ // Modo privado o storage bloqueado: la elección dura hasta recargar.
+ }
+}
+
+export function deviceLocale(): AppLocale {
+ const nav = globalThis.navigator
+ const tags = nav?.languages?.length ? nav.languages : nav?.language ? [nav.language] : []
+ return resolveLocale(tags)
+}
+
+export function localeFor(preference: LocalePreference): AppLocale {
+ return preference === 'system' ? deviceLocale() : preference
+}
diff --git a/apps/web/src/i18n/useIntlLocale.ts b/apps/web/src/i18n/useIntlLocale.ts
new file mode 100644
index 0000000..8e480aa
--- /dev/null
+++ b/apps/web/src/i18n/useIntlLocale.ts
@@ -0,0 +1,8 @@
+import { useLocale } from './I18nProvider'
+
+/** Tag para `Intl` / `toLocale*`: las fechas y los nombres de días y meses van
+ * en el idioma de la UI. Los montos y teléfonos NO: siguen al país (ver
+ * lib/region.ts). */
+export function useIntlLocale(): string {
+ return useLocale().locale
+}
diff --git a/apps/web/src/i18n/validation.ts b/apps/web/src/i18n/validation.ts
new file mode 100644
index 0000000..8465e8e
--- /dev/null
+++ b/apps/web/src/i18n/validation.ts
@@ -0,0 +1,45 @@
+import { z } from 'zod'
+import { i18n } from './instance'
+
+const KEY_PATTERN = /^[a-zA-Z][\w]*(\.[\w]+)+$/
+
+/**
+ * Traduce un mensaje de validación. Los esquemas (los de `@gruperly/shared` y
+ * los de la web) llevan claves estables (`group.nameMin`) en vez de texto; un
+ * mensaje que no es una clave conocida se muestra tal cual.
+ */
+export function validationMessage(message: string | undefined | null): string | undefined {
+ if (!message) return undefined
+ if (KEY_PATTERN.test(message) && i18n.exists(message, { ns: 'validation' })) {
+ return i18n.t(message as never, { ns: 'validation' })
+ }
+ return message
+}
+
+/** Mensajes por defecto de Zod (cuando el esquema no trae uno propio) en el
+ * idioma de la UI. Devuelve claves: `validationMessage` las traduce al pintar,
+ * así un cambio de idioma con el form abierto también se refleja. */
+const errorMap: z.ZodErrorMap = (issue, ctx) => {
+ switch (issue.code) {
+ case z.ZodIssueCode.invalid_type:
+ return {
+ message:
+ issue.received === 'undefined' || issue.received === 'null' ? 'zod.required' : 'zod.invalidType',
+ }
+ case z.ZodIssueCode.too_small:
+ if (issue.type === 'string') return { message: Number(issue.minimum) <= 1 ? 'zod.required' : 'zod.tooShort' }
+ return { message: 'zod.tooSmall' }
+ case z.ZodIssueCode.too_big:
+ return { message: issue.type === 'string' ? 'zod.tooLong' : 'zod.tooBig' }
+ case z.ZodIssueCode.invalid_string:
+ return { message: issue.validation === 'email' ? 'email.invalid' : 'zod.invalid' }
+ case z.ZodIssueCode.invalid_enum_value:
+ return { message: 'zod.invalid' }
+ default:
+ return { message: ctx.defaultError }
+ }
+}
+
+export function installZodErrorMap() {
+ z.setErrorMap(errorMap)
+}
diff --git a/apps/web/src/lib/auth-client.ts b/apps/web/src/lib/auth-client.ts
index bf1fe77..44df9df 100644
--- a/apps/web/src/lib/auth-client.ts
+++ b/apps/web/src/lib/auth-client.ts
@@ -1,11 +1,18 @@
import { createAuthClient } from 'better-auth/react'
-import { organizationClient } from 'better-auth/client/plugins'
+import { inferAdditionalFields, organizationClient } from 'better-auth/client/plugins'
import { passkeyClient } from '@better-auth/passkey/client'
export const authClient = createAuthClient({
baseURL: import.meta.env.VITE_API_URL ?? 'http://localhost:4000',
basePath: '/api/v1/auth',
- plugins: [organizationClient(), passkeyClient()],
+ plugins: [
+ organizationClient(),
+ passkeyClient(),
+ // Debe coincidir con `user.additionalFields` del backend (modules/auth/auth.ts).
+ inferAdditionalFields({
+ user: { locale: { type: 'string', required: false } },
+ }),
+ ],
})
export const {
diff --git a/apps/web/src/lib/format.ts b/apps/web/src/lib/format.ts
index 063f913..f365c9b 100644
--- a/apps/web/src/lib/format.ts
+++ b/apps/web/src/lib/format.ts
@@ -1,27 +1,31 @@
import type { BillingType, PaymentDto, WeekDay } from '@gruperly/shared'
+import { i18n } from '../i18n/instance'
import { countryOf, currencyForRegion, localeForRegion } from './region'
-export const WEEK_DAY_FULL_LABELS: Record = {
- MONDAY: 'Lunes',
- TUESDAY: 'Martes',
- WEDNESDAY: 'Miércoles',
- THURSDAY: 'Jueves',
- FRIDAY: 'Viernes',
- SATURDAY: 'Sábado',
- SUNDAY: 'Domingo',
+const WEEK_DAY_ORDER: WeekDay[] = [
+ 'MONDAY',
+ 'TUESDAY',
+ 'WEDNESDAY',
+ 'THURSDAY',
+ 'FRIDAY',
+ 'SATURDAY',
+ 'SUNDAY',
+]
+
+/* Labels in the UI language. They read the i18n instance on every call, so a
+ component that renders them follows a language change as soon as it
+ re-renders (the layouts subscribe to the language for that). */
+export function weekDayLabel(day: WeekDay): string {
+ return i18n.t(`common:weekDay.${day}`)
}
-export const BILLING_LABELS: Record = {
- MONTHLY: 'Mensual',
- PER_CLASS: 'Por clase',
+export function billingTypeLabel(type: BillingType): string {
+ return i18n.t(`common:billingType.${type}`)
}
-export const PAYMENT_STATUS_LABELS: Record = {
- PENDING: 'Pendiente',
- PAID: 'Pagado',
- OVERDUE: 'Vencido',
- CANCELLED: 'Cancelado',
+export function paymentStatusLabel(status: PaymentDto['status']): string {
+ return i18n.t(`common:paymentStatus.${status}`)
}
const DAY_MS = 86_400_000
@@ -31,23 +35,22 @@ function startOfDay(date: Date): number {
}
export function formatRelativeDateTime(iso: string, now: Date = new Date()): string {
+ const locale = i18n.language
const date = new Date(iso)
- const time = date.toLocaleTimeString('es-MX', {
+ const time = date.toLocaleTimeString(locale, {
hour: '2-digit',
minute: '2-digit',
hour12: false,
})
const diffDays = Math.round((startOfDay(date) - startOfDay(now)) / DAY_MS)
- if (diffDays === 0) return `Hoy · ${time}`
- if (diffDays === 1) return `Mañana · ${time}`
+ if (diffDays === 0) return i18n.t('common:relativeDay.today', { time })
+ if (diffDays === 1) return i18n.t('common:relativeDay.tomorrow', { time })
- const label = date.toLocaleDateString('es-MX', { weekday: 'short', day: 'numeric', month: 'short' })
- return `${label} · ${time}`
+ const label = date.toLocaleDateString(locale, { weekday: 'short', day: 'numeric', month: 'short' })
+ return i18n.t('common:relativeDay.other', { date: label, time })
}
-const WEEK_DAY_ORDER = Object.keys(WEEK_DAY_FULL_LABELS) as WeekDay[]
-
/** Days in calendar order (Monday first). The form stores them in the order
* they were tapped, so "Jue, Vie, Mié" could reach the screen as-is. */
export function sortWeekDays(days: readonly WeekDay[]): WeekDay[] {
@@ -55,7 +58,7 @@ export function sortWeekDays(days: readonly WeekDay[]): WeekDay[] {
}
export function formatSchedule(days: readonly WeekDay[], time: string | null): string {
- const dayNames = sortWeekDays(days).map((day) => WEEK_DAY_FULL_LABELS[day])
+ const dayNames = sortWeekDays(days).map(weekDayLabel)
return time ? `${dayNames.join(', ')} · ${time}` : dayNames.join(', ')
}
@@ -273,14 +276,15 @@ function formatMxNational(digits: string, withCountry: boolean): string | null {
}
// The due date is worded as a phrase ("Vence el día 10 de cada mes") instead of
-// "Vence día 10": it reads as a promise, not as a bare fact.
+// "Vence día 10": it reads as a promise, not as a bare fact. Each language
+// keeps that same tone.
export function formatBillingMeta(
billingType: BillingType | null,
dueDay: number | null,
): string | null {
- if (billingType === 'PER_CLASS') return BILLING_LABELS.PER_CLASS
+ if (billingType === 'PER_CLASS') return billingTypeLabel('PER_CLASS')
if (billingType === 'MONTHLY') {
- return dueDay ? `Vence el día ${dueDay} de cada mes` : BILLING_LABELS.MONTHLY
+ return dueDay ? i18n.t('common:billingDueDay', { day: dueDay }) : billingTypeLabel('MONTHLY')
}
return null
}
diff --git a/apps/web/src/main.tsx b/apps/web/src/main.tsx
index 309f430..4047856 100644
--- a/apps/web/src/main.tsx
+++ b/apps/web/src/main.tsx
@@ -8,6 +8,8 @@ import { ThemeProvider } from './context/ThemeProvider'
import { ToastProvider } from './components/ui'
import { isPlanProblem, showPlanPrompt } from './features/billing'
import { PwaProvider } from './features/pwa'
+import { activateLocale, errorMessage, I18nProvider, initialLocale, installZodErrorMap } from './i18n'
+import { LocaleProfileSync } from './i18n/LocaleProfileSync'
import './index.css'
const queryClient = new QueryClient({
@@ -17,7 +19,7 @@ const queryClient = new QueryClient({
mutationCache: new MutationCache({
onError: (error) => {
if (isPlanProblem(error)) {
- showPlanPrompt(error.problem?.detail ?? 'Esta función está disponible en el plan Pro.')
+ showPlanPrompt(errorMessage(error))
}
},
}),
@@ -26,18 +28,30 @@ const queryClient = new QueryClient({
},
})
-ReactDOM.createRoot(document.getElementById('root')!).render(
-
-
-
-
-
-
-
-
-
-
-
-
- ,
-)
\ No newline at end of file
+installZodErrorMap()
+
+// El idioma inicial se carga antes del primer render: así no se ve un flash en
+// otro idioma. Si falla la carga (offline sin precache), se renderiza igual con
+// las claves que haya.
+void activateLocale(initialLocale())
+ .catch(() => undefined)
+ .then(() => {
+ ReactDOM.createRoot(document.getElementById('root')!).render(
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ,
+ )
+ })
diff --git a/apps/web/test/i18n-keys.test.ts b/apps/web/test/i18n-keys.test.ts
new file mode 100644
index 0000000..1958adc
--- /dev/null
+++ b/apps/web/test/i18n-keys.test.ts
@@ -0,0 +1,69 @@
+import { describe, expect, test } from 'bun:test'
+import { readdirSync, readFileSync } from 'node:fs'
+import { join } from 'node:path'
+import { SUPPORTED_LOCALES } from '@gruperly/shared'
+import { NAMESPACES } from '../src/i18n/instance'
+
+/* es-AR es la fuente. Cada idioma tiene que tener exactamente las mismas claves
+ (salvo las formas de plural, que dependen del idioma), sin textos vacíos y
+ con las mismas variables de interpolación. */
+const root = join(import.meta.dir, '../src/i18n/locales')
+const SOURCE = 'es-AR'
+const PLURAL_SUFFIX = /_(zero|one|two|few|many|other)$/
+
+type Tree = { [key: string]: string | Tree }
+
+function load(locale: string, ns: string): Tree {
+ return JSON.parse(readFileSync(join(root, locale, `${ns}.json`), 'utf8')) as Tree
+}
+
+function flatten(tree: Tree, prefix = ''): Map {
+ const out = new Map()
+ for (const [key, value] of Object.entries(tree)) {
+ const path = prefix ? `${prefix}.${key}` : key
+ if (typeof value === 'string') out.set(path, value)
+ else for (const [k, v] of flatten(value, path)) out.set(k, v)
+ }
+ return out
+}
+
+/** Claves sin el sufijo de plural: `a_one` y `a_other` cuentan como `a`. */
+function baseKeys(flat: Map): Set {
+ return new Set([...flat.keys()].map((key) => key.replace(PLURAL_SUFFIX, '')))
+}
+
+function variables(text: string): string[] {
+ return [...text.matchAll(/\{\{\s*(\w+)\s*\}\}/g)].map((m) => m[1]!).sort()
+}
+
+function variablesByBase(flat: Map): Map {
+ const out = new Map>()
+ for (const [key, text] of flat) {
+ const base = key.replace(PLURAL_SUFFIX, '')
+ const set = out.get(base) ?? new Set()
+ for (const v of variables(text)) set.add(v)
+ out.set(base, set)
+ }
+ return new Map([...out].map(([k, v]) => [k, [...v].sort().join(',')]))
+}
+
+describe('traducciones', () => {
+ test('cada namespace declarado tiene su JSON en todos los idiomas', () => {
+ for (const locale of SUPPORTED_LOCALES) {
+ const files = readdirSync(join(root, locale)).filter((f) => f.endsWith('.json'))
+ expect(files.map((f) => f.slice(0, -5)).sort()).toEqual([...NAMESPACES].sort())
+ }
+ })
+
+ for (const ns of NAMESPACES) {
+ const source = flatten(load(SOURCE, ns))
+ for (const locale of SUPPORTED_LOCALES.filter((l) => l !== SOURCE)) {
+ test(`${locale}/${ns} tiene las mismas claves y variables que ${SOURCE}`, () => {
+ const target = flatten(load(locale, ns))
+ expect([...baseKeys(target)].sort()).toEqual([...baseKeys(source)].sort())
+ expect(Object.fromEntries(variablesByBase(target))).toEqual(Object.fromEntries(variablesByBase(source)))
+ for (const [key, text] of target) expect({ key, empty: text.trim() === '' }).toEqual({ key, empty: false })
+ })
+ }
+ }
+})
diff --git a/apps/web/test/resolve-locale.test.ts b/apps/web/test/resolve-locale.test.ts
new file mode 100644
index 0000000..752f6f5
--- /dev/null
+++ b/apps/web/test/resolve-locale.test.ts
@@ -0,0 +1,39 @@
+import { describe, expect, test } from 'bun:test'
+import { matchLocale, resolveLocale } from '@gruperly/shared'
+
+describe('resolveLocale', () => {
+ test('rioplatense para Argentina y Uruguay', () => {
+ expect(resolveLocale(['es-AR'])).toBe('es-AR')
+ expect(resolveLocale(['es-UY'])).toBe('es-AR')
+ expect(resolveLocale(['es_AR'])).toBe('es-AR')
+ })
+
+ test('cualquier otro español es latinoamericano', () => {
+ expect(resolveLocale(['es'])).toBe('es-419')
+ expect(resolveLocale(['es-MX'])).toBe('es-419')
+ expect(resolveLocale(['es-419'])).toBe('es-419')
+ expect(resolveLocale(['es-ES'])).toBe('es-419')
+ })
+
+ test('todo portugués va a pt-BR', () => {
+ expect(resolveLocale(['pt-BR'])).toBe('pt-BR')
+ expect(resolveLocale(['pt-PT'])).toBe('pt-BR')
+ expect(resolveLocale(['pt'])).toBe('pt-BR')
+ })
+
+ test('inglés y fallback', () => {
+ expect(resolveLocale(['en-US'])).toBe('en')
+ expect(resolveLocale(['fr-FR'])).toBe('en')
+ expect(resolveLocale([])).toBe('en')
+ })
+
+ test('respeta el orden de preferencia del dispositivo', () => {
+ expect(resolveLocale(['fr-FR', 'pt-BR', 'en'])).toBe('pt-BR')
+ expect(resolveLocale(['de', 'it'])).toBe('en')
+ })
+
+ test('matchLocale no inventa idiomas', () => {
+ expect(matchLocale('de-DE')).toBeNull()
+ expect(matchLocale('')).toBeNull()
+ })
+})
diff --git a/apps/web/test/setup.ts b/apps/web/test/setup.ts
new file mode 100644
index 0000000..c358d4d
--- /dev/null
+++ b/apps/web/test/setup.ts
@@ -0,0 +1,14 @@
+import { readdirSync, readFileSync } from 'node:fs'
+import { join } from 'node:path'
+import { i18n } from '../src/i18n/instance'
+
+/* En los tests no hay `import.meta.glob` (es de Vite): se cargan los JSON de
+ es-AR del disco y se activa ese idioma, así el copy sale como en producción
+ para quien tiene la UI en rioplatense. */
+const dir = join(import.meta.dir, '../src/i18n/locales/es-AR')
+for (const file of readdirSync(dir)) {
+ if (!file.endsWith('.json')) continue
+ const ns = file.slice(0, -'.json'.length)
+ i18n.addResourceBundle('es-AR', ns, JSON.parse(readFileSync(join(dir, file), 'utf8')), true, true)
+}
+await i18n.changeLanguage('es-AR')
diff --git a/bun.lock b/bun.lock
index 13140b4..18775cd 100644
--- a/bun.lock
+++ b/bun.lock
@@ -50,10 +50,12 @@
"@tanstack/react-router": "^1.170.38",
"better-auth": "1.7.2",
"clsx": "^2.1.1",
+ "i18next": "^26.5.11",
"lucide-react": "^1.34.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-hook-form": "^7.54.0",
+ "react-i18next": "^17.1.9",
"tailwind-merge": "^3.6.0",
"zod": "3.24.2",
},
@@ -1012,6 +1014,10 @@
"hono": ["hono@4.13.7", "", {}, "sha512-c8/gF9ac8Y78/agExVocyLevgR+JlpNB444Py0FSX8pJoPdYUfUzRcXtYEYGwt6l19qIlVZPN5Mfsw9jFShmQQ=="],
+ "html-parse-stringify": ["html-parse-stringify@4.0.1", "", {}, "sha512-0zHsZJrK7S3K2aucXWL6ycoYJ/iNtIcFHC/nYQgFklPtrv5LpJctIiSCroWZWeuoXvuyFdzp6KzjJQ+OT5MfFw=="],
+
+ "i18next": ["i18next@26.5.11", "", { "peerDependencies": { "typescript": "^5 || ^6 || ^7" }, "optionalPeers": ["typescript"] }, "sha512-Wc0klBPKxqZ2tL2qdAnF8xvvnWgr1IMGSY2ikTiAvaFVbz7xiFARtkoU4RidBDw1SyziGROp0qxu6qnJ7l2Wug=="],
+
"iconv-lite": ["iconv-lite@0.7.3", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" } }, "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ=="],
"idb": ["idb@7.1.1", "", {}, "sha512-gchesWBzyvGHRO9W8tzUWFDycow5gwjvFKfyV9FF32Y7F50yZMp7mP+T2mJIWFx49zicqyC4uefHM17o6xKIVQ=="],
@@ -1266,6 +1272,8 @@
"react-hook-form": ["react-hook-form@7.87.0", "", { "peerDependencies": { "react": "^16.8.0 || ^17 || ^18 || ^19" } }, "sha512-zhFzWvLxNHH+8839OnZcUxgMZw88ah2jZWDWvKWgF3Tpbnd0vKL+dlcuU3nZVWESZQjd81EW8K+wU+cYfYAc0w=="],
+ "react-i18next": ["react-i18next@17.1.9", "", { "dependencies": { "@babel/runtime": "^7.29.7", "html-parse-stringify": "^4.0.1", "use-sync-external-store": "^1.6.0" }, "peerDependencies": { "i18next": ">= 26.2.0", "react": ">= 16.8.0", "react-dom": "*", "react-native": "*", "typescript": "^5 || ^6 || ^7" }, "optionalPeers": ["react-dom", "react-native", "typescript"] }, "sha512-OgYqIH13XHPlWTaaI795Dz+k2AdKnXcOxNQVnf750T8Ij0TYWp1nYvXRpoJBulPqlyk2OAbn1PM4tFKiIj/byA=="],
+
"react-refresh": ["react-refresh@0.17.0", "", {}, "sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ=="],
"readdirp": ["readdirp@5.1.1", "", {}, "sha512-Kko+Y5XQ6fM+Ce3dq3m9YGxnacYZYl9cA1wZjaF3Vbry2L3i1qVg8+CAgNPsXRArPMUMCaOR7oa9Nqntc43JKA=="],
diff --git a/packages/shared/src/index.ts b/packages/shared/src/index.ts
index 306905c..52a1243 100644
--- a/packages/shared/src/index.ts
+++ b/packages/shared/src/index.ts
@@ -14,6 +14,7 @@ export * from './schemas/enums.js';
export * from './schemas/groups.js';
export * from './schemas/health-check.js';
export * from './schemas/home.js';
+export * from './schemas/locale.js';
export * from './schemas/mp.js';
export * from './schemas/onboarding.js';
export * from './schemas/pagination.js';
diff --git a/packages/shared/src/lib/problem-details.ts b/packages/shared/src/lib/problem-details.ts
index bea86a8..46ae52b 100644
--- a/packages/shared/src/lib/problem-details.ts
+++ b/packages/shared/src/lib/problem-details.ts
@@ -5,5 +5,8 @@ export type ProblemDetails = {
detail?: string;
instance?: string;
code?: string;
+ /** Values the client needs to word the error in its own language (e.g. the
+ * plan limit). `detail` keeps the server-side wording. */
+ params?: Record;
errors?: Record;
};
\ No newline at end of file
diff --git a/packages/shared/src/schemas/attendees.ts b/packages/shared/src/schemas/attendees.ts
index 3ea82f2..5973fc5 100644
--- a/packages/shared/src/schemas/attendees.ts
+++ b/packages/shared/src/schemas/attendees.ts
@@ -84,7 +84,7 @@ const EditableAttendeeFieldsSchema = z.object({
email: z
.string()
.trim()
- .email('Ingresá un email válido')
+ .email('email.invalid')
.or(z.literal(''))
.nullable(),
notes: z.string().trim().nullable(),
@@ -92,7 +92,7 @@ const EditableAttendeeFieldsSchema = z.object({
export const UpdateAttendeeSchema = EditableAttendeeFieldsSchema.partial().refine(
(value) => Object.keys(value).length > 0,
- 'Enviá al menos un campo para actualizar',
+ 'update.empty',
);
export type UpdateAttendee = z.output;
@@ -116,10 +116,10 @@ export const AttendeeListSchema = z.object({
export type AttendeeList = z.output;
export const CreateAttendeeSchema = z.object({
- firstName: z.string().trim().min(1, 'El nombre es obligatorio'),
+ firstName: z.string().trim().min(1, 'name.required'),
lastName: z.string().trim().optional().default(''),
- phone: z.string().trim().min(6, 'Ingresa un número de teléfono válido'),
- email: z.string().trim().email('Email inválido').optional().or(z.literal('')),
+ phone: z.string().trim().min(6, 'phone.invalid'),
+ email: z.string().trim().email('email.invalid').optional().or(z.literal('')),
notes: z.string().trim().optional(),
/* Adds an existing person of the teacher (found by phone) instead of creating
a new one: the name/email fields are ignored then. */
@@ -140,10 +140,10 @@ export const CreateAttendeeResultSchema = z.discriminatedUnion('outcome', [
export type CreateAttendeeResult = z.output;
export const JoinGroupViaInviteSchema = z.object({
- firstName: z.string().trim().min(1, 'El nombre es obligatorio'),
+ firstName: z.string().trim().min(1, 'name.required'),
lastName: z.string().trim().min(1, 'El apellido es obligatorio'),
- phone: z.string().trim().min(6, 'Ingresa un número de teléfono válido'),
- email: z.string().trim().email('Email inválido').optional().or(z.literal('')),
+ phone: z.string().trim().min(6, 'phone.invalid'),
+ email: z.string().trim().email('email.invalid').optional().or(z.literal('')),
});
export type JoinGroupViaInvite = z.output;
@@ -155,11 +155,11 @@ export const JoinGroupViaInviteResultSchema = z.object({
export type JoinGroupViaInviteResult = z.output;
export const BulkAttendeeItemSchema = z.object({
- firstName: z.string().trim().min(1, 'El nombre es obligatorio'),
+ firstName: z.string().trim().min(1, 'name.required'),
lastName: z.string().trim().optional().default(''),
fullName: z.string().trim().optional(),
- phone: z.string().trim().min(6, 'Ingresa un número de teléfono válido'),
- email: z.string().trim().email('Email inválido').optional().or(z.literal('')),
+ phone: z.string().trim().min(6, 'phone.invalid'),
+ email: z.string().trim().email('email.invalid').optional().or(z.literal('')),
notes: z.string().trim().optional(),
});
export type BulkAttendeeItem = z.output;
diff --git a/packages/shared/src/schemas/billing.ts b/packages/shared/src/schemas/billing.ts
index d44d6ae..405feae 100644
--- a/packages/shared/src/schemas/billing.ts
+++ b/packages/shared/src/schemas/billing.ts
@@ -100,7 +100,7 @@ export type BillingStatusDto = z.output;
// Mercado Pago requires the payer to log in with this exact email; Stripe asks
// for it in its own checkout, so it is only mandatory for Mercado Pago.
-const payerEmailSchema = z.string().trim().email('Ingresá un email válido');
+const payerEmailSchema = z.string().trim().email('email.invalid');
export const SubscribeInputSchema = z.strictObject({
payerEmail: payerEmailSchema.optional(),
diff --git a/packages/shared/src/schemas/home.ts b/packages/shared/src/schemas/home.ts
index d2aa8a6..67e2e3b 100644
--- a/packages/shared/src/schemas/home.ts
+++ b/packages/shared/src/schemas/home.ts
@@ -13,7 +13,7 @@ const timeZoneSchema = z
} catch {
return false;
}
- }, 'Zona horaria IANA inválida');
+ }, 'timezone.invalid');
export { timeZoneSchema };
diff --git a/packages/shared/src/schemas/locale.ts b/packages/shared/src/schemas/locale.ts
new file mode 100644
index 0000000..8c4b372
--- /dev/null
+++ b/packages/shared/src/schemas/locale.ts
@@ -0,0 +1,32 @@
+import { z } from 'zod';
+
+// UI languages. es-AR is rioplatense Spanish (Argentina and Uruguay, voseo),
+// es-419 is neutral Latin American Spanish (tuteo). Anything else falls back
+// to English.
+export const SUPPORTED_LOCALES = ['es-AR', 'es-419', 'pt-BR', 'en'] as const;
+export const appLocaleSchema = z.enum(SUPPORTED_LOCALES);
+export type AppLocale = z.output;
+
+export const FALLBACK_LOCALE: AppLocale = 'en';
+
+/** Maps one BCP 47 tag to a supported locale, or null if the language isn't
+ * supported. Any Spanish outside Argentina/Uruguay is es-419 (including
+ * es-ES), any Portuguese is pt-BR. */
+export function matchLocale(tag: string): AppLocale | null {
+ const [language = '', ...rest] = tag.trim().toLowerCase().replace(/_/g, '-').split('-');
+ const region = rest.find((part) => /^([a-z]{2}|\d{3})$/.test(part));
+ if (language === 'es') return region === 'ar' || region === 'uy' ? 'es-AR' : 'es-419';
+ if (language === 'pt') return 'pt-BR';
+ if (language === 'en') return 'en';
+ return null;
+}
+
+/** First supported locale among the device's preferred languages, in order;
+ * English when none matches. */
+export function resolveLocale(tags: readonly string[]): AppLocale {
+ for (const tag of tags) {
+ const match = matchLocale(tag);
+ if (match) return match;
+ }
+ return FALLBACK_LOCALE;
+}
diff --git a/packages/shared/src/schemas/onboarding.ts b/packages/shared/src/schemas/onboarding.ts
index c80dba1..c414ca7 100644
--- a/packages/shared/src/schemas/onboarding.ts
+++ b/packages/shared/src/schemas/onboarding.ts
@@ -17,25 +17,25 @@ export const CreateFirstGroupSchema = z.strictObject({
name: z
.string()
.trim()
- .min(3, 'El nombre debe tener al menos 3 caracteres')
- .max(60, 'El nombre es demasiado largo (máximo 60 caracteres)'),
- days: z.array(weekdaySchema).min(1, 'Elegí al menos un día de clase'),
+ .min(3, 'group.nameMin')
+ .max(60, 'group.nameMax'),
+ days: z.array(weekdaySchema).min(1, 'group.daysMin'),
time: z
.string()
- .regex(/^([01]?\d|2[0-3]):[0-5]\d$/, 'Elegí un horario válido (ej: 09:00)'),
+ .regex(/^([01]?\d|2[0-3]):[0-5]\d$/, 'group.timeInvalid'),
capacity: z
- .number({ invalid_type_error: 'Ingresá un cupo válido' })
- .int({ message: 'El cupo debe ser un número entero' })
- .min(1, 'El cupo debe ser al menos 1'),
+ .number({ invalid_type_error: 'group.capacityInvalid' })
+ .int({ message: 'group.capacityInt' })
+ .min(1, 'group.capacityMin'),
price: z
- .number({ invalid_type_error: 'Ingresá un precio válido' })
- .min(0, 'El precio no puede ser negativo'),
+ .number({ invalid_type_error: 'group.priceInvalid' })
+ .min(0, 'group.priceMin'),
billingType: billingTypeSchema,
dueDay: z
- .number({ invalid_type_error: 'Ingresá un día válido' })
- .int({ message: 'El día debe ser un número entero' })
- .min(1, 'El día de vencimiento debe estar entre 1 y 28')
- .max(28, 'El día de vencimiento debe estar entre 1 y 28'),
+ .number({ invalid_type_error: 'group.dueDayInvalid' })
+ .int({ message: 'group.dueDayInt' })
+ .min(1, 'group.dueDayRange')
+ .max(28, 'group.dueDayRange'),
country: countryCodeSchema.default(DEFAULT_COUNTRY),
});
export type CreateFirstGroup = z.output;
diff --git a/packages/shared/src/schemas/payments.ts b/packages/shared/src/schemas/payments.ts
index 0ad1a76..e76e5a9 100644
--- a/packages/shared/src/schemas/payments.ts
+++ b/packages/shared/src/schemas/payments.ts
@@ -45,7 +45,7 @@ export type PaymentList = z.output;
// triggers it from the group page for a period (e.g. June's monthly fee).
export const CreatePaymentsBatchSchema = z.strictObject({
dueDate: isoDateTimeSchema,
- description: z.string().trim().max(120, 'La descripción es demasiado larga').optional(),
+ description: z.string().trim().max(120, 'payment.descriptionMax').optional(),
attendeeIds: z.array(z.string().min(1)).min(1).optional(),
});
export type CreatePaymentsBatch = z.output;
diff --git a/packages/shared/src/schemas/problem-details.ts b/packages/shared/src/schemas/problem-details.ts
index ee8c56e..d17ff91 100644
--- a/packages/shared/src/schemas/problem-details.ts
+++ b/packages/shared/src/schemas/problem-details.ts
@@ -8,5 +8,6 @@ export const ProblemDetailsSchema: z.ZodType = z.object({
detail: z.string().optional(),
instance: z.string().optional(),
code: z.string().optional(),
+ params: z.record(z.string(), z.union([z.string(), z.number()])).optional(),
errors: z.record(z.string(), z.array(z.string())).optional(),
});
\ No newline at end of file
diff --git a/packages/shared/src/schemas/waitlist.ts b/packages/shared/src/schemas/waitlist.ts
index 5d32184..adfe019 100644
--- a/packages/shared/src/schemas/waitlist.ts
+++ b/packages/shared/src/schemas/waitlist.ts
@@ -44,10 +44,10 @@ export const GroupWaitlistEntryDtoSchema = z.object({
export type GroupWaitlistEntryDto = z.output;
export const CreateGroupWaitlistEntrySchema = z.object({
- firstName: z.string().trim().min(1, 'El nombre es obligatorio'),
+ firstName: z.string().trim().min(1, 'name.required'),
lastName: z.string().trim().optional().default(''),
- phone: z.string().trim().min(6, 'Ingresa un número de teléfono válido'),
- email: z.string().trim().email('Email inválido').optional().or(z.literal('')),
+ phone: z.string().trim().min(6, 'phone.invalid'),
+ email: z.string().trim().email('email.invalid').optional().or(z.literal('')),
notes: z.string().trim().optional(),
});
export type CreateGroupWaitlistEntry = z.output;
diff --git a/packages/shared/src/schemas/whatsapp.ts b/packages/shared/src/schemas/whatsapp.ts
index d324510..ecf7644 100644
--- a/packages/shared/src/schemas/whatsapp.ts
+++ b/packages/shared/src/schemas/whatsapp.ts
@@ -55,7 +55,7 @@ export type WhatsappConnectResultDto = z.output;
@@ -116,7 +116,7 @@ export const UpdateGroupAutomationsSchema = z
autoReengagement: z.boolean().optional(),
})
.refine((value) => value.autoPaymentReminders !== undefined || value.autoReengagement !== undefined, {
- message: 'Indicá al menos una automatización',
+ message: 'whatsapp.automationRequired',
});
export type UpdateGroupAutomations = z.output;