Skip to content

Conversation

@enterayush
Copy link

Summary

Adds a localized aria-label to the Download button in the viewer toolbar to improve accessibility for screen
reader users.

Details

Previously, only the title attribute was localized, so the button did not expose an accessible name. By adding
data-l10n-attrs="title aria-label", both title and aria-label are now populated by the localization system,
consistent with other toolbar buttons.

Result

Screen readers can now correctly announce the purpose of the Download button.

Fixes: #20473

@@ -1,4 +1,4 @@
<!doctype html>
<!doctype html>
Copy link
Contributor

@timvandermeij timvandermeij Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be unrelated to the change at hand and should be reverted to keep the patch as small as possible (this is probably a UTF byte order mark added by an editor).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this is still there in the overall diff.

type="button"
tabindex="0"
data-l10n-id="pdfjs-save-button"
data-l10n-attrs="title aria-label"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear to me why the Download button is treated differently now compared to e.g. the Print button above. If we do this, shouldn't we do this consistently for all buttons instead?

@calixteman Are you aware of any accessibility rules from the UI/UX team around this, since we recently changed the HTML to accomodate for that better?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review!
I reverted the unintended BOM/doctype change and updated the patch so data-l10n-attrs="title aria-label" is applied consistently across icon-only toolbar buttons.
Please let me know if any further adjustments are needed.

Copy link
Contributor

@timvandermeij timvandermeij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, with the comments addressed and the commits squashed into one, but I'd like @calixteman to review this too given that I'm not fully familiar with the UI/UX requirements in terms of button accessibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add aria-label to "Download" button in PDF.js viewer

3 participants