fix(a11y): announce singular calendar and search counts

Preserve the real result count and localized date. Zero and multiple entries keep the existing translations. The Bokmål search noun has the same form in both cases.

Verified from f6143b9c with 37 component tests and six isolated Chromium/SQLite journeys on ports 4397/5397. New zero/one/two checks reproduced three singular failures before the fix. Next static export, TypeScript and scoped lint passed.

(cherry picked from commit 86d2305e64)
This commit is contained in:
cesnimda
2026-11-20 19:30:45 +01:00
parent 8b9aa1dafe
commit ac64d2ee22
7 changed files with 52 additions and 3 deletions
@@ -168,7 +168,7 @@ export default function QuickCommandDialog({ open, onClose, onNavigate, onOpenAd
</Box>
<Box aria-live="polite" sx={{ position: "absolute", width: 1, height: 1, overflow: "hidden", clipPath: "inset(50%)" }}>
{searchState === "loading" ? t("loading") : searchState === "ready" ? t("searchResultsCount", { count: allItems.length }) : ""}
{searchState === "loading" ? t("loading") : searchState === "ready" ? t(allItems.length === 1 ? "searchResultCount" : "searchResultsCount", { count: allItems.length }) : ""}
{activeIndex >= 0 ? ` ${allItems[activeIndex]?.label ?? ""}` : ""}
</Box>
{searchState === "error" ? <Alert severity="error" sx={{ mt: 1 }} action={<Button color="inherit" size="small" onClick={() => setSearchAttempt((value) => value + 1)}>{t("retry")}</Button>}>{t("searchLoadFailed")}</Alert> : null}