fix(i18n): traducir StatsSection completamente (es/en) — antes todo hardcoded en español

- 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
This commit is contained in:
Mauri
2026-06-09 08:58:42 -03:00
parent 9c33a67150
commit ae56e43bb6
4 changed files with 32 additions and 12 deletions
+14 -10
View File
@@ -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'];
---
<section class="py-20 md:py-24" style="background: var(--hds-bg); border-top: 1px solid var(--hds-line); border-bottom: 1px solid var(--hds-line);">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="grid grid-cols-2 md:grid-cols-4 gap-10 md:gap-8 stagger">
{stats.map((stat) => (
{stats.map((stat, idx) => (
<div class="text-center">
<div class="font-display leading-none mb-3" style="font-size: clamp(3rem, 6vw, 4.5rem); color: var(--color-hds-naranja); font-weight: 500;">
{stat.value}
{values[idx]}
</div>
<div class="text-sm font-semibold" style="color: var(--hds-fg-soft);">
{stat.label}
{t(stat.labelKey)}
</div>
<div class="text-xs mt-1" style="color: var(--hds-fg-muted);">
{stat.sub}
{t(stat.subKey)}
</div>
</div>
))}
+16
View File
@@ -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.',
+1 -1
View File
@@ -26,7 +26,7 @@ const description = 'Cloud hosting, websites, e-commerce and infrastructure with
<CloudDivider fillClass="fill-hds-bg-soft" />
<StatsSection t={t} />
<StatsSection t={t} lang={lang} />
<DifferenceCards t={t} />
<CloudDivider fillClass="fill-hds-bg" flip={true} />
+1 -1
View File
@@ -29,7 +29,7 @@ const description = lang === 'en'
<CloudDivider fillClass="fill-hds-bg-soft" />
<StatsSection t={t} />
<StatsSection t={t} lang={lang} />
<DifferenceCards t={t} />
<CloudDivider fillClass="fill-hds-bg" flip={true} />