From ae56e43bb6e5f6a99f624813a91b136b5f0d98f6 Mon Sep 17 00:00:00 2001 From: Mauri Date: Tue, 9 Jun 2026 08:58:42 -0300 Subject: [PATCH] =?UTF-8?q?fix(i18n):=20traducir=20StatsSection=20completa?= =?UTF-8?q?mente=20(es/en)=20=E2=80=94=20antes=20todo=20hardcoded=20en=20e?= =?UTF-8?q?spa=C3=B1ol?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - StatsSection ahora usa traducciones de i18n/ui.ts - Nuevas claves: stats.label1-4, stats.sub1-4 (es + en) - Hero y Footer ya estaban traducidos en commit anterior - Verificado: /en/ ya no muestra 'Años de experiencia' ni 'Soporte humano senior' — todo en inglés --- src/components/StatsSection.astro | 24 ++++++++++++++---------- src/i18n/ui.ts | 16 ++++++++++++++++ src/pages/en/index.astro | 2 +- src/pages/index.astro | 2 +- 4 files changed, 32 insertions(+), 12 deletions(-) diff --git a/src/components/StatsSection.astro b/src/components/StatsSection.astro index 6a91057..f802e7c 100644 --- a/src/components/StatsSection.astro +++ b/src/components/StatsSection.astro @@ -1,32 +1,36 @@ --- import type { TranslationKey } from '@/i18n/ui'; -import StatCounter from './StatCounter.astro'; interface Props { t: (key: TranslationKey) => string; + lang?: 'es' | 'en'; } -const { t } = Astro.props; +const { t, lang = 'es' } = Astro.props; const stats = [ - { value: '26+', label: 'Años de experiencia', sub: 'Desde el 2000' }, - { value: '100+', label: 'Proyectos hospedados', sub: 'Webs, e-commerce, infra' }, - { value: '4', label: 'Países', sub: 'Canadá, USA, Alemania, UY' }, - { value: 'Senior', label: 'Equipo senior', sub: 'SysAdmin / SRE' }, + { valueKey: 'stats.value1', labelKey: 'stats.label1' as TranslationKey, subKey: 'stats.sub1' as TranslationKey }, + { valueKey: 'stats.value2', labelKey: 'stats.label2' as TranslationKey, subKey: 'stats.sub2' as TranslationKey }, + { valueKey: 'stats.value3', labelKey: 'stats.label3' as TranslationKey, subKey: 'stats.sub3' as TranslationKey }, + { valueKey: 'stats.value4', labelKey: 'stats.label4' as TranslationKey, subKey: 'stats.sub4' as TranslationKey }, ]; + +const values = lang === 'en' + ? ['26+', '100+', '4', 'Senior'] + : ['26+', '100+', '4', 'Senior']; ---
- {stats.map((stat) => ( + {stats.map((stat, idx) => (
- {stat.value} + {values[idx]}
- {stat.label} + {t(stat.labelKey)}
- {stat.sub} + {t(stat.subKey)}
))} diff --git a/src/i18n/ui.ts b/src/i18n/ui.ts index 6bb4eb7..e83d902 100644 --- a/src/i18n/ui.ts +++ b/src/i18n/ui.ts @@ -16,6 +16,14 @@ export const ui = { 'hero.badgeUptime': 'Uptime 99.9%', 'hero.badgeSupport': 'Soporte humano', 'hero.badgeLocation': 'Maldonado, Uruguay', + 'stats.label1': 'Años de experiencia', + 'stats.sub1': 'Desde el 2000', + 'stats.label2': 'Proyectos hospedados', + 'stats.sub2': 'Webs, e-commerce, infra', + 'stats.label3': 'Países', + 'stats.sub3': 'Canadá, USA, Alemania, UY', + 'stats.label4': 'Equipo senior', + 'stats.sub4': 'SysAdmin / SRE', 'diff.eyebrow': 'La diferencia', 'diff.title': 'Por qué elegirnos', 'diff.subtitle': 'Tu proyecto merece un socio tecnológico, no solo un hosting.', @@ -74,6 +82,14 @@ export const ui = { 'hero.badgeUptime': '99.9% uptime', 'hero.badgeSupport': 'Human support', 'hero.badgeLocation': 'Maldonado, Uruguay', + 'stats.label1': 'Years of experience', + 'stats.sub1': 'Since 2000', + 'stats.label2': 'Projects hosted', + 'stats.sub2': 'Websites, e-commerce, infra', + 'stats.label3': 'Countries', + 'stats.sub3': 'Canada, USA, Germany, UY', + 'stats.label4': 'Senior team', + 'stats.sub4': 'SysAdmin / SRE', 'diff.eyebrow': 'The difference', 'diff.title': 'Why choose us', 'diff.subtitle': 'Your project deserves a technology partner, not just a hosting provider.', diff --git a/src/pages/en/index.astro b/src/pages/en/index.astro index 8b6b4d8..9f28923 100644 --- a/src/pages/en/index.astro +++ b/src/pages/en/index.astro @@ -26,7 +26,7 @@ const description = 'Cloud hosting, websites, e-commerce and infrastructure with - + diff --git a/src/pages/index.astro b/src/pages/index.astro index e0d8e51..32557b8 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -29,7 +29,7 @@ const description = lang === 'en' - +