Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for keyboard key accessibility trait #227

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified ...4/SnapshotTests.AccessibilitySnapshotTests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ...4/SnapshotTests.AccessibilitySnapshotTests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ...4/SnapshotTests.AccessibilitySnapshotTests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
/* Description for the 'back button' accessibility trait */
"trait.backbutton.description" = "Zurück Taste.";

/* Description for the 'keyboard key' accessibility trait */
"trait.keyboard_key.description" = "Tastaturtaste.";

/* Description for the 'tab' accessibility trait */
"trait.tab.description" = "Tabulator.";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
/* Description for the 'back button' accessibility trait */
"trait.backbutton.description" = "Back Button.";

/* Description for the 'keyboard key' accessibility trait */
"trait.keyboard_key.description" = "Keyboard Key.";

/* Description for the 'tab' accessibility trait */
"trait.tab.description" = "Tab.";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
/* Description for the 'back button' accessibility trait */
"trait.backbutton.description" = "Кнопка назад.";

/* Description for the 'keyboard key' accessibility trait */
"trait.keyboard_key.description" = "Клавиша клавиатуры.";

/* Description for the 'tab' accessibility trait */
"trait.tab.description" = "Вкладка.";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ extension NSObject {
traitSpecifiers.append(strings.backButtonTraitName)
}

if accessibilityTraits.contains(.keyboardKey) {
traitSpecifiers.append(strings.keyboardKeyTraitName)
}

if accessibilityTraits.contains(.switchButton) {
if accessibilityTraits.contains(.button) {
// An element can have the private switch button trait without being a UISwitch (for example, by passing
Expand Down Expand Up @@ -326,6 +330,8 @@ extension NSObject {

let backButtonTraitName: String

let keyboardKeyTraitName: String

let tabTraitName: String

let headerTraitName: String
Expand Down Expand Up @@ -410,6 +416,11 @@ extension NSObject {
comment: "Description for the 'back button' accessibility trait",
locale: locale
)
self.keyboardKeyTraitName = "Keyboard Key.".localized(
key: "trait.keyboard_key.description",
comment: "Description for the 'keyboard key' accessibility trait",
locale: locale
)
self.tabTraitName = "Tab.".localized(
key: "trait.tab.description",
comment: "Description for the 'tab' accessibility trait",
Expand Down
Loading