website
website copied to clipboard
[PAGE ISSUE]: 'Accessibility' : Document TextSpan::locale in accessibility docs
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 thatMaterialApp.locale
andLocalizations.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 withTextSpan.locale
.
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.