Skip to content

a11y: drop redundant hardcoded aria-label#112

Merged
JohnMcLear merged 1 commit intomasterfrom
chore/a11y-drop-redundant-aria-label
May 9, 2026
Merged

a11y: drop redundant hardcoded aria-label#112
JohnMcLear merged 1 commit intomasterfrom
chore/a11y-drop-redundant-aria-label

Conversation

@JohnMcLear
Copy link
Copy Markdown
Member

Summary

Removes hardcoded aria-label="…" attributes from elements that already declare data-l10n-id. With aria-label set in the template, etherpad's html10n skips the auto-population path (html10n.ts:665-678) and leaves screen readers with the English label even when the user's UI language is something else.

After this PR, html10n populates aria-label from the localized translation on every pad.applyLanguage() call, marked with data-l10n-aria-label="true" so subsequent passes refresh it.

Also drops the data-l10n-attr="aria-label" attribute where present — that's a convention from a different localization library (e.g. fluent-dom), and etherpad's html10n does not read it. The auto-population in lines 665-678 is the etherpad mechanism.

Part of the fleet-wide plugin a11y/i18n sweep (Phase 3 of the modernization campaign; pilot: ether/ep_align#182).

Etherpad's html10n auto-populates `aria-label` from the localized
string when an element has `data-l10n-id` and no author-supplied
`aria-label`. Hardcoded English values block that and leave screen
readers with the English label regardless of language.

Removes redundant `aria-label="…"` (and the no-op
`data-l10n-attr="aria-label"` convention which etherpad's html10n
does not support) from elements that already have `data-l10n-id`.

See etherpad-lite/src/static/js/vendors/html10n.ts:665-678.
@qodo-code-review
Copy link
Copy Markdown

ⓘ You've reached your Qodo monthly free-tier limit. Reviews pause until next month — upgrade your plan to continue now, or link your paid account if you already have one.

@JohnMcLear JohnMcLear merged commit a223154 into master May 9, 2026
3 checks passed
@JohnMcLear JohnMcLear deleted the chore/a11y-drop-redundant-aria-label branch May 9, 2026 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant