Add traslations

This commit is contained in:
Urtzi Alfaro
2025-12-18 20:12:32 +01:00
parent f10a2b92ea
commit acb3a40844
15 changed files with 726 additions and 228 deletions

View File

@@ -154,7 +154,7 @@ export const RegisterForm: React.FC<RegisterFormProps> = ({
}
if (!formData.acceptTerms) {
newErrors.acceptTerms = t('auth:validation.terms_required', 'Debes aceptar los términos y condiciones');
newErrors.acceptTerms = t('auth:validation.terms_required', 'Debes aceptar los términos y condiciones y la política de privacidad');
}
setErrors(newErrors);
@@ -235,7 +235,7 @@ export const RegisterForm: React.FC<RegisterFormProps> = ({
const handlePaymentError = (errorMessage: string) => {
showToast.error(errorMessage, {
title: 'Error en el pago'
title: t('auth:alerts.payment_error', 'Error en el pago')
});
};
@@ -252,13 +252,13 @@ export const RegisterForm: React.FC<RegisterFormProps> = ({
// Show 2 steps if plan is pre-selected, 3 steps otherwise
const steps = preSelectedPlan
? [
{ key: 'basic_info', label: 'Información', number: 1, time: '2 min' },
{ key: 'payment', label: 'Pago', number: 2, time: '2 min' }
{ key: 'basic_info', label: t('auth:steps.info', 'Información'), number: 1, time: '2 min' },
{ key: 'payment', label: t('auth:steps.payment', 'Pago'), number: 2, time: '2 min' }
]
: [
{ key: 'basic_info', label: 'Información', number: 1, time: '2 min' },
{ key: 'subscription', label: 'Plan', number: 2, time: '1 min' },
{ key: 'payment', label: 'Pago', number: 3, time: '2 min' }
{ key: 'basic_info', label: t('auth:steps.info', 'Información'), number: 1, time: '2 min' },
{ key: 'subscription', label: t('auth:steps.subscription', 'Plan'), number: 2, time: '1 min' },
{ key: 'payment', label: t('auth:steps.payment', 'Pago'), number: 3, time: '2 min' }
];
const getStepIndex = (step: RegistrationStep) => {
@@ -499,14 +499,8 @@ export const RegisterForm: React.FC<RegisterFormProps> = ({
disabled={isLoading}
/>
<label htmlFor="acceptTerms" className="text-sm text-text-secondary cursor-pointer">
Acepto los{' '}
<a href="/terms" target="_blank" rel="noopener noreferrer" className="text-color-primary hover:text-color-primary-dark underline">
términos y condiciones
</a>{' '}
y la{' '}
<a href="/privacy" target="_blank" rel="noopener noreferrer" className="text-color-primary hover:text-color-primary-dark underline">
política de privacidad
</a>{' '}
{t('auth:register.accept_terms_and_privacy', 'Acepto los términos y condiciones y la política de privacidad')}
{' '}
<span className="text-color-error">*</span>
</label>
</div>
@@ -524,7 +518,7 @@ export const RegisterForm: React.FC<RegisterFormProps> = ({
disabled={isLoading}
/>
<label htmlFor="marketingConsent" className="text-sm text-text-secondary cursor-pointer">
Deseo recibir comunicaciones de marketing y promociones
{t('auth:register.marketing_consent', 'Deseo recibir comunicaciones de marketing y promociones')}
</label>
</div>
@@ -538,7 +532,7 @@ export const RegisterForm: React.FC<RegisterFormProps> = ({
disabled={isLoading}
/>
<label htmlFor="analyticsConsent" className="text-sm text-text-secondary cursor-pointer">
Acepto el uso de cookies analíticas para mejorar la experiencia
{t('auth:register.analytics_consent', 'Acepto el uso de cookies analíticas para mejorar la experiencia')}
</label>
</div>
</div>
@@ -551,7 +545,7 @@ export const RegisterForm: React.FC<RegisterFormProps> = ({
disabled={isLoading || !validatePassword(formData.password) || !formData.acceptTerms || passwordMatchStatus !== 'match'}
className="w-full sm:w-48"
>
Siguiente
{t('auth:register.next_button', 'Siguiente')}
</Button>
</div>
</form>
@@ -587,7 +581,7 @@ export const RegisterForm: React.FC<RegisterFormProps> = ({
disabled={isLoading}
className="w-full sm:w-48 order-2 sm:order-1"
>
Anterior
{t('auth:register.previous_button', 'Anterior')}
</Button>
<Button
variant="primary"
@@ -596,7 +590,7 @@ export const RegisterForm: React.FC<RegisterFormProps> = ({
disabled={isLoading}
className="w-full sm:w-48 order-1 sm:order-2"
>
Siguiente
{t('auth:register.next_button', 'Siguiente')}
</Button>
</div>
</div>
@@ -619,36 +613,36 @@ export const RegisterForm: React.FC<RegisterFormProps> = ({
<Card className="p-6 bg-gradient-to-r from-blue-50 to-indigo-50 dark:from-blue-900/20 dark:to-indigo-900/20 border-2 border-blue-200 dark:border-blue-800">
<h3 className="text-lg font-bold text-text-primary mb-4 flex items-center gap-2">
<CheckCircle className="w-5 h-5 text-color-primary" />
Resumen de tu Plan
{t('auth:payment.payment_summary', 'Resumen de tu Plan')}
</h3>
<div className="space-y-3">
<div className="flex justify-between items-center">
<span className="text-text-secondary">Plan seleccionado:</span>
<span className="text-text-secondary">{t('auth:payment.selected_plan', 'Plan seleccionado:')}</span>
<span className="font-bold text-color-primary text-lg">{selectedPlanMetadata.name}</span>
</div>
<div className="flex justify-between items-center">
<span className="text-text-secondary">Precio mensual:</span>
<span className="text-text-secondary">{t('auth:payment.monthly_price', 'Precio mensual:')}</span>
<span className="font-semibold text-text-primary">
{subscriptionService.formatPrice(selectedPlanMetadata.monthly_price)}/mes
</span>
</div>
{useTrial && (
<div className="flex justify-between items-center pt-3 border-t border-blue-200 dark:border-blue-800">
<span className="text-green-700 dark:text-green-400 font-medium">Período de prueba:</span>
<span className="text-green-700 dark:text-green-400 font-medium">{t('auth:payment.trial_period', 'Período de prueba:')}</span>
<span className="font-bold text-green-700 dark:text-green-400">
{isPilot ? `${trialMonths} meses GRATIS` : '14 días gratis'}
{isPilot ? t('auth:payment.free_months', {count: trialMonths}) : t('auth:payment.free_days', '14 días gratis')}
</span>
</div>
)}
<div className="pt-3 border-t border-blue-200 dark:border-blue-800">
<div className="flex justify-between items-center text-sm">
<span className="text-text-tertiary">Total hoy:</span>
<span className="text-text-tertiary">{t('auth:payment.total_today', 'Total hoy:')}</span>
<span className="font-bold text-xl text-color-success">0.00</span>
</div>
<p className="text-xs text-text-tertiary mt-2 text-center">
{useTrial
? `Se te cobrará ${subscriptionService.formatPrice(selectedPlanMetadata.monthly_price)} después del período de prueba`
: 'Tarjeta requerida para validación'
? t('auth:payment.billing_message', {price: subscriptionService.formatPrice(selectedPlanMetadata.monthly_price)})
: t('auth:payment.payment_required', 'Tarjeta requerida para validación')
}
</p>
</div>
@@ -675,7 +669,7 @@ export const RegisterForm: React.FC<RegisterFormProps> = ({
disabled={isLoading}
className="w-full sm:w-48"
>
Anterior
{t('auth:register.previous_button', 'Anterior')}
</Button>
</div>
</div>
@@ -701,7 +695,7 @@ export const RegisterForm: React.FC<RegisterFormProps> = ({
{onLoginClick && currentStep === 'basic_info' && (
<div className="mt-8 text-center border-t border-border-primary pt-6">
<p className="text-text-secondary mb-4">
¿Ya tienes una cuenta?
{t('auth:register.have_account', '¿Ya tienes una cuenta?')}
</p>
<Button
variant="ghost"
@@ -709,7 +703,7 @@ export const RegisterForm: React.FC<RegisterFormProps> = ({
disabled={isLoading}
className="text-color-primary hover:text-color-primary-dark"
>
Iniciar Sesión
{t('auth:register.sign_in_link', 'Iniciar Sesión')}
</Button>
</div>
)}