diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2021-06-09 12:12:06 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2021-07-14 14:22:04 +0200 |
| commit | 556ef78590e56d158a4d381fda0da1aa37b5e228 (patch) | |
| tree | 2aab13868465b5ac513b5ad6642a2c3b758be7cd /ios | |
| parent | b75721382f917b1feb90fb69d77d18244c222d6c (diff) | |
| download | mullvadvpn-556ef78590e56d158a4d381fda0da1aa37b5e228.tar.xz mullvadvpn-556ef78590e56d158a4d381fda0da1aa37b5e228.zip | |
Accessibility: improve accessibility in ConnectionPanelView
Diffstat (limited to 'ios')
| -rw-r--r-- | ios/MullvadVPN/ConnectViewController.swift | 2 | ||||
| -rw-r--r-- | ios/MullvadVPN/ConnectionPanelView.swift | 15 | ||||
| -rw-r--r-- | ios/MullvadVPN/en.lproj/Localizable.strings | 6 |
3 files changed, 21 insertions, 2 deletions
diff --git a/ios/MullvadVPN/ConnectViewController.swift b/ios/MullvadVPN/ConnectViewController.swift index f07e5914ab..d0587ccea1 100644 --- a/ios/MullvadVPN/ConnectViewController.swift +++ b/ios/MullvadVPN/ConnectViewController.swift @@ -192,7 +192,7 @@ class ConnectViewController: UIViewController, MKMapViewDelegate, RootContainmen outAddress: nil ) mainContentView.connectionPanel.isHidden = false - mainContentView.connectionPanel.collapseButton.setTitle(connectionInfo.hostname, for: .normal) + mainContentView.connectionPanel.connectedRelayName = connectionInfo.hostname case .connecting, .disconnected, .disconnecting: mainContentView.countryLabel.attributedText = attributedStringForLocation(string: " ") diff --git a/ios/MullvadVPN/ConnectionPanelView.swift b/ios/MullvadVPN/ConnectionPanelView.swift index 926ff9051f..17b2ccc796 100644 --- a/ios/MullvadVPN/ConnectionPanelView.swift +++ b/ios/MullvadVPN/ConnectionPanelView.swift @@ -28,7 +28,18 @@ class ConnectionPanelView: UIView { } } - let collapseButton: ConnectionPanelCollapseButton = { + var connectedRelayName: String = "" { + didSet { + collapseButton.setTitle(connectedRelayName, for: .normal) + collapseButton.accessibilityLabel = NSLocalizedString("CONNECTION_PANEL_RELAY_ACCESSIBILITY_LABEL", comment: "") + collapseButton.accessibilityAttributedValue = NSAttributedString( + string: connectedRelayName.replacingOccurrences(of: "-wireguard", with: " WireGuard"), + attributes: [ .accessibilitySpeechLanguage: "en" ] + ) + } + } + + private let collapseButton: ConnectionPanelCollapseButton = { let button = ConnectionPanelCollapseButton(type: .custom) button.translatesAutoresizingMaskIntoConstraints = false button.tintColor = .white @@ -146,6 +157,8 @@ class ConnectionPanelAddressRow: UIView { super.init(frame: frame) + isAccessibilityElement = true + addSubview(stackView) NSLayoutConstraint.activate([ diff --git a/ios/MullvadVPN/en.lproj/Localizable.strings b/ios/MullvadVPN/en.lproj/Localizable.strings index 0e83a02148..b42834aad1 100644 --- a/ios/MullvadVPN/en.lproj/Localizable.strings +++ b/ios/MullvadVPN/en.lproj/Localizable.strings @@ -16,3 +16,9 @@ "ACCOUNT_EXPIRY_SYSTEM_NOTIFICATION_BODY" = "Account credit expires in 3 days. Buy more credit."; "ACCOUNT_EXPIRY_INAPP_NOTIFICATION_TITLE" = "ACCOUNT CREDIT EXPIRES SOON"; "ACCOUNT_EXPIRY_INAPP_NOTIFICATION_BODY" = "%@ left. Buy more credit."; + +"CONNECTION_PANEL_RELAY_ACCESSIBILITY_LABEL" = "Connected relay"; +"CONNECTION_PANEL_IN_ADDRESS_LABEL" = "In"; +"CONNECTION_PANEL_IN_ADDRESS_ACCESSIBILITY_LABEL" = "Input IP address"; +"CONNECTION_PANEL_OUT_ADDRESS_LABEL" = "Out"; +"CONNECTION_PANEL_OUT_ADDRESS_ACCESSIBILITY_LABEL" = "Output IP address"; |
