fix(documents): pluralise timeline bar aria-label by count (#385)

The flat "{count} Dokumente / documents / documentos" keys read as
"1 Dokumente" / "1 documents" / "1 documentos" to a screen reader
when only one document falls in the month bucket. Splits each
locale into _singular + _plural keys and picks the form by count
in TimelineBars, mirroring the existing upload_banner_singular /
_plural pattern in this project.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-05-08 11:03:19 +02:00
parent 48da819a54
commit 1d6016cb19
5 changed files with 42 additions and 7 deletions

View File

@@ -51,10 +51,12 @@ function barHeight(count: number): number {
<button
type="button"
data-testid="timeline-bar"
aria-label={m.timeline_bar_aria({
when: formatTickLabel(bucket.month, getLocale()),
count: bucket.count
})}
aria-label={bucket.count === 1
? m.timeline_bar_aria_singular({ when: formatTickLabel(bucket.month, getLocale()) })
: m.timeline_bar_aria_plural({
when: formatTickLabel(bucket.month, getLocale()),
count: bucket.count
})}
aria-pressed={isSelected(bucket.month)}
onpointerdown={(e) => onbarpointerdown(e, i)}
onpointerenter={() => onbarpointerenter(i)}