From b84825487381b3d5ac7bb0859924c20157227d61 Mon Sep 17 00:00:00 2001 From: Matt Westcott Date: Thu, 27 Oct 2022 17:57:59 +0100 Subject: [PATCH] Apply correct pluralisation to minimap error count Fixes #9497 --- CHANGELOG.txt | 1 + client/src/components/Minimap/MinimapItem.tsx | 8 ++++++-- docs/releases/4.1.md | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index cf916178eb..4d3617707d 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -109,6 +109,7 @@ Changelog * Fix: Update latest version message on Dashboard to accept dev build version format used on nlightly builds (Sam Moran) * Fix: references extraction for ChooserBlock (Alex Tomkins) * Fix: Regression in field width for authentication pages (log in / password reset) (Chisom) + * Fix: Ensure the new minimap correctly pluralises error counts for `aria-label`s (Matt Westcott) 4.0.4 (18.10.2022) diff --git a/client/src/components/Minimap/MinimapItem.tsx b/client/src/components/Minimap/MinimapItem.tsx index 0b3d9237d3..9c09058a9f 100644 --- a/client/src/components/Minimap/MinimapItem.tsx +++ b/client/src/components/Minimap/MinimapItem.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { gettext } from '../../utils/gettext'; +import { ngettext } from '../../utils/gettext'; import Icon from '../Icon/Icon'; export interface MinimapMenuItem { @@ -35,7 +35,11 @@ const MinimapItem: React.FunctionComponent = ({ }) => { const { href, label, icon, required, errorCount, level } = item; const hasError = errorCount > 0; - const errorsLabel = gettext('{num} errors').replace('{num}', `${errorCount}`); + const errorsLabel = ngettext( + '{num} error', + '{num} errors', + errorCount, + ).replace('{num}', `${errorCount}`); const text = label.length > 26 ? `${label.substring(0, 26)}…` : label; return (