diff --git a/apps/web/src/features/billing/BillingProvider.tsx b/apps/web/src/features/billing/BillingProvider.tsx index c842482..e505770 100644 --- a/apps/web/src/features/billing/BillingProvider.tsx +++ b/apps/web/src/features/billing/BillingProvider.tsx @@ -4,8 +4,10 @@ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query' import { useNavigate, useSearch } from '@tanstack/react-router' import type { ReactNode } from 'react' import { createContext, useContext, useEffect, useRef, useState } from 'react' +import { errorMessage } from '../../i18n' +import { i18n } from '../../i18n/instance' import { useToast } from '../../components/ui' -import { ApiError, cancelSubscription, getBillingCharges } from '../../lib/api' +import { cancelSubscription, getBillingCharges } from '../../lib/api' import { billingStatusQueryKey, useBillingStatus } from './useBillingStatus' import { useSubscriptionReturnPolling } from './useSubscriptionReturnPolling' @@ -54,7 +56,7 @@ export function BillingProvider({ children }: { children: ReactNode }) { if (!polling.isPolling || announced.current) return if (statusQuery.data?.status === 'AUTHORIZED') { announced.current = true - toast.success('¡Listo! Ya tenés Gruperly Pro.') + toast.success(i18n.t('billing:cancel.welcome')) void queryClient.invalidateQueries({ queryKey: ['billing', 'charges'] }) } // `toast` cambia en cada aviso: el efecto depende solo del estado. @@ -63,11 +65,11 @@ export function BillingProvider({ children }: { children: ReactNode }) { const cancelMutation = useMutation({ mutationFn: cancelSubscription, onSuccess: () => { - toast.success('Cancelaste tu suscripción. Seguís con Pro hasta el fin del período pago.') + toast.success(i18n.t('billing:cancel.done')) void queryClient.invalidateQueries({ queryKey: billingStatusQueryKey }) }, onError: (error: Error) => { - toast.error(error instanceof ApiError ? error.message : 'No pudimos cancelar la suscripción.') + toast.error(errorMessage(error, i18n.t('billing:cancel.error'))) }, }) diff --git a/apps/web/src/features/billing/BillingView.tsx b/apps/web/src/features/billing/BillingView.tsx index f08808b..e07abb1 100644 --- a/apps/web/src/features/billing/BillingView.tsx +++ b/apps/web/src/features/billing/BillingView.tsx @@ -10,15 +10,19 @@ import { ChargesList } from './ChargesList' import { PlanOptionCard } from './PlanOptionCard' import { PlanSummaryCard } from './PlanSummaryCard' import { SubscribeModal } from './SubscribeModal' +import { useTranslation } from 'react-i18next' export function BillingView() { const { statusQuery, openSubscribe, cancel, isCancelling } = useBilling() const [isConfirmingCancel, setIsConfirmingCancel] = useState(false) + const { t } = useTranslation(['billing', 'common']) const status = statusQuery.data const subscribed = status?.status === 'AUTHORIZED' || status?.status === 'PAUSED' const pending = status?.status === 'PENDING' - const proPrice = status ? `${formatPrice(status.priceAmount, status.currency)} / mes` : undefined + const proPrice = status + ? t('view.perMonth', { price: formatPrice(status.priceAmount, status.currency) }) + : undefined return (
@@ -28,10 +32,10 @@ export function BillingView() { className="mb-2 hidden items-center gap-1 text-sm text-foreground/60 hover:text-primary lg:inline-flex" > - Ajustes + {t('view.back')} -

Tu plan

-

Elegí cómo usar Gruperly.

+

{t('view.title')}

+

{t('view.subtitle')}

@@ -48,15 +52,15 @@ export function BillingView() { > {subscribed ? ( ) : status.availableInCountry ? ( ) : ( -

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

+

{t('view.unavailable')}

)} diff --git a/apps/web/src/features/billing/CancelSubscriptionModal.tsx b/apps/web/src/features/billing/CancelSubscriptionModal.tsx index d124742..a62c064 100644 --- a/apps/web/src/features/billing/CancelSubscriptionModal.tsx +++ b/apps/web/src/features/billing/CancelSubscriptionModal.tsx @@ -1,6 +1,7 @@ import { Loader2 } from 'lucide-react' import { Button, Modal } from '../../components/ui' import { formatBillingDate } from './copy' +import { useTranslation } from 'react-i18next' type CancelSubscriptionModalProps = { isOpen: boolean @@ -19,25 +20,26 @@ export function CancelSubscriptionModal({ onConfirm, }: CancelSubscriptionModalProps) { const until = formatBillingDate(paidThrough) + const { t } = useTranslation(['billing', 'common']) return (
diff --git a/apps/web/src/features/billing/ChargesList.tsx b/apps/web/src/features/billing/ChargesList.tsx index 2cd0a4f..b1d78bc 100644 --- a/apps/web/src/features/billing/ChargesList.tsx +++ b/apps/web/src/features/billing/ChargesList.tsx @@ -2,19 +2,15 @@ import { Button } from '../../components/ui' import { formatPrice } from '../../lib/format' import { useBilling } from './BillingProvider' import { formatBillingDate } from './copy' +import { useTranslation } from 'react-i18next' -const CHARGE_STATUS_LABELS: Record = { - approved: 'Pagado', - rejected: 'Rechazado', - pending: 'Pendiente', - in_process: 'En proceso', - cancelled: 'Cancelado', - refunded: 'Devuelto', -} +/** Mercado Pago / Stripe statuses with copy in `billing:charges.`. */ +const KNOWN_CHARGE_STATUSES = new Set(['approved', 'rejected', 'pending', 'in_process', 'cancelled', 'refunded']) /** Historial de cobros de la suscripción a Pro. */ export function ChargesList() { const { chargesQuery, chargesPage, setChargesPage } = useBilling() + const { t } = useTranslation(['billing', 'common']) const charges = chargesQuery.data?.data ?? [] const totalPages = chargesQuery.data?.pagination.totalPages ?? 0 @@ -22,7 +18,7 @@ export function ChargesList() { return (
-

Historial de pagos

+

{t('charges.title')}

    {charges.map((charge) => (
  • @@ -33,7 +29,7 @@ export function ChargesList() {

    - {CHARGE_STATUS_LABELS[charge.status] ?? charge.status} + {KNOWN_CHARGE_STATUSES.has(charge.status) ? t(`charges.${charge.status}` as 'charges.approved') : charge.status}
  • ))} @@ -46,7 +42,7 @@ export function ChargesList() { disabled={chargesPage <= 1} onClick={() => setChargesPage(chargesPage - 1)} > - Anteriores + {t('charges.prev')} ) : null} diff --git a/apps/web/src/features/billing/PlanNotice.tsx b/apps/web/src/features/billing/PlanNotice.tsx index a20245e..2506136 100644 --- a/apps/web/src/features/billing/PlanNotice.tsx +++ b/apps/web/src/features/billing/PlanNotice.tsx @@ -4,6 +4,7 @@ import { useAuth } from '../../context/AuthProvider' import { cn } from '../../lib/utils' import { planNoticeMessage } from './copy' import { useBillingStatus } from './useBillingStatus' +import { useTranslation } from 'react-i18next' /** * Aviso global del plan: cuenta en solo lectura o Pro en período de gracia. @@ -12,6 +13,7 @@ import { useBillingStatus } from './useBillingStatus' */ export function PlanNotice() { const { user } = useAuth() + const { t } = useTranslation(['billing', 'common']) const statusQuery = useBillingStatus({ enabled: !!user }) const pathname = useLocation({ select: (location) => location.pathname }) @@ -36,7 +38,7 @@ export function PlanNotice() { danger ? 'text-danger' : 'text-warning', )} > - Ver plan + {t('notice.seePlan')} ) diff --git a/apps/web/src/features/billing/PlanOptionCard.tsx b/apps/web/src/features/billing/PlanOptionCard.tsx index 940d046..e93aa94 100644 --- a/apps/web/src/features/billing/PlanOptionCard.tsx +++ b/apps/web/src/features/billing/PlanOptionCard.tsx @@ -4,6 +4,7 @@ import type { ReactNode } from 'react' import { Badge } from '../../components/ui' import { cn } from '../../lib/utils' import { PLAN_NAMES, planFeatureList } from './copy' +import { useTranslation } from 'react-i18next' type PlanOptionCardProps = { plan: Plan @@ -18,6 +19,7 @@ type PlanOptionCardProps = { /** Una tarjeta de plan, igual en la pantalla del plan y en el onboarding. */ export function PlanOptionCard({ plan, limits, price, current, highlighted, children }: PlanOptionCardProps) { + const { t } = useTranslation(['billing', 'common']) return (

    {PLAN_NAMES[plan]}

    - {current ? Tu plan : null} + {current ? {t('option.yourPlan')} : null}
    -

    {price ?? 'Gratis'}

    +

    {price ?? t('option.free')}

      {planFeatureList(limits).map((feature) => ( diff --git a/apps/web/src/features/billing/PlanSettingsCard.tsx b/apps/web/src/features/billing/PlanSettingsCard.tsx index c5658a7..2206a4f 100644 --- a/apps/web/src/features/billing/PlanSettingsCard.tsx +++ b/apps/web/src/features/billing/PlanSettingsCard.tsx @@ -3,10 +3,12 @@ import { ChevronRight, Sparkles } from 'lucide-react' import { Badge } from '../../components/ui' import { PLAN_NAMES, planBadgeVariant } from './copy' import { useBillingStatus } from './useBillingStatus' +import { useTranslation } from 'react-i18next' /** Entrada a la pantalla del plan desde Ajustes. */ export function PlanSettingsCard() { const statusQuery = useBillingStatus() + const { t } = useTranslation(['billing', 'common']) const status = statusQuery.data return ( @@ -16,12 +18,12 @@ export function PlanSettingsCard() {
      -

      Plan

      -

      Tu plan de Gruperly y tus pagos

      +

      {t('settings.title')}

      +

      {t('settings.description')}

      {status ? ( - {status.readOnly ? 'Solo lectura' : PLAN_NAMES[status.plan]} + {status.readOnly ? t('settings.readOnly') : PLAN_NAMES[status.plan]} ) : null} diff --git a/apps/web/src/features/billing/PlanSummaryCard.tsx b/apps/web/src/features/billing/PlanSummaryCard.tsx index 9e1b825..2944e1f 100644 --- a/apps/web/src/features/billing/PlanSummaryCard.tsx +++ b/apps/web/src/features/billing/PlanSummaryCard.tsx @@ -11,17 +11,19 @@ import { planNoticeMessage, subscriptionStatusLabel, } from './copy' +import { useTranslation } from 'react-i18next' /** El plan actual: estado de la suscripción, próximo cobro y uso contra los límites. */ export function PlanSummaryCard() { const { statusQuery } = useBilling() + const { t } = useTranslation(['billing', 'common']) const status = statusQuery.data if (!status) { return (
      -

      Consultando tu plan…

      +

      {t('summary.loading')}

      ) } @@ -34,27 +36,27 @@ export function PlanSummaryCard() {
      -

      Plan {PLAN_NAMES[status.plan]}

      +

      {t('summary.plan', { plan: PLAN_NAMES[status.plan] })}

      - {status.readOnly ? 'Solo lectura' : subscriptionStatusLabel(status.status)} + {status.readOnly ? t('settings.readOnly') : subscriptionStatusLabel(status.status)}
      {status.status === 'AUTHORIZED' && nextPayment ? (

      - Próximo cobro: {formatPrice(status.priceAmount, status.currency)} el {nextPayment} + {t('summary.next', { amount: formatPrice(status.priceAmount, status.currency), date: nextPayment })}

      ) : null} {status.status === 'PENDING' ? (

      - Estamos esperando que {BILLING_PROVIDER_NAMES[status.provider]} confirme tu suscripción. + {t('summary.pending', { provider: BILLING_PROVIDER_NAMES[status.provider] })}

      ) : null} {status.status === 'CANCELLED' && status.plan === 'PRO' && paidThrough ? ( -

      Pagado hasta el {paidThrough}.

      +

      {t('summary.paidThrough', { date: paidThrough })}

      ) : null} {!status.enforced ? (

      - Por ahora todas las funciones están habilitadas para todas las cuentas. + {t('summary.notEnforced')}

      ) : null}
      @@ -73,13 +75,13 @@ export function PlanSummaryCard() {
      -
      Grupos
      +
      {t('summary.groups')}
      {formatUsage(status.usage.groups, status.limits.maxGroups)}
      -
      Alumnos activos
      +
      {t('summary.students')}
      {formatUsage(status.usage.attendees, status.limits.maxAttendees)}
      diff --git a/apps/web/src/features/billing/PlanUpgradePrompt.tsx b/apps/web/src/features/billing/PlanUpgradePrompt.tsx index 8d8eb52..db6c0b9 100644 --- a/apps/web/src/features/billing/PlanUpgradePrompt.tsx +++ b/apps/web/src/features/billing/PlanUpgradePrompt.tsx @@ -2,6 +2,7 @@ import { useNavigate } from '@tanstack/react-router' import { Sparkles } from 'lucide-react' import { Button, Modal } from '../../components/ui' import { dismissPlanPrompt, usePlanPrompt } from './plan-prompt' +import { useTranslation } from 'react-i18next' /** * Aviso de "esto es de Pro". Lo dispara cualquier 402 de plan (ver el @@ -10,19 +11,20 @@ import { dismissPlanPrompt, usePlanPrompt } from './plan-prompt' */ export function PlanUpgradePrompt() { const detail = usePlanPrompt() + const { t } = useTranslation(['billing', 'common']) const navigate = useNavigate() return (
      diff --git a/apps/web/src/features/billing/SubscribeForm.tsx b/apps/web/src/features/billing/SubscribeForm.tsx index 9b1fcfd..34515c9 100644 --- a/apps/web/src/features/billing/SubscribeForm.tsx +++ b/apps/web/src/features/billing/SubscribeForm.tsx @@ -3,6 +3,7 @@ import { Loader2 } from 'lucide-react' import { type FormEvent, useState } from 'react' import { Button, Input, Label } from '../../components/ui' import { BILLING_PROVIDER_NAMES } from './copy' +import { useTranslation } from 'react-i18next' type SubscribeFormProps = { provider: BillingProviderId @@ -26,11 +27,12 @@ export function SubscribeForm({ defaultEmail, isPending, error, - submitLabel = `Ir a ${BILLING_PROVIDER_NAMES[provider]}`, + submitLabel, onSubmit, onCancel, }: SubscribeFormProps) { const [email, setEmail] = useState(defaultEmail) + const { t } = useTranslation(['billing', 'common']) const asksEmail = provider === 'MERCADO_PAGO' const handleSubmit = (event: FormEvent) => { @@ -42,7 +44,7 @@ export function SubscribeForm({
      {asksEmail ? (
      - + setEmail(event.target.value)} />

      - Tenés que entrar a Mercado Pago con este mismo email para autorizar el débito mensual. + {t('subscribe.payerEmailHint')}

      ) : null} @@ -63,12 +65,12 @@ export function SubscribeForm({
      {onCancel ? ( ) : null}
      diff --git a/apps/web/src/features/billing/SubscribeModal.tsx b/apps/web/src/features/billing/SubscribeModal.tsx index bab0b58..0de769b 100644 --- a/apps/web/src/features/billing/SubscribeModal.tsx +++ b/apps/web/src/features/billing/SubscribeModal.tsx @@ -4,9 +4,11 @@ import { useBilling } from './BillingProvider' import { subscribeDescription } from './copy' import { SubscribeForm } from './SubscribeForm' import { useStartSubscription } from './useStartSubscription' +import { useTranslation } from 'react-i18next' export function SubscribeModal() { const { user } = useAuth() + const { t } = useTranslation(['billing', 'common']) const { isSubscribeOpen, closeSubscribe, statusQuery } = useBilling() const subscription = useStartSubscription() const provider = statusQuery.data?.provider ?? 'MERCADO_PAGO' @@ -15,7 +17,7 @@ export function SubscribeModal() { diff --git a/apps/web/src/features/billing/copy.ts b/apps/web/src/features/billing/copy.ts index 9dd1b1f..017019f 100644 --- a/apps/web/src/features/billing/copy.ts +++ b/apps/web/src/features/billing/copy.ts @@ -7,6 +7,7 @@ import type { SubscriptionStatus, } from '@gruperly/shared' import type { BadgeVariant } from '../../components/ui' +import { i18n } from '../../i18n/instance' /* Copy del plan de Gruperly en un solo lugar: Ajustes, la pantalla del plan, el paso del onboarding y los avisos tienen que decir lo mismo. Funciones puras, @@ -14,8 +15,9 @@ import type { BadgeVariant } from '../../components/ui' export const PLAN_NAMES: Record = { FREE: 'Free', PRO: 'Pro' } -export const SUBSCRIBE_ERROR_MESSAGE = - 'No pudimos abrir la página de pago. Revisá tu conexión e intentá de nuevo.' +export function subscribeErrorMessage(): string { + return i18n.t('billing:subscribeError') +} /* Quién cobra Pro: Mercado Pago en Argentina, Stripe en el resto. Es solo la suscripción a Gruperly; los cobros a alumnos siguen siendo con Mercado Pago. */ @@ -26,9 +28,7 @@ export const BILLING_PROVIDER_NAMES: Record = { /** Qué pasa al tocar "Pasar a Pro", según quién cobra. */ export function subscribeDescription(provider: BillingProviderId): string { - return provider === 'STRIPE' - ? 'Te llevamos a Stripe para cargar tu tarjeta. El cobro es mensual y podés cancelarlo cuando quieras.' - : 'Te llevamos a Mercado Pago para autorizar el débito mensual. Podés cancelarlo cuando quieras.' + return i18n.t(`billing:subscribeDescription.${provider}`) } /** Lo que incluye cada plan, como lista para las tarjetas de comparación. */ @@ -37,25 +37,25 @@ export function planFeatureList(limits: PlanLimits): { label: string; included: { label: limits.maxGroups === null - ? 'Grupos ilimitados' - : `${limits.maxGroups} ${limits.maxGroups === 1 ? 'grupo' : 'grupos'}`, + ? i18n.t('billing:features.unlimitedGroups') + : i18n.t('billing:features.groups', { count: limits.maxGroups }), included: true, }, { label: limits.maxAttendees === null - ? 'Alumnos ilimitados' - : `Hasta ${limits.maxAttendees} alumnos activos`, + ? i18n.t('billing:features.unlimitedStudents') + : i18n.t('billing:features.students', { count: limits.maxAttendees }), included: true, }, - { label: 'Cobros con Mercado Pago', included: limits.mpCharges }, - { label: 'Mensajes automáticos por WhatsApp', included: limits.whatsappAutomations }, + { label: i18n.t('billing:features.mpCharges'), included: limits.mpCharges }, + { label: i18n.t('billing:features.whatsapp'), included: limits.whatsappAutomations }, ] } -export const PLAN_FEATURE_REQUIRED_MESSAGES: Record = { - mpCharges: 'Cobrar con Mercado Pago está disponible en el plan Pro.', - whatsappAutomations: 'Los mensajes automáticos de WhatsApp están disponibles en el plan Pro.', +/** The same copy as the backend's `plan_feature_required` problem. */ +export function planFeatureRequiredMessage(feature: PlanFeature): string { + return i18n.t(`errors:codes.plan_feature_required_${feature}`) } /** @@ -69,15 +69,12 @@ export function hasPlanFeature(status: BillingStatusDto | undefined, feature: Pl export function subscriptionStatusLabel(status: SubscriptionStatus | null): string { switch (status) { case 'AUTHORIZED': - return 'Activa' case 'PENDING': - return 'Pendiente de pago' case 'PAUSED': - return 'Pausada' case 'CANCELLED': - return 'Cancelada' + return i18n.t(`billing:subscriptionStatus.${status}`) default: - return 'Sin suscripción' + return i18n.t('billing:subscriptionStatus.NONE') } } @@ -91,14 +88,14 @@ export function formatBillingDate(iso: string | null): string | null { if (!iso) return null const date = new Date(iso) if (Number.isNaN(date.getTime())) return null - return new Intl.DateTimeFormat('es', { day: 'numeric', month: 'short', year: 'numeric' }).format( + return new Intl.DateTimeFormat(i18n.language, { day: 'numeric', month: 'short', year: 'numeric' }).format( date, ) } /** "3 de 15": el uso contra el límite, o solo el uso cuando no hay límite. */ export function formatUsage(used: number, limit: number | null): string { - return limit === null ? `${used}` : `${used} de ${limit}` + return limit === null ? `${used}` : i18n.t('billing:usage', { used, limit }) } const PLAN_PROBLEM_CODES = ['plan_limit_reached', 'plan_feature_required', 'plan_read_only'] @@ -124,7 +121,7 @@ export function planNoticeMessage(status: BillingStatusDto): { tone: 'danger' | if (status.readOnly) { return { tone: 'danger', - text: 'Tu cuenta está en solo lectura: superás los límites del plan Free. Pasate a Pro o reducí tus alumnos para volver a editar.', + text: i18n.t('billing:notice.readOnly'), } } const graceUntil = formatBillingDate(status.graceUntil) @@ -133,8 +130,11 @@ export function planNoticeMessage(status: BillingStatusDto): { tone: 'danger' | tone: 'warning', text: status.status === 'CANCELLED' - ? `Cancelaste Pro: lo seguís teniendo hasta el ${graceUntil}.` - : `No pudimos cobrar tu suscripción a Pro. Revisá tu medio de pago en ${BILLING_PROVIDER_NAMES[status.provider]} antes del ${graceUntil}.`, + ? i18n.t('billing:notice.cancelled', { date: graceUntil }) + : i18n.t('billing:notice.paymentFailed', { + provider: BILLING_PROVIDER_NAMES[status.provider], + date: graceUntil, + }), } } return null diff --git a/apps/web/src/features/billing/index.ts b/apps/web/src/features/billing/index.ts index 597f058..2615296 100644 --- a/apps/web/src/features/billing/index.ts +++ b/apps/web/src/features/billing/index.ts @@ -4,7 +4,7 @@ export { formatUsage, hasPlanFeature, isPlanProblem, - PLAN_FEATURE_REQUIRED_MESSAGES, + planFeatureRequiredMessage, PLAN_NAMES, planFeatureList, planNoticeMessage, diff --git a/apps/web/src/features/billing/useStartSubscription.ts b/apps/web/src/features/billing/useStartSubscription.ts index 216a92b..b1ab9eb 100644 --- a/apps/web/src/features/billing/useStartSubscription.ts +++ b/apps/web/src/features/billing/useStartSubscription.ts @@ -1,7 +1,8 @@ import type { BillingReturnTo } from '@gruperly/shared' import { useState } from 'react' -import { ApiError, subscribeToPro } from '../../lib/api' -import { SUBSCRIBE_ERROR_MESSAGE } from './copy' +import { subscribeToPro } from '../../lib/api' +import { errorMessage } from '../../i18n' +import { subscribeErrorMessage } from './copy' /** * Empieza la suscripción a Pro. Como la vinculación de Mercado Pago, no se @@ -19,7 +20,7 @@ export function useStartSubscription() { const { checkoutUrl } = await subscribeToPro({ payerEmail, returnTo }) window.location.assign(checkoutUrl) } catch (caught) { - setError(caught instanceof ApiError && caught.problem?.detail ? caught.problem.detail : SUBSCRIBE_ERROR_MESSAGE) + setError(errorMessage(caught, subscribeErrorMessage())) setIsStarting(false) } } diff --git a/apps/web/src/features/groups/detail/GroupDetailView.tsx b/apps/web/src/features/groups/detail/GroupDetailView.tsx index 8f433e6..6ac3772 100644 --- a/apps/web/src/features/groups/detail/GroupDetailView.tsx +++ b/apps/web/src/features/groups/detail/GroupDetailView.tsx @@ -5,7 +5,7 @@ import { useState } from 'react' import { Button } from '../../../components/ui' import { hasPlanFeature, - PLAN_FEATURE_REQUIRED_MESSAGES, + planFeatureRequiredMessage, showPlanPrompt, useBillingStatus, } from '../../billing' @@ -41,7 +41,7 @@ export function GroupDetailView() { const billingQuery = useBillingStatus({ enabled: isGroupOwner }) const handleCharge = () => { if (isGroupOwner && !hasPlanFeature(billingQuery.data, 'mpCharges')) { - showPlanPrompt(PLAN_FEATURE_REQUIRED_MESSAGES.mpCharges) + showPlanPrompt(planFeatureRequiredMessage('mpCharges')) return } setIsChargeModalOpen(true) diff --git a/apps/web/src/i18n/i18next.d.ts b/apps/web/src/i18n/i18next.d.ts index a121342..27ef5e9 100644 --- a/apps/web/src/i18n/i18next.d.ts +++ b/apps/web/src/i18n/i18next.d.ts @@ -14,6 +14,7 @@ import type attention from './locales/es-AR/attention.json' import type attendeeDetail from './locales/es-AR/attendeeDetail.json' import type classAttendance from './locales/es-AR/classAttendance.json' import type payments from './locales/es-AR/payments.json' +import type billing from './locales/es-AR/billing.json' import type validation from './locales/es-AR/validation.json' // es-AR es la fuente: una clave que no exista ahí rompe el typecheck. @@ -28,6 +29,7 @@ declare module 'i18next' { pwa: typeof pwa settings: typeof settings validation: typeof validation + 'billing': typeof billing 'payments': typeof payments 'classAttendance': typeof classAttendance 'attendeeDetail': typeof attendeeDetail diff --git a/apps/web/src/i18n/locales/en/billing.json b/apps/web/src/i18n/locales/en/billing.json new file mode 100644 index 0000000..e9a5784 --- /dev/null +++ b/apps/web/src/i18n/locales/en/billing.json @@ -0,0 +1,91 @@ +{ + "subscribeError": "We couldn't open the payment page. Check your connection and try again.", + "subscribeDescription": { + "STRIPE": "We'll take you to Stripe to add your card. You're billed monthly and can cancel anytime.", + "MERCADO_PAGO": "We'll take you to Mercado Pago to authorize the monthly charge. You can cancel anytime." + }, + "features": { + "unlimitedGroups": "Unlimited groups", + "groups_one": "{{count}} group", + "groups_other": "{{count}} groups", + "unlimitedStudents": "Unlimited students", + "students": "Up to {{count}} active students", + "mpCharges": "Payments with Mercado Pago", + "whatsapp": "Automatic WhatsApp messages" + }, + "subscriptionStatus": { + "AUTHORIZED": "Active", + "PENDING": "Payment pending", + "PAUSED": "Paused", + "CANCELLED": "Cancelled", + "NONE": "No subscription" + }, + "usage": "{{used}} of {{limit}}", + "notice": { + "readOnly": "Your account is read-only: you're over the Free plan's limits. Upgrade to Pro or reduce your students to edit again.", + "cancelled": "You cancelled Pro: you keep it until {{date}}.", + "paymentFailed": "We couldn't charge your Pro subscription. Check your payment method in {{provider}} before {{date}}.", + "seePlan": "See plan" + }, + "settings": { + "title": "Plan", + "description": "Your Gruperly plan and payments", + "readOnly": "Read-only" + }, + "subscribe": { + "title": "Upgrade to Pro", + "goTo": "Go to {{provider}}", + "payerEmail": "Your Mercado Pago account email", + "payerEmailHint": "You need to sign in to Mercado Pago with this same email to authorize the monthly charge.", + "opening": "Opening…" + }, + "upgrade": { + "title": "Available on Pro", + "later": "Not now", + "seePlans": "See plans" + }, + "cancel": { + "title": "Cancel Pro", + "descriptionUntil": "We won't charge you again. You keep Pro until {{date}}; then your account moves to Free.", + "description": "We won't charge you again and your account moves to Free.", + "back": "Back", + "confirm": "Cancel subscription", + "done": "You cancelled your subscription. You keep Pro until the end of the paid period.", + "error": "We couldn't cancel the subscription.", + "welcome": "All set! You now have Gruperly Pro." + }, + "option": { + "yourPlan": "Your plan", + "free": "Free" + }, + "charges": { + "title": "Payment history", + "approved": "Paid", + "rejected": "Declined", + "pending": "Pending", + "in_process": "Processing", + "cancelled": "Cancelled", + "refunded": "Refunded", + "prev": "Previous", + "next": "Next" + }, + "view": { + "back": "Settings", + "title": "Your plan", + "subtitle": "Choose how you use Gruperly.", + "perMonth": "{{price}} / month", + "retry": "Retry payment", + "upgrade": "Upgrade to Pro", + "unavailable": "Not available in your country yet." + }, + "summary": { + "loading": "Checking your plan…", + "plan": "{{plan}} plan", + "next": "Next charge: {{amount}} on {{date}}", + "pending": "We're waiting for {{provider}} to confirm your subscription.", + "paidThrough": "Paid through {{date}}.", + "notEnforced": "For now, every feature is enabled for every account.", + "groups": "Groups", + "students": "Active students" + } +} diff --git a/apps/web/src/i18n/locales/es-419/billing.json b/apps/web/src/i18n/locales/es-419/billing.json new file mode 100644 index 0000000..b3af52d --- /dev/null +++ b/apps/web/src/i18n/locales/es-419/billing.json @@ -0,0 +1,91 @@ +{ + "subscribeError": "No pudimos abrir la página de pago. Revisa tu conexión e inténtalo de nuevo.", + "subscribeDescription": { + "STRIPE": "Te llevamos a Stripe para registrar tu tarjeta. El cobro es mensual y puedes cancelarlo cuando quieras.", + "MERCADO_PAGO": "Te llevamos a Mercado Pago para autorizar el débito mensual. Puedes cancelarlo cuando quieras." + }, + "features": { + "unlimitedGroups": "Grupos ilimitados", + "groups_one": "{{count}} grupo", + "groups_other": "{{count}} grupos", + "unlimitedStudents": "Alumnos ilimitados", + "students": "Hasta {{count}} alumnos activos", + "mpCharges": "Cobros con Mercado Pago", + "whatsapp": "Mensajes automáticos por WhatsApp" + }, + "subscriptionStatus": { + "AUTHORIZED": "Activa", + "PENDING": "Pendiente de pago", + "PAUSED": "Pausada", + "CANCELLED": "Cancelada", + "NONE": "Sin suscripción" + }, + "usage": "{{used}} de {{limit}}", + "notice": { + "readOnly": "Tu cuenta está en solo lectura: superas los límites del plan Free. Cámbiate a Pro o reduce tus alumnos para volver a editar.", + "cancelled": "Cancelaste Pro: lo sigues teniendo hasta el {{date}}.", + "paymentFailed": "No pudimos cobrar tu suscripción a Pro. Revisa tu medio de pago en {{provider}} antes del {{date}}.", + "seePlan": "Ver plan" + }, + "settings": { + "title": "Plan", + "description": "Tu plan de Gruperly y tus pagos", + "readOnly": "Solo lectura" + }, + "subscribe": { + "title": "Cámbiate a Pro", + "goTo": "Ir a {{provider}}", + "payerEmail": "Email de tu cuenta de Mercado Pago", + "payerEmailHint": "Tienes que entrar a Mercado Pago con este mismo email para autorizar el débito mensual.", + "opening": "Abriendo…" + }, + "upgrade": { + "title": "Disponible en Pro", + "later": "Ahora no", + "seePlans": "Ver planes" + }, + "cancel": { + "title": "Cancelar Pro", + "descriptionUntil": "No te cobraremos más. Sigues con Pro hasta el {{date}}; después tu cuenta pasa a Free.", + "description": "No te cobraremos más y tu cuenta pasa a Free.", + "back": "Volver", + "confirm": "Cancelar suscripción", + "done": "Cancelaste tu suscripción. Sigues con Pro hasta el fin del período pagado.", + "error": "No pudimos cancelar la suscripción.", + "welcome": "¡Listo! Ya tienes Gruperly Pro." + }, + "option": { + "yourPlan": "Tu plan", + "free": "Gratis" + }, + "charges": { + "title": "Historial de pagos", + "approved": "Pagado", + "rejected": "Rechazado", + "pending": "Pendiente", + "in_process": "En proceso", + "cancelled": "Cancelado", + "refunded": "Devuelto", + "prev": "Anteriores", + "next": "Siguientes" + }, + "view": { + "back": "Ajustes", + "title": "Tu plan", + "subtitle": "Elige cómo usar Gruperly.", + "perMonth": "{{price}} / mes", + "retry": "Reintentar el pago", + "upgrade": "Cambiarme a Pro", + "unavailable": "Todavía no está disponible en tu país." + }, + "summary": { + "loading": "Consultando tu plan…", + "plan": "Plan {{plan}}", + "next": "Próximo cobro: {{amount}} el {{date}}", + "pending": "Estamos esperando que {{provider}} confirme tu suscripción.", + "paidThrough": "Pagado hasta el {{date}}.", + "notEnforced": "Por ahora todas las funciones están habilitadas para todas las cuentas.", + "groups": "Grupos", + "students": "Alumnos activos" + } +} diff --git a/apps/web/src/i18n/locales/es-AR/billing.json b/apps/web/src/i18n/locales/es-AR/billing.json new file mode 100644 index 0000000..1aaf781 --- /dev/null +++ b/apps/web/src/i18n/locales/es-AR/billing.json @@ -0,0 +1,91 @@ +{ + "subscribeError": "No pudimos abrir la página de pago. Revisá tu conexión e intentá de nuevo.", + "subscribeDescription": { + "STRIPE": "Te llevamos a Stripe para cargar tu tarjeta. El cobro es mensual y podés cancelarlo cuando quieras.", + "MERCADO_PAGO": "Te llevamos a Mercado Pago para autorizar el débito mensual. Podés cancelarlo cuando quieras." + }, + "features": { + "unlimitedGroups": "Grupos ilimitados", + "groups_one": "{{count}} grupo", + "groups_other": "{{count}} grupos", + "unlimitedStudents": "Alumnos ilimitados", + "students": "Hasta {{count}} alumnos activos", + "mpCharges": "Cobros con Mercado Pago", + "whatsapp": "Mensajes automáticos por WhatsApp" + }, + "subscriptionStatus": { + "AUTHORIZED": "Activa", + "PENDING": "Pendiente de pago", + "PAUSED": "Pausada", + "CANCELLED": "Cancelada", + "NONE": "Sin suscripción" + }, + "usage": "{{used}} de {{limit}}", + "notice": { + "readOnly": "Tu cuenta está en solo lectura: superás los límites del plan Free. Pasate a Pro o reducí tus alumnos para volver a editar.", + "cancelled": "Cancelaste Pro: lo seguís teniendo hasta el {{date}}.", + "paymentFailed": "No pudimos cobrar tu suscripción a Pro. Revisá tu medio de pago en {{provider}} antes del {{date}}.", + "seePlan": "Ver plan" + }, + "settings": { + "title": "Plan", + "description": "Tu plan de Gruperly y tus pagos", + "readOnly": "Solo lectura" + }, + "subscribe": { + "title": "Pasate a Pro", + "goTo": "Ir a {{provider}}", + "payerEmail": "Email de tu cuenta de Mercado Pago", + "payerEmailHint": "Tenés que entrar a Mercado Pago con este mismo email para autorizar el débito mensual.", + "opening": "Abriendo…" + }, + "upgrade": { + "title": "Disponible en Pro", + "later": "Ahora no", + "seePlans": "Ver planes" + }, + "cancel": { + "title": "Cancelar Pro", + "descriptionUntil": "No te vamos a cobrar más. Seguís con Pro hasta el {{date}}; después tu cuenta pasa a Free.", + "description": "No te vamos a cobrar más y tu cuenta pasa a Free.", + "back": "Volver", + "confirm": "Cancelar suscripción", + "done": "Cancelaste tu suscripción. Seguís con Pro hasta el fin del período pago.", + "error": "No pudimos cancelar la suscripción.", + "welcome": "¡Listo! Ya tenés Gruperly Pro." + }, + "option": { + "yourPlan": "Tu plan", + "free": "Gratis" + }, + "charges": { + "title": "Historial de pagos", + "approved": "Pagado", + "rejected": "Rechazado", + "pending": "Pendiente", + "in_process": "En proceso", + "cancelled": "Cancelado", + "refunded": "Devuelto", + "prev": "Anteriores", + "next": "Siguientes" + }, + "view": { + "back": "Ajustes", + "title": "Tu plan", + "subtitle": "Elegí cómo usar Gruperly.", + "perMonth": "{{price}} / mes", + "retry": "Reintentar el pago", + "upgrade": "Pasar a Pro", + "unavailable": "Todavía no está disponible en tu país." + }, + "summary": { + "loading": "Consultando tu plan…", + "plan": "Plan {{plan}}", + "next": "Próximo cobro: {{amount}} el {{date}}", + "pending": "Estamos esperando que {{provider}} confirme tu suscripción.", + "paidThrough": "Pagado hasta el {{date}}.", + "notEnforced": "Por ahora todas las funciones están habilitadas para todas las cuentas.", + "groups": "Grupos", + "students": "Alumnos activos" + } +} diff --git a/apps/web/src/i18n/locales/pt-BR/billing.json b/apps/web/src/i18n/locales/pt-BR/billing.json new file mode 100644 index 0000000..549bac0 --- /dev/null +++ b/apps/web/src/i18n/locales/pt-BR/billing.json @@ -0,0 +1,91 @@ +{ + "subscribeError": "Não conseguimos abrir a página de pagamento. Verifique sua conexão e tente novamente.", + "subscribeDescription": { + "STRIPE": "Vamos te levar ao Stripe para cadastrar seu cartão. A cobrança é mensal e você pode cancelar quando quiser.", + "MERCADO_PAGO": "Vamos te levar ao Mercado Pago para autorizar o débito mensal. Você pode cancelar quando quiser." + }, + "features": { + "unlimitedGroups": "Grupos ilimitados", + "groups_one": "{{count}} grupo", + "groups_other": "{{count}} grupos", + "unlimitedStudents": "Alunos ilimitados", + "students": "Até {{count}} alunos ativos", + "mpCharges": "Cobranças com Mercado Pago", + "whatsapp": "Mensagens automáticas pelo WhatsApp" + }, + "subscriptionStatus": { + "AUTHORIZED": "Ativa", + "PENDING": "Pagamento pendente", + "PAUSED": "Pausada", + "CANCELLED": "Cancelada", + "NONE": "Sem assinatura" + }, + "usage": "{{used}} de {{limit}}", + "notice": { + "readOnly": "Sua conta está somente leitura: você ultrapassa os limites do plano Free. Mude para o Pro ou reduza seus alunos para voltar a editar.", + "cancelled": "Você cancelou o Pro: ele continua ativo até {{date}}.", + "paymentFailed": "Não conseguimos cobrar sua assinatura Pro. Verifique sua forma de pagamento em {{provider}} antes de {{date}}.", + "seePlan": "Ver plano" + }, + "settings": { + "title": "Plano", + "description": "Seu plano do Gruperly e seus pagamentos", + "readOnly": "Somente leitura" + }, + "subscribe": { + "title": "Mude para o Pro", + "goTo": "Ir para {{provider}}", + "payerEmail": "E-mail da sua conta do Mercado Pago", + "payerEmailHint": "Você precisa entrar no Mercado Pago com este mesmo e-mail para autorizar o débito mensal.", + "opening": "Abrindo…" + }, + "upgrade": { + "title": "Disponível no Pro", + "later": "Agora não", + "seePlans": "Ver planos" + }, + "cancel": { + "title": "Cancelar Pro", + "descriptionUntil": "Não vamos cobrar mais. Você continua com o Pro até {{date}}; depois sua conta passa para o Free.", + "description": "Não vamos cobrar mais e sua conta passa para o Free.", + "back": "Voltar", + "confirm": "Cancelar assinatura", + "done": "Você cancelou sua assinatura. O Pro continua até o fim do período pago.", + "error": "Não conseguimos cancelar a assinatura.", + "welcome": "Pronto! Agora você tem o Gruperly Pro." + }, + "option": { + "yourPlan": "Seu plano", + "free": "Grátis" + }, + "charges": { + "title": "Histórico de pagamentos", + "approved": "Pago", + "rejected": "Recusado", + "pending": "Pendente", + "in_process": "Em processamento", + "cancelled": "Cancelado", + "refunded": "Reembolsado", + "prev": "Anteriores", + "next": "Próximos" + }, + "view": { + "back": "Ajustes", + "title": "Seu plano", + "subtitle": "Escolha como usar o Gruperly.", + "perMonth": "{{price}} / mês", + "retry": "Tentar o pagamento de novo", + "upgrade": "Mudar para o Pro", + "unavailable": "Ainda não está disponível no seu país." + }, + "summary": { + "loading": "Consultando seu plano…", + "plan": "Plano {{plan}}", + "next": "Próxima cobrança: {{amount}} em {{date}}", + "pending": "Estamos aguardando o {{provider}} confirmar sua assinatura.", + "paidThrough": "Pago até {{date}}.", + "notEnforced": "Por enquanto todos os recursos estão liberados para todas as contas.", + "groups": "Grupos", + "students": "Alunos ativos" + } +}