Skip to content

Commit 210ebeb

Browse files
committed
feat(i18n): improve localization for engineering page metrics and descriptions
1 parent e8f28d7 commit 210ebeb

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

src/pages/engineering.astro

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -309,36 +309,39 @@ const VITAL_EXPLAIN: Record<VitalMetric, string> = e.vitals.explain
309309
</div>
310310

311311
<div class="flex gap-2 mb-3 h-1.5 rounded-full overflow-hidden">
312-
<div style={`width:${v.dist.good}%`} class="bg-lime/70" title={`${v.dist.good}% bueno`}></div>
313-
<div style={`width:${v.dist.needsImprovement}%`} class="bg-ember/50" title={`${v.dist.needsImprovement}% mejorable`}></div>
314-
<div style={`width:${v.dist.poor}%`} class="bg-ember/80" title={`${v.dist.poor}% pobre`}></div>
312+
<div style={`width:${v.dist.good}%`} class="bg-lime/70" title={`${v.dist.good}% ${e.vitals.good.toLowerCase()}`}></div>
313+
<div style={`width:${v.dist.needsImprovement}%`} class="bg-ember/50" title={`${v.dist.needsImprovement}% ${e.vitals.needsImprovement.toLowerCase()}`}></div>
314+
<div style={`width:${v.dist.poor}%`} class="bg-ember/80" title={`${v.dist.poor}% ${e.vitals.poor.toLowerCase()}`}></div>
315315
</div>
316316
<div class="text-[11px] text-ink-400 mb-3">
317-
{v.dist.good}% bueno · {v.dist.needsImprovement}% mejorable · {v.dist.poor}% pobre
317+
{v.dist.good}% {e.vitals.good.toLowerCase()} · {v.dist.needsImprovement}% {e.vitals.needsImprovement.toLowerCase()} · {v.dist.poor}% {e.vitals.poor.toLowerCase()}
318318
</div>
319319

320320
{v.trend != null && v.trendDisplay && (
321321
<div class="text-[12px] text-ink-300 mb-2">
322-
Últimos 7d: {v.trend < 0 ? '' : v.trend > 0 ? '' : '='} {v.trendDisplay} vs ventana de 30d
322+
{e.vitals.trendLabel} {v.trend < 0 ? '' : v.trend > 0 ? '' : '='} {v.trendDisplay} {e.vitals.trendVs}
323323
<span class={v.trend < 0 ? 'text-lime' : v.trend > 0 ? 'text-ember' : 'text-ink-400'}>
324-
{' '}({v.trend < 0 ? 'mejora' : v.trend > 0 ? 'empeora' : 'estable'})
324+
{' '}({v.trend < 0 ? e.vitals.trendImproves : v.trend > 0 ? e.vitals.trendWorsens : e.vitals.trendStable})
325325
</span>
326326
</div>
327327
)}
328328

329329
{v.worstPath && (
330330
<div class="text-[12px] text-ink-300">
331-
Ruta más lenta: <span class="font-mono text-ink-100">{v.worstPath.path}</span> ({formatVital(v.metric, v.worstPath.p75)} p75)
331+
{interpolate(e.vitals.worstPath, {
332+
path: v.worstPath.path,
333+
value: formatVital(v.metric, v.worstPath.p75),
334+
}).split(v.worstPath.path).map((part, i) => i === 0 ? <>{part}<span class="font-mono text-ink-100">{v.worstPath!.path}</span></> : part)}
332335
</div>
333336
)}
334337
</>
335338
)}
336339
<div class="text-[11px] text-ink-500 mt-3 pt-2 border-t border-white/5">
337-
Medido con la librería oficial <span class="font-mono">web-vitals</span> en el navegador de cada visitante. Sin cookies.
340+
{e.vitals.measuredWith}
338341
</div>
339342
<div class="live-strip flex items-center gap-1.5 text-[11px] font-mono text-ink-400 mt-2" data-live="vitals">
340343
<span class="live-dot"></span>
341-
<span class="live-text">Verificando en vivo…</span>
344+
<span class="live-text">{e.pipeline.liveChecking}</span>
342345
</div>
343346
</Fragment>
344347
</CardPopover>

0 commit comments

Comments
 (0)