Add a11y label to modal barrier#13543
Conversation
| "timePickerHourModeAnnouncement": "時を選択", | ||
| "timePickerMinuteModeAnnouncement": "分を選択" | ||
| "timePickerMinuteModeAnnouncement": "分を選択", | ||
| "modalBarrierDismissLabel": "閉じる" |
| "timePickerHourModeAnnouncement": "Sélectionnez les heures", | ||
| "timePickerMinuteModeAnnouncement": "Sélectionnez les minutes" | ||
| "timePickerMinuteModeAnnouncement": "Sélectionnez les minutes", | ||
| "modalBarrierDismissLabel": "Ignorer" |
| /// See also: | ||
| /// | ||
| /// * [ModalRoute.barrierLabel], which controls this property for the | ||
| /// [ModalBarrier] built by [ModalRoute] pages. |
There was a problem hiding this comment.
maybe see also something that tells you what a semantics label is? :-)
| behavior: HitTestBehavior.opaque, | ||
| child: new Semantics( | ||
| label: semanticsDismissable ? semanticsLabel : null, | ||
| textDirection: semanticsDismissable ? Directionality.of(context) : null, |
There was a problem hiding this comment.
start the build method with an assert that calls debugCheckHasDirectionality or whatever it's called
| /// | ||
| /// * [ModalRoute.barrierLabel], which controls this property for the | ||
| /// [ModalBarrier] built by [ModalRoute] pages. | ||
| final String semanticsLabel; |
| DefaultWidgetsLocalizations.delegate, | ||
| DefaultMaterialLocalizations.delegate, | ||
| ], | ||
| child: new Directionality( |
There was a problem hiding this comment.
you can remove the Directionality, Localizations adds one
| ], | ||
| child: new MediaQuery( | ||
| data: new MediaQueryData.fromWindow(window), | ||
| child: new Directionality( |
There was a problem hiding this comment.
This one is awkward to remove. The test verifies that things work with different textDirections. While Localizations does provide a text direction, I cannot modify it directly. I could rewrite the test to work on different locales instead, but I think that would hide the real purpose of the test (which is to make sure that different text directions work). Therefore, I left the Directionality widget in the tree.
There was a problem hiding this comment.
that's fine. i didn't notice it was being tweaked.
|
|
||
| "modalBarrierDismissLabel": "Dismiss", | ||
| "@modalBarrierDismissLabel": { | ||
| "description": "Accessibility label used to annotate a dismissible modal barrier." |
There was a problem hiding this comment.
give an example, e.g. "as seen behind a popup dialog box" or something
There was a problem hiding this comment.
You need to update flutter_localizations/lib/src/l10n/localizaions.dart, see https://github.com/flutter/flutter/blob/master/dev/tools/gen_localizations.dart
You just have to run:
dart dev/tools/gen_localizations.dart --overwrite
| "selectedRowCountTitleOther": "$selectedRowCount Elemente ausgewählt", | ||
| "cancelButtonLabel": "ABBRECHEN", | ||
| "closeButtonLabel": "SCHLIEẞEN", | ||
| "closeButtonLabel": "SCHLIESSEN", |
There was a problem hiding this comment.
I have been trying to get the internal translations team to update this value (with little success). Your change may be reverted when the next translations update happens.
|
|
||
| "modalBarrierDismissLabel": "Dismiss", | ||
| "@modalBarrierDismissLabel": { | ||
| "description": "Accessibility label used to annotate a dismissible modal barrier." |
There was a problem hiding this comment.
This description will probably not help translators. You could include some of the text you wrote for routes.dart.
|
Addressed all comments. PTAL. |
Breaking change announcement has been made here: https://groups.google.com/forum/#!topic/flutter-dev/FzUAHl2z4mo
Fixes #13451.
@HansMuller for the integration of translations.