From 2f057f4a076f4b63ae1b8f682fd236034a317c13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 10 May 2026 03:02:02 +0200 Subject: [PATCH] fix(i18n): trend-card comparison aria-label uses translation key (H3) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The compareDelta `aria-label` interpolated `"vs. last month"` and `"vs. last year"` as literal English strings regardless of locale. A DE user got an English screen-reader announcement next to a visible German caption ("Δ −2.3 kg vs. Vormonat"). Routed through `t("comparison.captionLastMonth" | "comparison.captionLastYear")` so screen-reader output matches the visible text in both locales. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/components/charts/trend-card.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/charts/trend-card.tsx b/src/components/charts/trend-card.tsx index 1a63cabcc..b589c08c6 100644 --- a/src/components/charts/trend-card.tsx +++ b/src/components/charts/trend-card.tsx @@ -226,11 +226,11 @@ export function TrendCard({ )} data-slot="tile-compare-delta" data-compare-baseline={compareBaseline} - aria-label={`${formatDelta(compareDelta)}${unit ? ` ${unit}` : ""} ${ + aria-label={`${formatDelta(compareDelta)}${unit ? ` ${unit}` : ""} ${t( compareBaseline === "lastMonth" - ? "vs. last month" - : "vs. last year" - }`} + ? "comparison.captionLastMonth" + : "comparison.captionLastYear", + )}`} > {`Δ ${formatDelta(compareDelta)}${unit ? ` ${unit}` : ""} ${t( compareBaseline === "lastMonth"