p5.js-web-editor icon indicating copy to clipboard operation
p5.js-web-editor copied to clipboard

Some aria-labels are hardcoded in English instead of using i18n

Open avinxshKD opened this issue 9 months ago • 4 comments

p5.js version

develop branch

What is your operating system?

None

Web browser and version

Web browser and version

Actual Behavior

I was looking at accessibility stuff and noticed a few spots where aria-labels are hardcoded in English rather than going through the t() function. Here's what I found:

  • Pagination.jsx → aria-label="Previous Page" and aria-label="Next Page"
  • VersionPicker.jsx → aria-label="Select p5.js version"
  • Toast.jsx → aria-label="Close Alert"
  • TextArea.jsx → aria-label="Copy"
  • QuickAddList/Icons.jsx → both icons have aria-label="Descending" which looks like a copy-paste mistake tbh, one's a close icon and one's a check icon So basically if someone switches the editor to Hindi or Spanish, their screen reader will still read these labels in English.

Expected Behavior

These should use t() like the rest of the codebase does. Looking at translations.json, there's already a nice pattern with the *ARIA suffix (like CloseButtonARIA, DirectionAscendingARIA, etc.) so the fix should be pretty straightforward.

Steps to reproduce

  1. Switch editor language to non-English
  2. Use a screen reader
  3. Tab through the pagination buttons on the Sketches page
  4. Buttons still get announced as "Previous Page" / "Next Page" in English

avinxshKD avatar Feb 09 '26 17:02 avinxshKD

@raclim hey I'd be down to fix this if you want, just need to add the translation keys and swap out the hardcoded strings. Pls assign thanks

avinxshKD avatar Feb 11 '26 11:02 avinxshKD

Assigned this one as well!

raclim avatar Feb 12 '26 14:02 raclim

@raclim can i work on this

Aashivdev avatar Feb 13 '26 04:02 Aashivdev

@raclim thanks fix is almost ready, pls review when free

avinxshKD avatar Feb 15 '26 16:02 avinxshKD