Skip to content

a11y: mark <select> aria-label as html10n-managed (forward-compatible)#138

Merged
JohnMcLear merged 1 commit into
mainfrom
a11y/mark-select-aria-for-html10n
May 10, 2026
Merged

a11y: mark <select> aria-label as html10n-managed (forward-compatible)#138
JohnMcLear merged 1 commit into
mainfrom
a11y/mark-select-aria-for-html10n

Conversation

@JohnMcLear
Copy link
Copy Markdown
Member

Summary

Adds data-l10n-aria-label="true" to toolbar <select> elements with data-l10n-id. After ether/etherpad#7713, html10n's aria-label auto-population covers form-control elements; the marker tells html10n it owns this attribute and may overwrite it with the localized string on every pad.applyLanguage() call.

Forward-compatible, not a breaking change for users on older etherpad:

  • Older etherpad without the html10n fix doesn't reach the form-control aria-label path → the hardcoded English aria-label remains as a fallback (no regression).
  • Newer etherpad with the html10n fix → html10n overwrites the aria-label with the localized translation on initial load and on language change.

Also drops data-l10n-attr="aria-label" — a no-op convention from a different localization library.

ether/etherpad#7713 extends html10n's aria-label auto-population to
cover form-control elements (<select>, <input>, <textarea>). On
newer etherpad with that fix, html10n overwrites aria-label with the
localized translation when the data-l10n-aria-label="true" marker
is present.

Adds the marker (and keeps the existing hardcoded aria-label) so:
  - older etherpad without the html10n fix: aria-label remains the
    hardcoded English fallback (no regression);
  - newer etherpad with the html10n fix: aria-label gets the localized
    translation, refreshed on pad.applyLanguage().

Also drops the no-op data-l10n-attr="aria-label" attribute (etherpad's
html10n doesn't read it; that's a convention from a different
localization library).
@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 e6c9847 into main May 10, 2026
3 checks passed
@JohnMcLear JohnMcLear deleted the a11y/mark-select-aria-for-html10n branch May 10, 2026 11:37
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