website icon indicating copy to clipboard operation
website copied to clipboard

[PAGE ISSUE]: 'Accessibility' : Document TextSpan::locale in accessibility docs

Open Leffe108 opened this issue 2 years ago • 1 comments

Page URL

https://docs.flutter.dev/development/accessibility-and-localization/accessibility/

Page Source

https://github.com/flutter/website/tree/main/src/development/accessibility-and-localization/accessibility.md

Describe the problem

In order to markup which voice locale that assistive technology like TalkBack and VoiceOver should use, a Flutter user/developer has to use TextSpan::locale. This is however neither mentioned in accessibility doc nor internationalization doc

It could also help to clear up that the locale property on MaterialApp and Localizations.override does not affect which voice assistive technologies like VoiceOver and TalkBack is using as opposed to how the lang attribute works in HTML. Reference

Expected Fix

At the end of the Screen reader section, add a paragraph

When there is text is your app that should be voiced with a specific voice, use TextSpan.locale to inform the screen reader about the voice to use. Note that MaterialApp.locale and Localizations.override do not affect which voice is used by the screen reader. Usually the screen reader will use the system voice to voice texts except where you explicitly told it with TextSpan.locale.

Leffe108 avatar Mar 05 '22 11:03 Leffe108

As a comment, using eg. Swedish voice to read English text gives poor audibility compared to if the assistive tech is using English voice for English content. As many people are bi- or multi lingual and consume apps and content in many languages, I think this is an important note to the docs. - Both documenting the facilities that does exist in Flutter and also documenting the "false friend" that Flutter is not sending the locale of the app to assistive tech like HTML/browsers does.

Leffe108 avatar Mar 05 '22 11:03 Leffe108