Skip to content

Add a11y label to modal barrier#13543

Merged
goderbauer merged 7 commits intoflutter:masterfrom
goderbauer:barrierLabel
Dec 14, 2017
Merged

Add a11y label to modal barrier#13543
goderbauer merged 7 commits intoflutter:masterfrom
goderbauer:barrierLabel

Conversation

@goderbauer
Copy link
Member

@goderbauer goderbauer commented Dec 13, 2017

Breaking change announcement has been made here: https://groups.google.com/forum/#!topic/flutter-dev/FzUAHl2z4mo

Fixes #13451.

@HansMuller for the integration of translations.

"timePickerHourModeAnnouncement": "時を選択",
"timePickerMinuteModeAnnouncement": "分を選択"
"timePickerMinuteModeAnnouncement": "分を選択",
"modalBarrierDismissLabel": "閉じる"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for Japanese.

"timePickerHourModeAnnouncement": "Sélectionnez les heures",
"timePickerMinuteModeAnnouncement": "Sélectionnez les minutes"
"timePickerMinuteModeAnnouncement": "Sélectionnez les minutes",
"modalBarrierDismissLabel": "Ignorer"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for French.

/// See also:
///
/// * [ModalRoute.barrierLabel], which controls this property for the
/// [ModalBarrier] built by [ModalRoute] pages.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe see also something that tells you what a semantics label is? :-)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping

behavior: HitTestBehavior.opaque,
child: new Semantics(
label: semanticsDismissable ? semanticsLabel : null,
textDirection: semanticsDismissable ? Directionality.of(context) : null,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto earlier comment

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping

DefaultWidgetsLocalizations.delegate,
DefaultMaterialLocalizations.delegate,
],
child: new Directionality(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can remove the Directionality, Localizations adds one

],
child: new MediaQuery(
data: new MediaQueryData.fromWindow(window),
child: new Directionality(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's fine. i didn't notice it was being tweaked.


"modalBarrierDismissLabel": "Dismiss",
"@modalBarrierDismissLabel": {
"description": "Accessibility label used to annotate a dismissible modal barrier."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

give an example, e.g. "as seen behind a popup dialog box" or something

Copy link
Contributor

@HansMuller HansMuller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack.


"modalBarrierDismissLabel": "Dismiss",
"@modalBarrierDismissLabel": {
"description": "Accessibility label used to annotate a dismissible modal barrier."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This description will probably not help translators. You could include some of the text you wrote for routes.dart.

@goderbauer
Copy link
Member Author

Addressed all comments. PTAL.

@Hixie
Copy link
Contributor

Hixie commented Dec 14, 2017

LGTM

@goderbauer goderbauer merged commit f9cf5a1 into flutter:master Dec 14, 2017
@goderbauer goderbauer deleted the barrierLabel branch December 14, 2017 23:05
@goderbauer goderbauer added the a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) label Mar 5, 2018
@HansMuller HansMuller mentioned this pull request Mar 8, 2018
DaveShuckerow pushed a commit to DaveShuckerow/flutter that referenced this pull request May 14, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dismissible ModalBarrier needs an a11y label

5 participants