phetsims / tasks

General tasks for PhET that will be tracked on Github
MIT License
5 stars 2 forks source link

Where are places where a11y features support i18n poorly. #1114

Open zepumph opened 1 year ago

zepumph commented 1 year ago

While working on https://github.com/phetsims/ratio-and-proportion/issues/499 I found

https://github.com/phetsims/scenery-phet/blob/99dc4097513e401dc753390acc3083aa0e3d18da/js/keyboard/help/KeyboardHelpSection.ts#L168-L184

This is very reasonable code that was acceptable because we thought that the only sort of problems it would cause was from i18n, but now, with Dynamic strings, we are passing Properties in for strings in most places, and so reading block text is showing up like:

‪Basic Actions‬, Property#128{‪Move to next item or group with Tab key.‬} Property#129{‪Move to previous item or group with Shift plus Tab key.‬} Property#131{‪Move between items in a group with Left and Right arrow keys or Up and Down arrow keys.‬} Property#130{‪Press buttons with Space key.‬} Property#132{‪Exit a dialog with Escape key.‬} '

In the past few weeks I have begun to realize that our dynamic string pattern we love for locale switching is actually the GREATEST THING EVER for how we implement description and other a11y features. And so I'd really like to tighten this up, including finishing https://github.com/phetsims/scenery/issues/1442.

This issue is NOT to fix this problem specifically, I'll take care of that. Instead I want to brainstorm proactively the spots where we may have cut corners in a11y features, thinking it was alright, so that we can go fix them now instead of stumbling across them in RC testing.

@jessegreenberg can you think about it and then we can discuss together next a11y dev meeting?

jessegreenberg commented 1 year ago

Here are a few examples:

https://github.com/phetsims/greenhouse-effect/blob/85126fdf4f500011cfa3abd1f5bb915f9aeb62c6/js/common/view/describers/ConcentrationDescriber.ts#L386-L391

https://github.com/phetsims/greenhouse-effect/blob/da9e20f445a7bcb7b4cf6b4d2caea6eb689a0b72/js/common/view/describers/TemperatureDescriber.ts#L194-L198

https://github.com/phetsims/balloons-and-static-electricity/blob/f2fff663e0a9ce6a2a5218ac15a9a3437405e375/js/balloons-and-static-electricity/view/describers/BalloonPositionDescriber.js#L189-L194

https://github.com/phetsims/scenery-phet/blob/c5be548ed9fd3dae61381331f9aa63fd68352e1e/js/keyboard/help/KeyboardHelpSectionRow.ts#L175-L178

But I think in this issue you may be suggesting using PatternStringProperty for a11y content. That could be helpful moving forward. But using it could require a total reimplementation for existing descriptions, I am not sure we should do that eagerly. But it would be good to discuss, and I am curious about what you have in mind!