From dfb6951d7cc30595139d09a6e0e939bb178a4eea Mon Sep 17 00:00:00 2001 From: Jose Selesan Date: Tue, 3 Nov 2026 13:59:41 -0300 Subject: [PATCH] =?UTF-8?q?feat(i18n):=20traducir=20el=20onboarding=20(nom?= =?UTF-8?q?bres=20de=20pa=C3=ADs=20desde=20Intl)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- .../features/onboarding/ConfirmationStep.tsx | 50 ++++------ .../src/features/onboarding/CountryStep.tsx | 18 ++-- .../features/onboarding/FirstGroupStep.tsx | 11 ++- .../features/onboarding/OnboardingView.tsx | 13 +-- .../src/features/onboarding/PaymentStep.tsx | 30 +++--- apps/web/src/features/onboarding/PlanStep.tsx | 39 ++++---- apps/web/src/features/onboarding/Stepper.tsx | 4 +- .../src/features/onboarding/WelcomeStep.tsx | 26 +++--- .../src/features/onboarding/WhatsappStep.tsx | 26 +++--- apps/web/src/features/onboarding/steps.ts | 10 +- apps/web/src/i18n/countries.ts | 14 +++ apps/web/src/i18n/i18next.d.ts | 2 + apps/web/src/i18n/index.ts | 1 + apps/web/src/i18n/locales/en/onboarding.json | 93 +++++++++++++++++++ .../src/i18n/locales/es-419/onboarding.json | 93 +++++++++++++++++++ .../src/i18n/locales/es-AR/onboarding.json | 93 +++++++++++++++++++ .../src/i18n/locales/pt-BR/onboarding.json | 93 +++++++++++++++++++ 17 files changed, 501 insertions(+), 115 deletions(-) create mode 100644 apps/web/src/i18n/countries.ts create mode 100644 apps/web/src/i18n/locales/en/onboarding.json create mode 100644 apps/web/src/i18n/locales/es-419/onboarding.json create mode 100644 apps/web/src/i18n/locales/es-AR/onboarding.json create mode 100644 apps/web/src/i18n/locales/pt-BR/onboarding.json diff --git a/apps/web/src/features/onboarding/ConfirmationStep.tsx b/apps/web/src/features/onboarding/ConfirmationStep.tsx index 05ad397..ab8a6d5 100644 --- a/apps/web/src/features/onboarding/ConfirmationStep.tsx +++ b/apps/web/src/features/onboarding/ConfirmationStep.tsx @@ -5,10 +5,11 @@ import { ArrowRight, CheckCircle2, CreditCard, MessageCircle, Sparkles } from 'l import { Badge, Button } from '../../components/ui' import { useAuth } from '../../context/AuthProvider' import { PLAN_NAMES } from '../billing' -import { MP_PROVIDER_NAME, useMpStatus } from '../mp' +import { useMpStatus } from '../mp' import { useWhatsappStatus } from '../whatsapp' import { billingTypeLabel, formatPrice, formatSchedule } from './constants' import { useOnboarding } from './OnboardingProvider' +import { Trans, useTranslation } from 'react-i18next' type ConfirmationStepProps = { group: OnboardingGroupDto @@ -16,6 +17,7 @@ type ConfirmationStepProps = { export function ConfirmationStep({ group }: ConfirmationStepProps) { const navigate = useNavigate() + const { t } = useTranslation(['onboarding', 'common', 'groups']) const queryClient = useQueryClient() const { refresh } = useAuth() const statusQuery = useMpStatus() @@ -37,9 +39,9 @@ export function ConfirmationStep({ group }: ConfirmationStepProps) { -

¡Todo listo!

+

{t('done.title')}

- Tu grupo se creó. Ya podés invitar miembros y pasar lista. + {t('done.description')}

@@ -51,24 +53,24 @@ export function ConfirmationStep({ group }: ConfirmationStepProps) { {formatSchedule(group.days ?? [], group.time)}

- Activo + {t('done.active')}
-
Precio
+
{t('done.price')}
{formatPrice(group.price)} {group.billingType ? ` · ${billingTypeLabel(group.billingType)}` : ''}
-
Cupo
-
{group.capacity ?? '—'} miembros
+
{t('done.capacity')}
+
{group.capacity != null ? t('done.capacityValue', { count: group.capacity }) : '—'}
-
Vencimiento
-
Día {group.dueDay ?? '—'} de cada mes
+
{t('done.dueDay')}
+
{group.dueDay != null ? t('done.dueDayValue', { day: group.dueDay }) : '—'}
@@ -77,10 +79,8 @@ export function ConfirmationStep({ group }: ConfirmationStepProps) {

- Estás en el plan {PLAN_NAMES[selectedPlan]}. - {selectedPlan === 'FREE' - ? ' Cuando quieras cobrar con Mercado Pago o automatizar WhatsApp, pasate a Pro desde Ajustes.' - : ''} + }} /> + {selectedPlan === 'FREE' ? t('done.freeHint') : ''}

) : null} @@ -92,17 +92,9 @@ export function ConfirmationStep({ group }: ConfirmationStepProps) {

{isMpConnected ? ( - <> - Vas a cobrar con {MP_PROVIDER_NAME}. Los - pagos entran directo en tu cuenta. - + }} /> ) : ( - <> - Cuando quieras cobrar, vinculá - {MP_PROVIDER_NAME} - {' '} - desde Ajustes. Tu grupo ya quedó creado. - + }} /> )}

@@ -111,15 +103,9 @@ export function ConfirmationStep({ group }: ConfirmationStepProps) {

{isWhatsappConnected ? ( - <> - Tu WhatsApp está vinculado. Activá los recordatorios de pago y el reenganche desde la - ficha del grupo. - + t('done.waConnected') ) : ( - <> - Para enviar recordatorios automáticos, vinculá{' '} - WhatsApp desde Ajustes. - + }} /> )}

@@ -127,7 +113,7 @@ export function ConfirmationStep({ group }: ConfirmationStepProps) { )} diff --git a/apps/web/src/features/onboarding/CountryStep.tsx b/apps/web/src/features/onboarding/CountryStep.tsx index 9e0f6af..41b15a2 100644 --- a/apps/web/src/features/onboarding/CountryStep.tsx +++ b/apps/web/src/features/onboarding/CountryStep.tsx @@ -1,9 +1,11 @@ import type { CountryCode } from '@gruperly/shared' -import { COUNTRY_CURRENCY, COUNTRY_LABELS } from '@gruperly/shared' +import { COUNTRY_CURRENCY } from '@gruperly/shared' import { ArrowLeft, ArrowRight } from 'lucide-react' import { Button } from '../../components/ui' import { cn } from '../../lib/utils' import { useOnboarding } from './OnboardingProvider' +import { useTranslation } from 'react-i18next' +import { countryName, useIntlLocale } from '../../i18n' export const COUNTRY_OPTIONS: readonly CountryCode[] = [ 'AR', @@ -30,17 +32,19 @@ type CountryStepProps = { */ export function CountryStep({ onNext, onBack }: CountryStepProps) { const { country, setCountry } = useOnboarding() + const { t } = useTranslation(['onboarding', 'common', 'groups']) + const locale = useIntlLocale() return (
-

¿En qué país vas a cobrar?

+

{t('country.title')}

- Tus links se generan en la moneda de ese país. + {t('country.description')}

-
+
{COUNTRY_OPTIONS.map((code) => { const isSelected = code === country return ( @@ -60,7 +64,7 @@ export function CountryStep({ onNext, onBack }: CountryStepProps) { className="size-4 accent-accent" /> - {COUNTRY_LABELS[code]} + {countryName(code, locale)} {COUNTRY_CURRENCY[code]} @@ -71,10 +75,10 @@ export function CountryStep({ onNext, onBack }: CountryStepProps) {
diff --git a/apps/web/src/features/onboarding/FirstGroupStep.tsx b/apps/web/src/features/onboarding/FirstGroupStep.tsx index 5cd6df7..783ba74 100644 --- a/apps/web/src/features/onboarding/FirstGroupStep.tsx +++ b/apps/web/src/features/onboarding/FirstGroupStep.tsx @@ -1,8 +1,10 @@ import type { CreateFirstGroup, OnboardingGroupDto } from '@gruperly/shared' import { useMutation } from '@tanstack/react-query' import { createFirstGroup } from '../../lib/api' +import { errorMessage } from '../../i18n' import { GroupForm } from '../groups/GroupForm' import { useOnboarding } from './OnboardingProvider' +import { useTranslation } from 'react-i18next' type FirstGroupStepProps = { onBack: () => void @@ -11,6 +13,7 @@ type FirstGroupStepProps = { export function FirstGroupStep({ onBack, onCompleted }: FirstGroupStepProps) { const { country } = useOnboarding() + const { t } = useTranslation(['onboarding', 'common', 'groups']) const create = useMutation({ mutationFn: (values: CreateFirstGroup) => createFirstGroup(values), onSuccess: (result) => onCompleted(result.group), @@ -18,13 +21,13 @@ export function FirstGroupStep({ onBack, onCompleted }: FirstGroupStepProps) { return ( create.mutate(values)} onBack={onBack} diff --git a/apps/web/src/features/onboarding/OnboardingView.tsx b/apps/web/src/features/onboarding/OnboardingView.tsx index 4a8f449..883a180 100644 --- a/apps/web/src/features/onboarding/OnboardingView.tsx +++ b/apps/web/src/features/onboarding/OnboardingView.tsx @@ -10,14 +10,15 @@ import { FirstGroupStep } from './FirstGroupStep' import { useOnboarding } from './OnboardingProvider' import { PaymentStep } from './PaymentStep' import { PlanStep } from './PlanStep' -import { STEP_LABELS } from './steps' import { Stepper } from './Stepper' import { WelcomeStep } from './WelcomeStep' import { WhatsappStep } from './WhatsappStep' +import { useTranslation } from 'react-i18next' export function OnboardingView() { const { user, isPending: authPending } = useAuth() const navigate = useNavigate() + const { t } = useTranslation(['onboarding', 'common', 'groups']) const { step, steps, @@ -52,16 +53,16 @@ export function OnboardingView() { -

Tu cuenta, lista

+

{t('signedOut.title')}

- Iniciá sesión para configurar tus cobros y crear tu primer grupo. + {t('signedOut.description')}

@@ -76,7 +77,7 @@ export function OnboardingView() { ) } - const firstName = user.name?.trim().split(/\s+/)[0] ?? 'profesor/a' + const firstName = user.name?.trim().split(/\s+/)[0] ?? t('fallbackName') return (
@@ -87,7 +88,7 @@ export function OnboardingView() { {/* Con Free no se muestran Cobros ni WhatsApp: el stepper refleja solo los pasos que se van a recorrer. */} ({ label: STEP_LABELS[id] }))} + steps={steps.map((id) => ({ label: t(`steps.${id}`) }))} current={steps.indexOf(step)} /> diff --git a/apps/web/src/features/onboarding/PaymentStep.tsx b/apps/web/src/features/onboarding/PaymentStep.tsx index b6cdadf..2bbbc46 100644 --- a/apps/web/src/features/onboarding/PaymentStep.tsx +++ b/apps/web/src/features/onboarding/PaymentStep.tsx @@ -3,13 +3,13 @@ import { Badge, Button } from '../../components/ui' import type { MpCallbackFeedback } from '../mp' import { formatMpConnectionDate, - MP_PROVIDER_NAME, mpCallbackErrorMessage, mpStatusBadgeVariant, mpStatusLabel, useMpStatus, useStartMpAuthorization, } from '../mp' +import { useTranslation } from 'react-i18next' type PaymentStepProps = { /** Resultado de la vinculación, leído de `?mp=` al volver de Mercado Pago. */ @@ -27,6 +27,7 @@ type PaymentStepProps = { */ export function PaymentStep({ feedback, onNext, onBack }: PaymentStepProps) { const statusQuery = useMpStatus() + const { t } = useTranslation(['onboarding', 'common', 'groups']) const startAuthorization = useStartMpAuthorization() const status = statusQuery.data?.status ?? 'none' @@ -36,16 +37,16 @@ export function PaymentStep({ feedback, onNext, onBack }: PaymentStepProps) { return (
-

Conectá tus cobros

+

{t('payment.title')}

- Vinculá tu cuenta de {MP_PROVIDER_NAME} y cobrale a tus miembros desde el grupo. + {t('payment.description')}

{feedback?.kind === 'success' ? (

- Tu cuenta de {MP_PROVIDER_NAME} quedó vinculada. + {t('payment.linked')}

) : null} @@ -57,7 +58,7 @@ export function PaymentStep({ feedback, onNext, onBack }: PaymentStepProps) {
-

{MP_PROVIDER_NAME}

+

Mercado Pago

{mpStatusLabel(status)}
@@ -65,17 +66,16 @@ export function PaymentStep({ feedback, onNext, onBack }: PaymentStepProps) { {statusQuery.isPending ? (

- Consultando tu cuenta… + {t('payment.loading')}

) : isConnected ? (

- {connectedAt ? `Vinculada el ${connectedAt}. ` : ''} - Los pagos de tus grupos van a entrar a esta cuenta. + {connectedAt ? `${t('payment.linkedOn', { date: connectedAt })} ` : ''} + {t('payment.connectedHint')}

) : (

- Te llevamos a {MP_PROVIDER_NAME} para autorizar los cobros. Los pagos entran - directo en tu cuenta, sin intermediarios. + {t('payment.connectHint')}

)}
@@ -93,10 +93,10 @@ export function PaymentStep({ feedback, onNext, onBack }: PaymentStepProps) { )} {startAuthorization.isStarting - ? 'Abriendo Mercado Pago…' + ? t('payment.opening') : isConnected - ? 'Cambiar de cuenta' - : 'Vincular cuenta'} + ? t('payment.change') + : t('payment.connect')} @@ -110,10 +110,10 @@ export function PaymentStep({ feedback, onNext, onBack }: PaymentStepProps) {
diff --git a/apps/web/src/features/onboarding/PlanStep.tsx b/apps/web/src/features/onboarding/PlanStep.tsx index efdb80e..2d6098e 100644 --- a/apps/web/src/features/onboarding/PlanStep.tsx +++ b/apps/web/src/features/onboarding/PlanStep.tsx @@ -15,8 +15,9 @@ import { useSubscriptionReturnPolling, } from '../billing' import { useOnboarding } from './OnboardingProvider' +import { useTranslation } from 'react-i18next' +import { errorMessage } from '../../i18n' -const SELECT_PLAN_ERROR_MESSAGE = 'No pudimos guardar tu plan. Revisá tu conexión e intentá de nuevo.' /** * Paso "Plan" del onboarding (obligatorio). Free sigue directo al primer grupo @@ -26,6 +27,7 @@ const SELECT_PLAN_ERROR_MESSAGE = 'No pudimos guardar tu plan. Revisá tu conexi */ export function PlanStep() { const { user } = useAuth() + const { t } = useTranslation(['onboarding', 'common', 'billing']) const queryClient = useQueryClient() const { country, selectedPlan, setSelectedPlan, returnedFromSubscription, goTo, goBack, statusQuery } = useOnboarding() @@ -65,7 +67,7 @@ export function PlanStep() { setProUnavailable(true) setIsEnteringEmail(false) } - setError(caught instanceof ApiError && caught.problem?.detail ? caught.problem.detail : SELECT_PLAN_ERROR_MESSAGE) + setError(errorMessage(caught, t('plan.error'))) }, }) @@ -80,17 +82,19 @@ export function PlanStep() { mutation.mutate({ plan: 'PRO', country, payerEmail }) } - const proPrice = `${formatPrice(PRO_PRICE_BY_COUNTRY[country], COUNTRY_CURRENCY[country])} / mes` + const proPrice = t('billing:view.perMonth', { + price: formatPrice(PRO_PRICE_BY_COUNTRY[country], COUNTRY_CURRENCY[country]), + }) if (subscriptionStatus === 'AUTHORIZED') { return (

- ¡Listo! Tu suscripción a Pro quedó activa. + {t('plan.active')}

@@ -109,12 +113,12 @@ export function PlanStep() { )}

- {returnedFromSubscription ? 'Procesando tu pago…' : 'Tu suscripción a Pro quedó pendiente'} + {returnedFromSubscription ? t('plan.processing') : t('plan.pendingTitle')}

{returnedFromSubscription - ? `${providerName} puede tardar unos minutos en confirmarlo. Podés seguir mientras tanto: te avisamos cuando quede activa.` - : `No terminaste de autorizar el pago en ${providerName}. Podés reintentarlo o seguir con Free.`} + ? t('plan.processingHint', { provider: providerName }) + : t('plan.pendingHint', { provider: providerName })}

@@ -124,17 +128,17 @@ export function PlanStep() {
{returnedFromSubscription ? ( ) : ( <> )} @@ -151,13 +155,13 @@ export function PlanStep() { {mutation.isPending && mutation.variables?.plan === 'FREE' ? ( ) : null} - Empezar gratis + {t('plan.startFree')} {proUnavailable ? ( -

Todavía no está disponible en tu país.

+

{t('billing:view.unavailable')}

) : isEnteringEmail ? ( setIsEnteringEmail(true)}> - Elegir Pro + {t('plan.choosePro')} )}
@@ -181,7 +185,7 @@ export function PlanStep() {
@@ -190,12 +194,13 @@ export function PlanStep() { /** Encabezado común a los tres estados del paso. */ function StepShell({ children }: { children: ReactNode }) { + const { t } = useTranslation('onboarding') return (
-

Elegí tu plan

+

{t('plan.title')}

- Empezá gratis o pasate a Pro para cobrar con Mercado Pago y automatizar WhatsApp. + {t('plan.description')}

{children} diff --git a/apps/web/src/features/onboarding/Stepper.tsx b/apps/web/src/features/onboarding/Stepper.tsx index fda8c9a..b6bbc6e 100644 --- a/apps/web/src/features/onboarding/Stepper.tsx +++ b/apps/web/src/features/onboarding/Stepper.tsx @@ -1,5 +1,6 @@ import { Check } from 'lucide-react' import { cn } from '../../lib/utils' +import { useTranslation } from 'react-i18next' export type StepperProps = { steps: readonly { label: string }[] @@ -7,8 +8,9 @@ export type StepperProps = { } export function Stepper({ steps, current }: StepperProps) { + const { t } = useTranslation('onboarding') return ( -
    +
      {steps.map((step, index) => { const isDone = index < current const isActive = index === current diff --git a/apps/web/src/features/onboarding/WelcomeStep.tsx b/apps/web/src/features/onboarding/WelcomeStep.tsx index 136b4d1..eb84f54 100644 --- a/apps/web/src/features/onboarding/WelcomeStep.tsx +++ b/apps/web/src/features/onboarding/WelcomeStep.tsx @@ -1,5 +1,6 @@ import { ArrowRight, Rocket, Users, Wallet } from 'lucide-react' import { Button } from '../../components/ui' +import { useTranslation } from 'react-i18next' type WelcomeStepProps = { name: string @@ -9,31 +10,32 @@ type WelcomeStepProps = { const STEPS_TO_SETUP = [ { icon: Wallet, - title: 'Conectá tu cuenta de cobro', - description: 'Vinculá Mercado Pago y cobrale a tus miembros desde el grupo.', + title: 'welcome.step1Title', + description: 'welcome.step1', }, { icon: Users, - title: 'Creá tu primer grupo', - description: 'Días, horario, precio y cupo de tu clase.', + title: 'welcome.step2Title', + description: 'welcome.step2', }, { icon: Rocket, - title: 'Empezá a cobrar', - description: 'Todo listo para sumar miembros y cobrar al instante.', + title: 'welcome.step3Title', + description: 'welcome.step3', }, -] +] as const export function WelcomeStep({ name, onNext }: WelcomeStepProps) { + const { t } = useTranslation('onboarding') return (
      -

      ¡Hola, {name}!

      +

      {t('welcome.title', { name })}

      - Vamos a configurar tu cuenta en 3 pasos. Vas a tardar menos de 5 minutos. + {t('welcome.description')}

      @@ -47,15 +49,15 @@ export function WelcomeStep({ name, onNext }: WelcomeStepProps) {
      -

      {title}

      -

      {description}

      +

      {t(title)}

      +

      {t(description)}

      ))}
diff --git a/apps/web/src/features/onboarding/WhatsappStep.tsx b/apps/web/src/features/onboarding/WhatsappStep.tsx index 01fe903..3e42564 100644 --- a/apps/web/src/features/onboarding/WhatsappStep.tsx +++ b/apps/web/src/features/onboarding/WhatsappStep.tsx @@ -12,6 +12,7 @@ import { whatsappStatusErrorMessage, whatsappStatusLabel, } from '../whatsapp' +import { useTranslation } from 'react-i18next' type WhatsappStepProps = { /** Resultado de una vinculación por redirect, leído de `?wa=` al volver. */ @@ -29,6 +30,7 @@ type WhatsappStepProps = { */ export function WhatsappStep({ feedback, onNext, onBack }: WhatsappStepProps) { const statusQuery = useWhatsappStatus() + const { t } = useTranslation(['onboarding', 'common', 'whatsapp']) const connection = useStartWhatsappConnection() const status = statusQuery.data?.status ?? 'none' @@ -38,18 +40,18 @@ export function WhatsappStep({ feedback, onNext, onBack }: WhatsappStepProps) { return (
-

Conectá tu WhatsApp

+

{t('whatsapp.title')}

- Gruperly le recuerda los pagos a tus miembros y escribe a los que dejaron de venir, una - vez por semana y desde tu número. + {t('whatsapp.description')}

{feedback?.kind === 'success' || (isConnected && !feedback) ? (

- Tu WhatsApp quedó vinculado - {statusQuery.data?.displayPhoneNumber ? ` (${statusQuery.data.displayPhoneNumber})` : ''}. + {statusQuery.data?.displayPhoneNumber + ? t('whatsapp.linkedWith', { phone: statusQuery.data.displayPhoneNumber }) + : t('whatsapp.linked')}

) : null} @@ -69,7 +71,7 @@ export function WhatsappStep({ feedback, onNext, onBack }: WhatsappStepProps) { {statusQuery.isPending ? (

- Consultando tu WhatsApp… + {t('whatsapp:card.loading')}

) : statusQuery.isError ? (

@@ -80,9 +82,9 @@ export function WhatsappStep({ feedback, onNext, onBack }: WhatsappStepProps) { ) : (

{usesQr - ? 'Lo vinculás con tu número de teléfono o escaneando un código QR, como WhatsApp Web.' - : 'Te llevamos a Meta para conectar tu cuenta de WhatsApp Business.'}{' '} - Los envíos automáticos los prendés después en cada grupo. + ? t('whatsapp.qrHint') + : t('whatsapp.metaHint')}{' '} + {t('whatsapp.perGroup')}

)}
@@ -100,7 +102,7 @@ export function WhatsappStep({ feedback, onNext, onBack }: WhatsappStepProps) { ) : ( )} - {connection.isStarting ? 'Abriendo…' : 'Vincular WhatsApp'} + {connection.isStarting ? t('whatsapp.opening') : t('whatsapp.connect')} ) : null} @@ -119,10 +121,10 @@ export function WhatsappStep({ feedback, onNext, onBack }: WhatsappStepProps) {
diff --git a/apps/web/src/features/onboarding/steps.ts b/apps/web/src/features/onboarding/steps.ts index 52a748f..1a65f0a 100644 --- a/apps/web/src/features/onboarding/steps.ts +++ b/apps/web/src/features/onboarding/steps.ts @@ -12,15 +12,7 @@ export type OnboardingStepId = | 'group' | 'done' -export const STEP_LABELS: Record = { - welcome: 'Bienvenida', - country: 'País', - plan: 'Plan', - payment: 'Cobros', - whatsapp: 'WhatsApp', - group: 'Tu grupo', - done: 'Listo', -} +/** Labels: `onboarding:steps.`. */ const ALL_STEPS: readonly OnboardingStepId[] = [ 'welcome', diff --git a/apps/web/src/i18n/countries.ts b/apps/web/src/i18n/countries.ts new file mode 100644 index 0000000..6832940 --- /dev/null +++ b/apps/web/src/i18n/countries.ts @@ -0,0 +1,14 @@ +import { i18n } from './instance' + +const displayNames = new Map() + +/** Nombre del país en el idioma de la UI ("Brasil", "Brazil"). Sale de `Intl`: + * no hace falta traducir la lista a mano. */ +export function countryName(code: string, locale: string = i18n.language): string { + let names = displayNames.get(locale) + if (!names) { + names = new Intl.DisplayNames(locale, { type: 'region' }) + displayNames.set(locale, names) + } + return names.of(code) ?? code +} diff --git a/apps/web/src/i18n/i18next.d.ts b/apps/web/src/i18n/i18next.d.ts index a7fbc90..c3b512c 100644 --- a/apps/web/src/i18n/i18next.d.ts +++ b/apps/web/src/i18n/i18next.d.ts @@ -17,6 +17,7 @@ import type payments from './locales/es-AR/payments.json' import type billing from './locales/es-AR/billing.json' import type mp from './locales/es-AR/mp.json' import type whatsapp from './locales/es-AR/whatsapp.json' +import type onboarding from './locales/es-AR/onboarding.json' import type validation from './locales/es-AR/validation.json' // es-AR es la fuente: una clave que no exista ahí rompe el typecheck. @@ -31,6 +32,7 @@ declare module 'i18next' { pwa: typeof pwa settings: typeof settings validation: typeof validation + 'onboarding': typeof onboarding 'whatsapp': typeof whatsapp 'mp': typeof mp 'billing': typeof billing diff --git a/apps/web/src/i18n/index.ts b/apps/web/src/i18n/index.ts index 4f852fd..7a56b69 100644 --- a/apps/web/src/i18n/index.ts +++ b/apps/web/src/i18n/index.ts @@ -5,3 +5,4 @@ export { useIntlLocale } from './useIntlLocale' export { errorMessage } from './errors' export { installZodErrorMap, validationMessage } from './validation' export type { LocalePreference } from './preference' +export { countryName } from './countries' diff --git a/apps/web/src/i18n/locales/en/onboarding.json b/apps/web/src/i18n/locales/en/onboarding.json new file mode 100644 index 0000000..f0310e1 --- /dev/null +++ b/apps/web/src/i18n/locales/en/onboarding.json @@ -0,0 +1,93 @@ +{ + "steps": { + "welcome": "Welcome", + "country": "Country", + "plan": "Plan", + "payment": "Payments", + "whatsapp": "WhatsApp", + "group": "Your group", + "done": "Done", + "progress": "Setup progress" + }, + "continue": "Continue", + "later": "I'll do it later", + "signedOut": { + "title": "Your account is ready", + "description": "Sign in to set up your payments and create your first group.", + "action": "Sign in" + }, + "fallbackName": "there", + "welcome": { + "title": "Hi, {{name}}!", + "description": "Let's set up your account in 3 steps. It takes less than 5 minutes.", + "step1Title": "Connect your payment account", + "step1": "Link Mercado Pago and charge your members from the group.", + "step2Title": "Create your first group", + "step2": "Days, time, price and capacity of your class.", + "step3Title": "Start collecting", + "step3": "All set to add members and get paid right away.", + "start": "Get started" + }, + "country": { + "title": "Which country will you charge in?", + "description": "Your links are created in that country's currency.", + "label": "Country" + }, + "plan": { + "title": "Choose your plan", + "description": "Start for free or upgrade to Pro to collect with Mercado Pago and automate WhatsApp.", + "error": "We couldn't save your plan. Check your connection and try again.", + "active": "All set! Your Pro subscription is active.", + "processing": "Processing your payment…", + "pendingTitle": "Your Pro subscription is pending", + "processingHint": "{{provider}} may take a few minutes to confirm it. You can keep going: we'll let you know when it's active.", + "pendingHint": "You didn't finish authorizing the payment in {{provider}}. You can retry or continue on Free.", + "retry": "Retry payment", + "stayFree": "Continue on Free", + "startFree": "Start for free", + "choosePro": "Choose Pro" + }, + "payment": { + "title": "Connect your payments", + "description": "Link your Mercado Pago account and charge your members from the group.", + "linked": "Your Mercado Pago account is linked.", + "loading": "Checking your account…", + "linkedOn": "Linked on {{date}}.", + "connectedHint": "Your groups' payments will go into this account.", + "connectHint": "We'll take you to Mercado Pago to authorize payments. Money goes straight into your account, no middlemen.", + "opening": "Opening Mercado Pago…", + "change": "Change account", + "connect": "Link account" + }, + "whatsapp": { + "title": "Connect your WhatsApp", + "description": "Gruperly reminds your members about payments and reaches out to those who stopped coming, once a week and from your number.", + "linked": "Your WhatsApp is linked.", + "linkedWith": "Your WhatsApp is linked ({{phone}}).", + "qrHint": "Link it with your phone number or by scanning a QR code, like WhatsApp Web.", + "metaHint": "We'll take you to Meta to connect your WhatsApp Business account.", + "perGroup": "You turn on automatic messages later in each group.", + "opening": "Opening…", + "connect": "Link WhatsApp" + }, + "group": { + "heading": "Your first group" + }, + "done": { + "title": "All set!", + "description": "Your group was created. You can now invite members and take attendance.", + "active": "Active", + "price": "Price", + "capacity": "Capacity", + "capacityValue": "{{count}} members", + "dueDay": "Due date", + "dueDayValue": "Day {{day}} of each month", + "plan": "You're on the {{plan}} plan.", + "freeHint": " When you want to collect with Mercado Pago or automate WhatsApp, upgrade to Pro from Settings.", + "mpConnected": "You'll collect with Mercado Pago. Payments go straight into your account.", + "mpPending": "When you're ready to collect, link Mercado Pago from Settings. Your group is already created.", + "waConnected": "Your WhatsApp is linked. Turn on payment reminders and re-engagement from the group's page.", + "waPending": "To send automatic reminders, link WhatsApp from Settings.", + "goToPanel": "Go to my dashboard" + } +} diff --git a/apps/web/src/i18n/locales/es-419/onboarding.json b/apps/web/src/i18n/locales/es-419/onboarding.json new file mode 100644 index 0000000..2a6833f --- /dev/null +++ b/apps/web/src/i18n/locales/es-419/onboarding.json @@ -0,0 +1,93 @@ +{ + "steps": { + "welcome": "Bienvenida", + "country": "País", + "plan": "Plan", + "payment": "Cobros", + "whatsapp": "WhatsApp", + "group": "Tu grupo", + "done": "Listo", + "progress": "Progreso del alta" + }, + "continue": "Continuar", + "later": "Lo haré después", + "signedOut": { + "title": "Tu cuenta, lista", + "description": "Inicia sesión para configurar tus cobros y crear tu primer grupo.", + "action": "Iniciar sesión" + }, + "fallbackName": "profe", + "welcome": { + "title": "¡Hola, {{name}}!", + "description": "Configuremos tu cuenta en 3 pasos. Te tomará menos de 5 minutos.", + "step1Title": "Conecta tu cuenta de cobro", + "step1": "Vincula Mercado Pago y cóbrales a tus miembros desde el grupo.", + "step2Title": "Crea tu primer grupo", + "step2": "Días, horario, precio y cupo de tu clase.", + "step3Title": "Empieza a cobrar", + "step3": "Todo listo para sumar miembros y cobrar al instante.", + "start": "Comenzar" + }, + "country": { + "title": "¿En qué país vas a cobrar?", + "description": "Tus links se generan en la moneda de ese país.", + "label": "País" + }, + "plan": { + "title": "Elige tu plan", + "description": "Empieza gratis o cámbiate a Pro para cobrar con Mercado Pago y automatizar WhatsApp.", + "error": "No pudimos guardar tu plan. Revisa tu conexión e inténtalo de nuevo.", + "active": "¡Listo! Tu suscripción a Pro quedó activa.", + "processing": "Procesando tu pago…", + "pendingTitle": "Tu suscripción a Pro quedó pendiente", + "processingHint": "{{provider}} puede tardar unos minutos en confirmarlo. Puedes seguir mientras tanto: te avisaremos cuando quede activa.", + "pendingHint": "No terminaste de autorizar el pago en {{provider}}. Puedes reintentarlo o seguir con Free.", + "retry": "Reintentar el pago", + "stayFree": "Seguir con Free", + "startFree": "Empezar gratis", + "choosePro": "Elegir Pro" + }, + "payment": { + "title": "Conecta tus cobros", + "description": "Vincula tu cuenta de Mercado Pago y cóbrales a tus miembros desde el grupo.", + "linked": "Tu cuenta de Mercado Pago quedó vinculada.", + "loading": "Consultando tu cuenta…", + "linkedOn": "Vinculada el {{date}}.", + "connectedHint": "Los pagos de tus grupos entrarán a esta cuenta.", + "connectHint": "Te llevamos a Mercado Pago para autorizar los cobros. Los pagos entran directo en tu cuenta, sin intermediarios.", + "opening": "Abriendo Mercado Pago…", + "change": "Cambiar de cuenta", + "connect": "Vincular cuenta" + }, + "whatsapp": { + "title": "Conecta tu WhatsApp", + "description": "Gruperly le recuerda los pagos a tus miembros y escribe a los que dejaron de venir, una vez por semana y desde tu número.", + "linked": "Tu WhatsApp quedó vinculado.", + "linkedWith": "Tu WhatsApp quedó vinculado ({{phone}}).", + "qrHint": "Lo vinculas con tu número de teléfono o escaneando un código QR, como WhatsApp Web.", + "metaHint": "Te llevamos a Meta para conectar tu cuenta de WhatsApp Business.", + "perGroup": "Los envíos automáticos los activas después en cada grupo.", + "opening": "Abriendo…", + "connect": "Vincular WhatsApp" + }, + "group": { + "heading": "Tu primer grupo" + }, + "done": { + "title": "¡Todo listo!", + "description": "Tu grupo se creó. Ya puedes invitar miembros y pasar lista.", + "active": "Activo", + "price": "Precio", + "capacity": "Cupo", + "capacityValue": "{{count}} miembros", + "dueDay": "Vencimiento", + "dueDayValue": "Día {{day}} de cada mes", + "plan": "Estás en el plan {{plan}}.", + "freeHint": " Cuando quieras cobrar con Mercado Pago o automatizar WhatsApp, cámbiate a Pro desde Ajustes.", + "mpConnected": "Cobrarás con Mercado Pago. Los pagos entran directo en tu cuenta.", + "mpPending": "Cuando quieras cobrar, vincula Mercado Pago desde Ajustes. Tu grupo ya quedó creado.", + "waConnected": "Tu WhatsApp está vinculado. Activa los recordatorios de pago y el reenganche desde la ficha del grupo.", + "waPending": "Para enviar recordatorios automáticos, vincula WhatsApp desde Ajustes.", + "goToPanel": "Ir a mi Panel" + } +} diff --git a/apps/web/src/i18n/locales/es-AR/onboarding.json b/apps/web/src/i18n/locales/es-AR/onboarding.json new file mode 100644 index 0000000..ab23662 --- /dev/null +++ b/apps/web/src/i18n/locales/es-AR/onboarding.json @@ -0,0 +1,93 @@ +{ + "steps": { + "welcome": "Bienvenida", + "country": "País", + "plan": "Plan", + "payment": "Cobros", + "whatsapp": "WhatsApp", + "group": "Tu grupo", + "done": "Listo", + "progress": "Progreso del alta" + }, + "continue": "Continuar", + "later": "Lo hago después", + "signedOut": { + "title": "Tu cuenta, lista", + "description": "Iniciá sesión para configurar tus cobros y crear tu primer grupo.", + "action": "Iniciar sesión" + }, + "fallbackName": "profe", + "welcome": { + "title": "¡Hola, {{name}}!", + "description": "Vamos a configurar tu cuenta en 3 pasos. Vas a tardar menos de 5 minutos.", + "step1Title": "Conectá tu cuenta de cobro", + "step1": "Vinculá Mercado Pago y cobrale a tus miembros desde el grupo.", + "step2Title": "Creá tu primer grupo", + "step2": "Días, horario, precio y cupo de tu clase.", + "step3Title": "Empezá a cobrar", + "step3": "Todo listo para sumar miembros y cobrar al instante.", + "start": "Comenzar" + }, + "country": { + "title": "¿En qué país vas a cobrar?", + "description": "Tus links se generan en la moneda de ese país.", + "label": "País" + }, + "plan": { + "title": "Elegí tu plan", + "description": "Empezá gratis o pasate a Pro para cobrar con Mercado Pago y automatizar WhatsApp.", + "error": "No pudimos guardar tu plan. Revisá tu conexión e intentá de nuevo.", + "active": "¡Listo! Tu suscripción a Pro quedó activa.", + "processing": "Procesando tu pago…", + "pendingTitle": "Tu suscripción a Pro quedó pendiente", + "processingHint": "{{provider}} puede tardar unos minutos en confirmarlo. Podés seguir mientras tanto: te avisamos cuando quede activa.", + "pendingHint": "No terminaste de autorizar el pago en {{provider}}. Podés reintentarlo o seguir con Free.", + "retry": "Reintentar el pago", + "stayFree": "Seguir con Free", + "startFree": "Empezar gratis", + "choosePro": "Elegir Pro" + }, + "payment": { + "title": "Conectá tus cobros", + "description": "Vinculá tu cuenta de Mercado Pago y cobrale a tus miembros desde el grupo.", + "linked": "Tu cuenta de Mercado Pago quedó vinculada.", + "loading": "Consultando tu cuenta…", + "linkedOn": "Vinculada el {{date}}.", + "connectedHint": "Los pagos de tus grupos van a entrar a esta cuenta.", + "connectHint": "Te llevamos a Mercado Pago para autorizar los cobros. Los pagos entran directo en tu cuenta, sin intermediarios.", + "opening": "Abriendo Mercado Pago…", + "change": "Cambiar de cuenta", + "connect": "Vincular cuenta" + }, + "whatsapp": { + "title": "Conectá tu WhatsApp", + "description": "Gruperly le recuerda los pagos a tus miembros y escribe a los que dejaron de venir, una vez por semana y desde tu número.", + "linked": "Tu WhatsApp quedó vinculado.", + "linkedWith": "Tu WhatsApp quedó vinculado ({{phone}}).", + "qrHint": "Lo vinculás con tu número de teléfono o escaneando un código QR, como WhatsApp Web.", + "metaHint": "Te llevamos a Meta para conectar tu cuenta de WhatsApp Business.", + "perGroup": "Los envíos automáticos los prendés después en cada grupo.", + "opening": "Abriendo…", + "connect": "Vincular WhatsApp" + }, + "group": { + "heading": "Tu primer grupo" + }, + "done": { + "title": "¡Todo listo!", + "description": "Tu grupo se creó. Ya podés invitar miembros y pasar lista.", + "active": "Activo", + "price": "Precio", + "capacity": "Cupo", + "capacityValue": "{{count}} miembros", + "dueDay": "Vencimiento", + "dueDayValue": "Día {{day}} de cada mes", + "plan": "Estás en el plan {{plan}}.", + "freeHint": " Cuando quieras cobrar con Mercado Pago o automatizar WhatsApp, pasate a Pro desde Ajustes.", + "mpConnected": "Vas a cobrar con Mercado Pago. Los pagos entran directo en tu cuenta.", + "mpPending": "Cuando quieras cobrar, vinculá Mercado Pago desde Ajustes. Tu grupo ya quedó creado.", + "waConnected": "Tu WhatsApp está vinculado. Activá los recordatorios de pago y el reenganche desde la ficha del grupo.", + "waPending": "Para enviar recordatorios automáticos, vinculá WhatsApp desde Ajustes.", + "goToPanel": "Ir a mi Panel" + } +} diff --git a/apps/web/src/i18n/locales/pt-BR/onboarding.json b/apps/web/src/i18n/locales/pt-BR/onboarding.json new file mode 100644 index 0000000..6aa50e6 --- /dev/null +++ b/apps/web/src/i18n/locales/pt-BR/onboarding.json @@ -0,0 +1,93 @@ +{ + "steps": { + "welcome": "Boas-vindas", + "country": "País", + "plan": "Plano", + "payment": "Cobranças", + "whatsapp": "WhatsApp", + "group": "Seu grupo", + "done": "Pronto", + "progress": "Progresso do cadastro" + }, + "continue": "Continuar", + "later": "Faço depois", + "signedOut": { + "title": "Sua conta, pronta", + "description": "Entre para configurar suas cobranças e criar seu primeiro grupo.", + "action": "Entrar" + }, + "fallbackName": "professor", + "welcome": { + "title": "Olá, {{name}}!", + "description": "Vamos configurar sua conta em 3 passos. Leva menos de 5 minutos.", + "step1Title": "Conecte sua conta de recebimento", + "step1": "Vincule o Mercado Pago e cobre seus membros pelo grupo.", + "step2Title": "Crie seu primeiro grupo", + "step2": "Dias, horário, preço e vagas da sua aula.", + "step3Title": "Comece a cobrar", + "step3": "Tudo pronto para adicionar membros e cobrar na hora.", + "start": "Começar" + }, + "country": { + "title": "Em que país você vai cobrar?", + "description": "Seus links são gerados na moeda desse país.", + "label": "País" + }, + "plan": { + "title": "Escolha seu plano", + "description": "Comece grátis ou mude para o Pro para cobrar com Mercado Pago e automatizar o WhatsApp.", + "error": "Não conseguimos salvar seu plano. Verifique sua conexão e tente novamente.", + "active": "Pronto! Sua assinatura Pro está ativa.", + "processing": "Processando seu pagamento…", + "pendingTitle": "Sua assinatura Pro ficou pendente", + "processingHint": "O {{provider}} pode levar alguns minutos para confirmar. Você pode continuar enquanto isso: avisamos quando ficar ativa.", + "pendingHint": "Você não terminou de autorizar o pagamento no {{provider}}. Pode tentar de novo ou continuar no Free.", + "retry": "Tentar o pagamento de novo", + "stayFree": "Continuar no Free", + "startFree": "Começar grátis", + "choosePro": "Escolher Pro" + }, + "payment": { + "title": "Conecte suas cobranças", + "description": "Vincule sua conta do Mercado Pago e cobre seus membros pelo grupo.", + "linked": "Sua conta do Mercado Pago foi vinculada.", + "loading": "Consultando sua conta…", + "linkedOn": "Vinculada em {{date}}.", + "connectedHint": "Os pagamentos dos seus grupos vão entrar nesta conta.", + "connectHint": "Vamos te levar ao Mercado Pago para autorizar as cobranças. Os pagamentos entram direto na sua conta, sem intermediários.", + "opening": "Abrindo o Mercado Pago…", + "change": "Trocar de conta", + "connect": "Vincular conta" + }, + "whatsapp": { + "title": "Conecte seu WhatsApp", + "description": "O Gruperly lembra seus membros dos pagamentos e escreve para quem parou de vir, uma vez por semana e pelo seu número.", + "linked": "Seu WhatsApp foi vinculado.", + "linkedWith": "Seu WhatsApp foi vinculado ({{phone}}).", + "qrHint": "Você vincula com seu número de telefone ou escaneando um QR code, como no WhatsApp Web.", + "metaHint": "Vamos te levar à Meta para conectar sua conta do WhatsApp Business.", + "perGroup": "Os envios automáticos você ativa depois em cada grupo.", + "opening": "Abrindo…", + "connect": "Vincular WhatsApp" + }, + "group": { + "heading": "Seu primeiro grupo" + }, + "done": { + "title": "Tudo pronto!", + "description": "Seu grupo foi criado. Agora você pode convidar membros e fazer a chamada.", + "active": "Ativo", + "price": "Preço", + "capacity": "Vagas", + "capacityValue": "{{count}} membros", + "dueDay": "Vencimento", + "dueDayValue": "Todo dia {{day}}", + "plan": "Você está no plano {{plan}}.", + "freeHint": " Quando quiser cobrar com Mercado Pago ou automatizar o WhatsApp, mude para o Pro em Ajustes.", + "mpConnected": "Você vai cobrar com Mercado Pago. Os pagamentos entram direto na sua conta.", + "mpPending": "Quando quiser cobrar, vincule o Mercado Pago em Ajustes. Seu grupo já foi criado.", + "waConnected": "Seu WhatsApp está vinculado. Ative os lembretes de pagamento e o reengajamento na página do grupo.", + "waPending": "Para enviar lembretes automáticos, vincule o WhatsApp em Ajustes.", + "goToPanel": "Ir para o meu painel" + } +}