Repository: flutter
Issue: Allow setting assistive technology locale via Semantics widget
Labels: c: new feature,framework,f: material design,a: accessibility,a: internationalization,c: proposal,P2,team-accessibility,triaged-accessibility

## Use case
In a app with mixed language content there can be semantics in a different language than the main app language. For example if the static text of an app is localized to several languages but it also receive content from a server that is user/customer generated and the user/customer has only written in one language. For example: use any social media platform in non-English UI language and follow some English content creators. Soon you will have mixed language content in your feed. If this is not propagated to assistive tech, then a screen reader such as TalkBack or VoiceOver may use the wrong voice engine to read content and that makes it harder to hear what it says.

It is however currently not possible to set the locale to use for a Semantic node created by the Semantics widget (and have that communicated to assistive tech).

Another use case could be to wrap the whole MaterialApp or a Scaffold in a Semantics node to set the assistive tech locale of the app to resolve https://github.com/flutter/flutter/issues/99600 (WCAG Level A)

Resolves:
* [WCAG - 3.1.2 Set language of parts - Level AA](https://www.w3.org/WAI/WCAG21/quickref/?versions=2.0&showtechniques=312#language-of-parts)
* [WCAG - 3.1.1 Set language of page- Level A](https://www.w3.org/WAI/WCAG21/quickref/?versions=2.0&showtechniques=312#language-of-page) - if a Semantics widget can wrap MaterialApp or Scaffold

## Proposal
Add a `locale` parameter to Semantics widget constructor which will set the locale of the provided semantic labels.

I propose that it does propagate the announced locale for assistive tech downwards to children in the tree. Alternatively, a flag could be added to toggle if it should propagate down or not.

### Why propagate downwards?
Since apps can have mixed content and that can be both the visible text and hidden semantics node, and [Localizations.override](https://api.flutter.dev/flutter/widgets/Localizations/Localizations.override.html) does not change the reported locale to assistive tech, so there need to be some other way to do that for assistive tech. Semastics widget seem to be a good place to do that as it can affect both that Semantic node and its children.


## Alternatives considered
For text that is displayed visually, it is possible to use a TextSpan in a RichText to set the [locale](https://api.flutter.dev/flutter/painting/TextSpan/locale.html). This will then be carried over to the assistive technology layer ([except on web and windows](https://github.com/flutter/flutter/issues/98948)). But TextSpan itself is not a widget nor does it accept widgets as children, so it cannot be used more generally to set the assistive tech locale of other widgets in the app, such as a Semantic node further down in the tree.

[Localizations.override](https://api.flutter.dev/flutter/widgets/Localizations/Localizations.override.html) can override the locale for a sub tree of the app, but it is only used for I18N purposes. It is not carried over to assistive technology.