fix(i18n): trend-card comparison aria-label uses translation key (H3)

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) <noreply@anthropic.com>
This commit is contained in:
Marc-André BombeckandClaude Opus 4.7 committed 2026-05-10 03:02:02 +02:00
1 parent c3451a4c06
commit 2f057f4a07
1 file changed
+4 -4
+4 -4
View File
@@ -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"