mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 04:50:59 +00:00
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:
1 parent
c3451a4c06
commit
2f057f4a07
1 file changed
+4
-4
@@ -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"
|
||||
|
||||
Reference in new issue
Block a user