-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Mobile]: Improve screen reader support on BottomSheet's cells. #15213
Conversation
I think in this case we can really benefit from _x( "%1$s. %2$s", "
I agree, I think this case deserves a more generic handling. I'd say let's just concatenate label and value at base level otherwise it will generate code duplication and will be more bug prone. |
@pinarol - Thanks for the review! Please take a look anytime you get the chance :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks and works great! 🎉
Tested with WPAndroid and WPiOS apps on real devices
Thank you! |
Ref: wordpress-mobile/gutenberg-mobile#935
This PR focuses on the cells of the bottom sheets, providing better labeling, hints and action handling.
For both the Cells with value and SwtchCells, the manual handling of the labels is not optimal, but required if we want to properly localize the whole sentence.
I believe that for these cases we can make an exception, and generically concatenate
label
andvalue
as the accessibility label for cells with value.Same for switches, we can generically concatenate the localized switch state with
_x()
, indicating the context of theOn
,Off
strings.This will save us from possible mistakes in the future, and will help with an easier accessibility maintenance.
I left this PR implementing the first case to show the point. But I'd happily edit it to automatically handle accessibility labels in BottomSheet cells. See the changes on
image/edit.native.js
andlink/modal.native.js
.EDIT: Made changes to handle accessibility labels internally.
To test:
Empty
when correspond.Empty
when correspond.