From 8f1ac6301ff931d848c344d2137acadc6f3d12b8 Mon Sep 17 00:00:00 2001 From: Rudrank Date: Mon, 19 Aug 2019 10:43:20 +0530 Subject: [PATCH 1/5] add favorite and videoCall accessibilityLabel --- .../Chat/ChannelActionsViewController.swift | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Rocket.Chat/Controllers/Chat/ChannelActionsViewController.swift b/Rocket.Chat/Controllers/Chat/ChannelActionsViewController.swift index 8f4803310e..a1f810b44d 100644 --- a/Rocket.Chat/Controllers/Chat/ChannelActionsViewController.swift +++ b/Rocket.Chat/Controllers/Chat/ChannelActionsViewController.swift @@ -94,6 +94,8 @@ class ChannelActionsViewController: BaseViewController { tableView?.contentInsetAdjustmentBehavior = .never + navigationItem.leftBarButtonItem?.accessibilityLabel = VOLocalizedString("auth.close.label") + setupNavigationBarButtons() registerCells() } @@ -135,6 +137,7 @@ class ChannelActionsViewController: BaseViewController { target: self, action: #selector(buttonFavoriteDidPressed) ) + buttonFavorite.accessibilityLabel = favoriteButtonAccessibilityLabel buttons.append(buttonFavorite) self.buttonFavorite = buttonFavorite @@ -142,18 +145,24 @@ class ChannelActionsViewController: BaseViewController { } if settings.isJitsiEnabled && AppManager.isVideoCallAvailable { - buttons.append(UIBarButtonItem( - image: UIImage(named: "UserDetail_VideoCall"), + let buttonVideoCall = UIBarButtonItem(image: UIImage(named: "UserDetail_VideoCall"), style: .plain, target: self, action: #selector(buttonVideoCallDidPressed) - )) + ) + buttonVideoCall.accessibilityLabel = VOLocalizedString("channel.actions.videoCall.label") + buttons.append(buttonVideoCall) } navigationItem.rightBarButtonItems = buttons } } + // MARK: Accessibility + + var favoriteButtonAccessibilityLabel: String? = VOLocalizedString("channel.actions.star.label") + var favoriteSelectedButtonAccessibilityLabel: String? = VOLocalizedString("channel.actions.unstar.label") + func updateButtonFavoriteImage(_ force: Bool = false, value: Bool = false) { guard let buttonFavorite = self.buttonFavorite else { return } let favorite = force ? value : subscription?.favorite ?? false @@ -161,8 +170,10 @@ class ChannelActionsViewController: BaseViewController { if favorite { image = UIImage(named: "Star-Filled")?.imageWithTint(UIColor.RCFavoriteMark()) + buttonFavorite.accessibilityLabel = favoriteSelectedButtonAccessibilityLabel } else { image = UIImage(named: "Star")?.imageWithTint(UIColor.RCGray()) + buttonFavorite.accessibilityLabel = favoriteButtonAccessibilityLabel } buttonFavorite.image = image?.withRenderingMode(.alwaysOriginal) From aa9a2499aeb32a630fe38c6f218a7c583de1c8e1 Mon Sep 17 00:00:00 2001 From: Rudrank Date: Mon, 19 Aug 2019 10:48:12 +0530 Subject: [PATCH 2/5] add few more accessibilityLabels --- .../Controllers/Subscriptions/NewRoomViewController.swift | 2 ++ .../SubscriptionsList/SubscriptionsViewController.swift | 1 + 2 files changed, 3 insertions(+) diff --git a/Rocket.Chat/Controllers/Subscriptions/NewRoomViewController.swift b/Rocket.Chat/Controllers/Subscriptions/NewRoomViewController.swift index 85b604aee2..c0cec63ae3 100644 --- a/Rocket.Chat/Controllers/Subscriptions/NewRoomViewController.swift +++ b/Rocket.Chat/Controllers/Subscriptions/NewRoomViewController.swift @@ -99,6 +99,8 @@ final class NewRoomViewController: BaseViewController { override func viewDidLoad() { super.viewDidLoad() + navigationItem.leftBarButtonItem?.accessibilityLabel = VOLocalizedString("auth.close.label") + NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillChangeFrame(_:)), name: UIResponder.keyboardWillShowNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillChangeFrame(_:)), name: UIResponder.keyboardWillHideNotification, object: nil) diff --git a/Rocket.Chat/Controllers/Subscriptions/SubscriptionsList/SubscriptionsViewController.swift b/Rocket.Chat/Controllers/Subscriptions/SubscriptionsList/SubscriptionsViewController.swift index 85239c0959..4c1562a500 100644 --- a/Rocket.Chat/Controllers/Subscriptions/SubscriptionsList/SubscriptionsViewController.swift +++ b/Rocket.Chat/Controllers/Subscriptions/SubscriptionsList/SubscriptionsViewController.swift @@ -73,6 +73,7 @@ final class SubscriptionsViewController: BaseViewController { super.viewDidLoad() navigationItem.leftBarButtonItem?.accessibilityLabel = VOLocalizedString("channel.preferences.label") + navigationItem.leftBarButtonItem?.accessibilityLabel = VOLocalizedString("channel.settings.label") // If the device is not using the SplitView, we want to show // the 3D Touch preview for the cells From 7a8ffb1c9fa46312caf1a48f4fee0f7bd896f7e2 Mon Sep 17 00:00:00 2001 From: Rudrank Date: Mon, 19 Aug 2019 11:00:03 +0530 Subject: [PATCH 3/5] localisation of the accessibilityLabels --- .../SubscriptionsList/SubscriptionsViewController.swift | 2 +- Rocket.Chat/Resources/cs.lproj/VoiceOver.strings | 4 ++++ Rocket.Chat/Resources/de.lproj/VoiceOver.strings | 4 ++++ Rocket.Chat/Resources/el.lproj/VoiceOver.strings | 4 ++++ Rocket.Chat/Resources/en.lproj/VoiceOver.strings | 4 ++++ Rocket.Chat/Resources/es.lproj/VoiceOver.strings | 4 ++++ Rocket.Chat/Resources/fr.lproj/VoiceOver.strings | 4 ++++ Rocket.Chat/Resources/it.lproj/VoiceOver.strings | 4 ++++ Rocket.Chat/Resources/ja.lproj/VoiceOver.strings | 4 ++++ Rocket.Chat/Resources/pl.lproj/VoiceOver.strings | 4 ++++ Rocket.Chat/Resources/pt-BR.lproj/VoiceOver.strings | 4 ++++ Rocket.Chat/Resources/pt-PT.lproj/VoiceOver.strings | 4 ++++ Rocket.Chat/Resources/ru.lproj/VoiceOver.strings | 4 ++++ Rocket.Chat/Resources/zh-Hans.lproj/VoiceOver.strings | 4 ++++ Rocket.Chat/Resources/zh-Hant.lproj/VoiceOver.strings | 4 ++++ 15 files changed, 57 insertions(+), 1 deletion(-) diff --git a/Rocket.Chat/Controllers/Subscriptions/SubscriptionsList/SubscriptionsViewController.swift b/Rocket.Chat/Controllers/Subscriptions/SubscriptionsList/SubscriptionsViewController.swift index 4c1562a500..7369413c17 100644 --- a/Rocket.Chat/Controllers/Subscriptions/SubscriptionsList/SubscriptionsViewController.swift +++ b/Rocket.Chat/Controllers/Subscriptions/SubscriptionsList/SubscriptionsViewController.swift @@ -73,7 +73,7 @@ final class SubscriptionsViewController: BaseViewController { super.viewDidLoad() navigationItem.leftBarButtonItem?.accessibilityLabel = VOLocalizedString("channel.preferences.label") - navigationItem.leftBarButtonItem?.accessibilityLabel = VOLocalizedString("channel.settings.label") + navigationItem.rightBarButtonItem?.accessibilityLabel = VOLocalizedString("new_room.title.label") // If the device is not using the SplitView, we want to show // the 3D Touch preview for the cells diff --git a/Rocket.Chat/Resources/cs.lproj/VoiceOver.strings b/Rocket.Chat/Resources/cs.lproj/VoiceOver.strings index 9837f1bce0..4bca5f16f7 100644 --- a/Rocket.Chat/Resources/cs.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/cs.lproj/VoiceOver.strings @@ -22,6 +22,10 @@ // MARK: Channels "channel.preferences.label" = "Preferences"; // TODO +"new_room.title.label" = "Create new channel"; // TODO +"channel.actions.star.label" = "Star"; // TODO +"channel.actions.unstar.label" = "Unstar"; // TODO +"channel.actions.videoCall.label" = "Video Call"; // TODO // MARK: Subscriptions "subscriptions.main.userview.label" = "Session information"; diff --git a/Rocket.Chat/Resources/de.lproj/VoiceOver.strings b/Rocket.Chat/Resources/de.lproj/VoiceOver.strings index 416806c64b..b5942e446e 100644 --- a/Rocket.Chat/Resources/de.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/de.lproj/VoiceOver.strings @@ -22,6 +22,10 @@ // MARK: Channels "channel.preferences.label" = "Preferences"; // TODO +"new_room.title.label" = "Create new channel"; // TODO +"channel.actions.star.label" = "Star"; // TODO +"channel.actions.unstar.label" = "Unstar"; // TODO +"channel.actions.videoCall.label" = "Video Call"; // TODO // MARK: Subscriptions "subscriptions.main.userview.label" = "Sitzungsinformationen"; diff --git a/Rocket.Chat/Resources/el.lproj/VoiceOver.strings b/Rocket.Chat/Resources/el.lproj/VoiceOver.strings index 2551268bf5..23eda64c93 100644 --- a/Rocket.Chat/Resources/el.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/el.lproj/VoiceOver.strings @@ -22,6 +22,10 @@ // MARK: Channels "channel.preferences.label" = "Preferences"; // TODO +"new_room.title.label" = "Create new channel"; // TODO +"channel.actions.star.label" = "Star"; // TODO +"channel.actions.unstar.label" = "Unstar"; // TODO +"channel.actions.videoCall.label" = "Video Call"; // TODO // MARK: Subscriptions "subscriptions.main.userview.label" = "Πληροφορία Συνόδου"; diff --git a/Rocket.Chat/Resources/en.lproj/VoiceOver.strings b/Rocket.Chat/Resources/en.lproj/VoiceOver.strings index 95c94ada76..38c5345e26 100644 --- a/Rocket.Chat/Resources/en.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/en.lproj/VoiceOver.strings @@ -22,6 +22,10 @@ // MARK: Channels "channel.preferences.label" = "Preferences"; +"new_room.title.label" = "Create new channel"; +"channel.actions.star.label" = "Star"; +"channel.actions.unstar.label" = "Unstar"; +"channel.actions.videoCall.label" = "Video Call"; // MARK: Subscriptions "subscriptions.main.userview.label" = "Session information"; diff --git a/Rocket.Chat/Resources/es.lproj/VoiceOver.strings b/Rocket.Chat/Resources/es.lproj/VoiceOver.strings index d6bf232c6d..12dc1b0b9b 100644 --- a/Rocket.Chat/Resources/es.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/es.lproj/VoiceOver.strings @@ -22,6 +22,10 @@ // MARK: Channels "channel.preferences.label" = "Preferences"; // TODO +"new_room.title.label" = "Create new channel"; // TODO +"channel.actions.star.label" = "Star"; // TODO +"channel.actions.unstar.label" = "Unstar"; // TODO +"channel.actions.videoCall.label" = "Video Call"; // TODO // MARK: Subscriptions "subscriptions.main.userview.label" = "Información de la sesión"; diff --git a/Rocket.Chat/Resources/fr.lproj/VoiceOver.strings b/Rocket.Chat/Resources/fr.lproj/VoiceOver.strings index 9436ebc611..fbbdab158e 100644 --- a/Rocket.Chat/Resources/fr.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/fr.lproj/VoiceOver.strings @@ -22,6 +22,10 @@ // MARK: Channels "channel.preferences.label" = "Preferences"; // TODO +"new_room.title.label" = "Create new channel"; // TODO +"channel.actions.star.label" = "Star"; // TODO +"channel.actions.unstar.label" = "Unstar"; // TODO +"channel.actions.videoCall.label" = "Video Call"; // TODO // MARK: Subscriptions "subscriptions.main.userview.label" = "Session information"; diff --git a/Rocket.Chat/Resources/it.lproj/VoiceOver.strings b/Rocket.Chat/Resources/it.lproj/VoiceOver.strings index 2e0d526b00..b21ee66b1d 100644 --- a/Rocket.Chat/Resources/it.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/it.lproj/VoiceOver.strings @@ -22,6 +22,10 @@ // MARK: Channels "channel.preferences.label" = "Preferences"; // TODO +"new_room.title.label" = "Create new channel"; // TODO +"channel.actions.star.label" = "Star"; // TODO +"channel.actions.unstar.label" = "Unstar"; // TODO +"channel.actions.videoCall.label" = "Video Call"; // TODO // MARK: Subscriptions "subscriptions.main.userview.label" = "Informazioni Sessione"; diff --git a/Rocket.Chat/Resources/ja.lproj/VoiceOver.strings b/Rocket.Chat/Resources/ja.lproj/VoiceOver.strings index b70947585f..75070a19d2 100644 --- a/Rocket.Chat/Resources/ja.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/ja.lproj/VoiceOver.strings @@ -22,6 +22,10 @@ // MARK: Channels "channel.preferences.label" = "Preferences"; // TODO +"new_room.title.label" = "Create new channel"; // TODO +"channel.actions.star.label" = "Star"; // TODO +"channel.actions.unstar.label" = "Unstar"; // TODO +"channel.actions.videoCall.label" = "Video Call"; // TODO // MARK: Subscriptions "subscriptions.main.userview.label" = "セッション情報"; diff --git a/Rocket.Chat/Resources/pl.lproj/VoiceOver.strings b/Rocket.Chat/Resources/pl.lproj/VoiceOver.strings index af140a3598..aa0c14d9b2 100644 --- a/Rocket.Chat/Resources/pl.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/pl.lproj/VoiceOver.strings @@ -22,6 +22,10 @@ // MARK: Channels "channel.preferences.label" = "Preferences"; // TODO +"new_room.title.label" = "Create new channel"; // TODO +"channel.actions.star.label" = "Star"; // TODO +"channel.actions.unstar.label" = "Unstar"; // TODO +"channel.actions.videoCall.label" = "Video Call"; // TODO // MARK: Subscriptions "subscriptions.main.userview.label" = "Informacje o sesji"; diff --git a/Rocket.Chat/Resources/pt-BR.lproj/VoiceOver.strings b/Rocket.Chat/Resources/pt-BR.lproj/VoiceOver.strings index 7d80745784..6eba59006f 100644 --- a/Rocket.Chat/Resources/pt-BR.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/pt-BR.lproj/VoiceOver.strings @@ -22,6 +22,10 @@ // MARK: Channels "channel.preferences.label" = "Preferences"; // TODO +"new_room.title.label" = "Create new channel"; // TODO +"channel.actions.star.label" = "Star"; // TODO +"channel.actions.unstar.label" = "Unstar"; // TODO +"channel.actions.videoCall.label" = "Video Call"; // TODO // MARK: Subscriptions "subscriptions.main.userview.label" = "Informação da sessão"; diff --git a/Rocket.Chat/Resources/pt-PT.lproj/VoiceOver.strings b/Rocket.Chat/Resources/pt-PT.lproj/VoiceOver.strings index 7d80745784..6eba59006f 100644 --- a/Rocket.Chat/Resources/pt-PT.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/pt-PT.lproj/VoiceOver.strings @@ -22,6 +22,10 @@ // MARK: Channels "channel.preferences.label" = "Preferences"; // TODO +"new_room.title.label" = "Create new channel"; // TODO +"channel.actions.star.label" = "Star"; // TODO +"channel.actions.unstar.label" = "Unstar"; // TODO +"channel.actions.videoCall.label" = "Video Call"; // TODO // MARK: Subscriptions "subscriptions.main.userview.label" = "Informação da sessão"; diff --git a/Rocket.Chat/Resources/ru.lproj/VoiceOver.strings b/Rocket.Chat/Resources/ru.lproj/VoiceOver.strings index 486b7d80dd..f413d84fb1 100644 --- a/Rocket.Chat/Resources/ru.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/ru.lproj/VoiceOver.strings @@ -22,6 +22,10 @@ // MARK: Channels "channel.preferences.label" = "Preferences"; // TODO +"new_room.title.label" = "Create new channel"; // TODO +"channel.actions.star.label" = "Star"; // TODO +"channel.actions.unstar.label" = "Unstar"; // TODO +"channel.actions.videoCall.label" = "Video Call"; // TODO // MARK: Subscriptions "subscriptions.main.userview.label" = "Информация о сеансе"; diff --git a/Rocket.Chat/Resources/zh-Hans.lproj/VoiceOver.strings b/Rocket.Chat/Resources/zh-Hans.lproj/VoiceOver.strings index e7a8661ac5..3d0f4c6b15 100644 --- a/Rocket.Chat/Resources/zh-Hans.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/zh-Hans.lproj/VoiceOver.strings @@ -22,6 +22,10 @@ // MARK: Channels "channel.preferences.label" = "Preferences"; // TODO +"new_room.title.label" = "Create new channel"; // TODO +"channel.actions.star.label" = "Star"; // TODO +"channel.actions.unstar.label" = "Unstar"; // TODO +"channel.actions.videoCall.label" = "Video Call"; // TODO // MARK: Subscriptions "subscriptions.main.userview.label" = "会话信息"; diff --git a/Rocket.Chat/Resources/zh-Hant.lproj/VoiceOver.strings b/Rocket.Chat/Resources/zh-Hant.lproj/VoiceOver.strings index fd93a1cc8a..6bd2afee96 100644 --- a/Rocket.Chat/Resources/zh-Hant.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/zh-Hant.lproj/VoiceOver.strings @@ -22,6 +22,10 @@ // MARK: Channels "channel.preferences.label" = "Preferences"; // TODO +"new_room.title.label" = "Create new channel"; // TODO +"channel.actions.star.label" = "Star"; // TODO +"channel.actions.unstar.label" = "Unstar"; // TODO +"channel.actions.videoCall.label" = "Video Call"; // TODO // MARK: Subscriptions "subscriptions.main.userview.label" = "聊天訊息"; From accc3813b42f293ca69288013b0646df04a60835 Mon Sep 17 00:00:00 2001 From: Rudrank Date: Mon, 19 Aug 2019 12:47:49 +0530 Subject: [PATCH 4/5] localisation of the accessibilityLabels --- Rocket.Chat/Resources/cs.lproj/VoiceOver.strings | 4 +++- Rocket.Chat/Resources/de.lproj/VoiceOver.strings | 3 +++ Rocket.Chat/Resources/el.lproj/VoiceOver.strings | 3 +++ Rocket.Chat/Resources/en.lproj/VoiceOver.strings | 5 ++++- Rocket.Chat/Resources/es.lproj/VoiceOver.strings | 3 +++ Rocket.Chat/Resources/fr.lproj/VoiceOver.strings | 3 +++ Rocket.Chat/Resources/it.lproj/VoiceOver.strings | 3 +++ Rocket.Chat/Resources/ja.lproj/VoiceOver.strings | 3 +++ Rocket.Chat/Resources/pl.lproj/VoiceOver.strings | 3 +++ Rocket.Chat/Resources/pt-BR.lproj/VoiceOver.strings | 3 +++ Rocket.Chat/Resources/pt-PT.lproj/VoiceOver.strings | 3 +++ Rocket.Chat/Resources/ru.lproj/VoiceOver.strings | 3 +++ Rocket.Chat/Resources/zh-Hans.lproj/VoiceOver.strings | 3 +++ Rocket.Chat/Resources/zh-Hant.lproj/VoiceOver.strings | 3 +++ 14 files changed, 43 insertions(+), 2 deletions(-) diff --git a/Rocket.Chat/Resources/cs.lproj/VoiceOver.strings b/Rocket.Chat/Resources/cs.lproj/VoiceOver.strings index 4bca5f16f7..4c3278a577 100644 --- a/Rocket.Chat/Resources/cs.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/cs.lproj/VoiceOver.strings @@ -32,7 +32,9 @@ "subscriptions.main.userview.value" = "Server: %@. User: %@. Status: %@."; "subscriptions.main.userview.hint" = "Double tap to change status."; "subscriptions.main.channel.hint" = "Double tap to enter"; // TODO - +"subscriptions.list.message.label" = "Message: "; // TODO +"subscriptions.list.notification.label" = "Notification"; // TODO +"subscriptions.list.notifications.label" = "Notifications"; // TODO // MARK: Preferences "preferences.profile.edit.label" = "Profile picture"; // TODO diff --git a/Rocket.Chat/Resources/de.lproj/VoiceOver.strings b/Rocket.Chat/Resources/de.lproj/VoiceOver.strings index b5942e446e..a19eb8c73d 100644 --- a/Rocket.Chat/Resources/de.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/de.lproj/VoiceOver.strings @@ -32,6 +32,9 @@ "subscriptions.main.userview.value" = "Server: %@. Benutzer: %@. Status: %@."; "subscriptions.main.userview.hint" = "Klicken Sie doppelt, um den Status zu ändern."; "subscriptions.main.channel.hint" = "Double tap to enter"; // TODO +"subscriptions.list.message.label" = "Message: "; // TODO +"subscriptions.list.notification.label" = "Notification"; // TODO +"subscriptions.list.notifications.label" = "Notifications"; // TODO // MARK: Preferences "preferences.profile.edit.label" = "Profile picture"; // TODO diff --git a/Rocket.Chat/Resources/el.lproj/VoiceOver.strings b/Rocket.Chat/Resources/el.lproj/VoiceOver.strings index 23eda64c93..57933e5f23 100644 --- a/Rocket.Chat/Resources/el.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/el.lproj/VoiceOver.strings @@ -32,6 +32,9 @@ "subscriptions.main.userview.value" = "Εξυπηρετητής: %@. Χρήστης: %@. Κατάσταση: %@."; "subscriptions.main.userview.hint" = "Πατήστε δύο φορές για αλλαγή κατάστασης."; "subscriptions.main.channel.hint" = "Double tap to enter"; // TODO +"subscriptions.list.message.label" = "Message: "; // TODO +"subscriptions.list.notification.label" = "Notification"; // TODO +"subscriptions.list.notifications.label" = "Notifications"; // TODO // MARK: Preferences "preferences.profile.edit.label" = "Profile picture"; // TODO diff --git a/Rocket.Chat/Resources/en.lproj/VoiceOver.strings b/Rocket.Chat/Resources/en.lproj/VoiceOver.strings index 38c5345e26..f1587bf818 100644 --- a/Rocket.Chat/Resources/en.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/en.lproj/VoiceOver.strings @@ -31,7 +31,10 @@ "subscriptions.main.userview.label" = "Session information"; "subscriptions.main.userview.value" = "Server: %@. User: %@. Status: %@."; "subscriptions.main.userview.hint" = "Double tap to change status."; -"subscriptions.main.channel.hint" = "Double tap to enter"; +"subscriptions.main.channel.hint" = "Double tap to enter"; +"subscriptions.list.message.label" = "Message: "; +"subscriptions.list.notification.label" = "Notification"; +"subscriptions.list.notifications.label" = "Notifications"; // MARK: Preferences "preferences.profile.edit.label" = "Profile picture"; diff --git a/Rocket.Chat/Resources/es.lproj/VoiceOver.strings b/Rocket.Chat/Resources/es.lproj/VoiceOver.strings index 12dc1b0b9b..4b4a08139e 100644 --- a/Rocket.Chat/Resources/es.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/es.lproj/VoiceOver.strings @@ -32,6 +32,9 @@ "subscriptions.main.userview.value" = "Servidor: %@. Usuario: %@. Estado: %@."; "subscriptions.main.userview.hint" = "Toca dos veces para cambiar el estado"; "subscriptions.main.channel.hint" = "Double tap to enter"; // TODO +"subscriptions.list.message.label" = "Message: "; // TODO +"subscriptions.list.notification.label" = "Notification"; // TODO +"subscriptions.list.notifications.label" = "Notifications"; // TODO // MARK: Preferences "preferences.profile.edit.label" = "Profile picture"; // TODO diff --git a/Rocket.Chat/Resources/fr.lproj/VoiceOver.strings b/Rocket.Chat/Resources/fr.lproj/VoiceOver.strings index fbbdab158e..4c3278a577 100644 --- a/Rocket.Chat/Resources/fr.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/fr.lproj/VoiceOver.strings @@ -32,6 +32,9 @@ "subscriptions.main.userview.value" = "Server: %@. User: %@. Status: %@."; "subscriptions.main.userview.hint" = "Double tap to change status."; "subscriptions.main.channel.hint" = "Double tap to enter"; // TODO +"subscriptions.list.message.label" = "Message: "; // TODO +"subscriptions.list.notification.label" = "Notification"; // TODO +"subscriptions.list.notifications.label" = "Notifications"; // TODO // MARK: Preferences "preferences.profile.edit.label" = "Profile picture"; // TODO diff --git a/Rocket.Chat/Resources/it.lproj/VoiceOver.strings b/Rocket.Chat/Resources/it.lproj/VoiceOver.strings index b21ee66b1d..7293c61ddf 100644 --- a/Rocket.Chat/Resources/it.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/it.lproj/VoiceOver.strings @@ -32,6 +32,9 @@ "subscriptions.main.userview.value" = "Server: %@. Utente: %@. Stato: %@."; "subscriptions.main.userview.hint" = "Fare doppio clic per cambiare lo stato."; "subscriptions.main.channel.hint" = "Double tap to enter"; // TODO +"subscriptions.list.message.label" = "Message: "; // TODO +"subscriptions.list.notification.label" = "Notification"; // TODO +"subscriptions.list.notifications.label" = "Notifications"; // TODO // MARK: Preferences "preferences.profile.edit.label" = "Profile picture"; // TODO diff --git a/Rocket.Chat/Resources/ja.lproj/VoiceOver.strings b/Rocket.Chat/Resources/ja.lproj/VoiceOver.strings index 75070a19d2..57c1ef58dd 100644 --- a/Rocket.Chat/Resources/ja.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/ja.lproj/VoiceOver.strings @@ -32,6 +32,9 @@ "subscriptions.main.userview.value" = "サーバー: %@. ユーザー: %@. ステータス: %@."; "subscriptions.main.userview.hint" = "ステータスを変更するにはダブルタップしてください。"; "subscriptions.main.channel.hint" = "Double tap to enter"; // TODO +"subscriptions.list.message.label" = "Message: "; // TODO +"subscriptions.list.notification.label" = "Notification"; // TODO +"subscriptions.list.notifications.label" = "Notifications"; // TODO // MARK: Preferences "preferences.profile.edit.label" = "Profile picture"; // TODO diff --git a/Rocket.Chat/Resources/pl.lproj/VoiceOver.strings b/Rocket.Chat/Resources/pl.lproj/VoiceOver.strings index aa0c14d9b2..b93655d205 100644 --- a/Rocket.Chat/Resources/pl.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/pl.lproj/VoiceOver.strings @@ -32,6 +32,9 @@ "subscriptions.main.userview.value" = "Serwer: %@. Użytkownik: %@. Status: %@."; "subscriptions.main.userview.hint" = "Dotknij dwukrotnie aby zmienić status."; "subscriptions.main.channel.hint" = "Double tap to enter"; // TODO +"subscriptions.list.message.label" = "Message: "; // TODO +"subscriptions.list.notification.label" = "Notification"; // TODO +"subscriptions.list.notifications.label" = "Notifications"; // TODO // MARK: Preferences "preferences.profile.edit.label" = "Profile picture"; // TODO diff --git a/Rocket.Chat/Resources/pt-BR.lproj/VoiceOver.strings b/Rocket.Chat/Resources/pt-BR.lproj/VoiceOver.strings index 6eba59006f..c05cd2a49a 100644 --- a/Rocket.Chat/Resources/pt-BR.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/pt-BR.lproj/VoiceOver.strings @@ -32,6 +32,9 @@ "subscriptions.main.userview.value" = "Servidor: %@. Usuário: %@. Status: %@."; "subscriptions.main.userview.hint" = "Toque duplo para mudar o status."; "subscriptions.main.channel.hint" = "Double tap to enter"; // TODO +"subscriptions.list.message.label" = "Message: "; // TODO +"subscriptions.list.notification.label" = "Notification"; // TODO +"subscriptions.list.notifications.label" = "Notifications"; // TODO // MARK: Preferences "preferences.profile.edit.label" = "Profile picture"; // TODO diff --git a/Rocket.Chat/Resources/pt-PT.lproj/VoiceOver.strings b/Rocket.Chat/Resources/pt-PT.lproj/VoiceOver.strings index 6eba59006f..c05cd2a49a 100644 --- a/Rocket.Chat/Resources/pt-PT.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/pt-PT.lproj/VoiceOver.strings @@ -32,6 +32,9 @@ "subscriptions.main.userview.value" = "Servidor: %@. Usuário: %@. Status: %@."; "subscriptions.main.userview.hint" = "Toque duplo para mudar o status."; "subscriptions.main.channel.hint" = "Double tap to enter"; // TODO +"subscriptions.list.message.label" = "Message: "; // TODO +"subscriptions.list.notification.label" = "Notification"; // TODO +"subscriptions.list.notifications.label" = "Notifications"; // TODO // MARK: Preferences "preferences.profile.edit.label" = "Profile picture"; // TODO diff --git a/Rocket.Chat/Resources/ru.lproj/VoiceOver.strings b/Rocket.Chat/Resources/ru.lproj/VoiceOver.strings index f413d84fb1..da34e5f8a8 100644 --- a/Rocket.Chat/Resources/ru.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/ru.lproj/VoiceOver.strings @@ -32,6 +32,9 @@ "subscriptions.main.userview.value" = "Сервер: %@. Пользователь: %@. Статус: %@."; "subscriptions.main.userview.hint" = "Дважды нажмите, чтобы изменить статус."; "subscriptions.main.channel.hint" = "Double tap to enter"; // TODO +"subscriptions.list.message.label" = "Message: "; // TODO +"subscriptions.list.notification.label" = "Notification"; // TODO +"subscriptions.list.notifications.label" = "Notifications"; // TODO // MARK: Preferences "preferences.profile.edit.label" = "Profile picture"; // TODO diff --git a/Rocket.Chat/Resources/zh-Hans.lproj/VoiceOver.strings b/Rocket.Chat/Resources/zh-Hans.lproj/VoiceOver.strings index 3d0f4c6b15..d71a749e78 100644 --- a/Rocket.Chat/Resources/zh-Hans.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/zh-Hans.lproj/VoiceOver.strings @@ -32,6 +32,9 @@ "subscriptions.main.userview.value" = "服务器: %@. 用户: %@. 状态: %@."; "subscriptions.main.userview.hint" = "双击变更状态"; "subscriptions.main.channel.hint" = "Double tap to enter"; // TODO +"subscriptions.list.message.label" = "Message: "; // TODO +"subscriptions.list.notification.label" = "Notification"; // TODO +"subscriptions.list.notifications.label" = "Notifications"; // TODO // MARK: Preferences "preferences.profile.edit.label" = "Profile picture"; // TODO diff --git a/Rocket.Chat/Resources/zh-Hant.lproj/VoiceOver.strings b/Rocket.Chat/Resources/zh-Hant.lproj/VoiceOver.strings index 6bd2afee96..96e6b13e13 100644 --- a/Rocket.Chat/Resources/zh-Hant.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/zh-Hant.lproj/VoiceOver.strings @@ -32,6 +32,9 @@ "subscriptions.main.userview.value" = "伺服器: %@. 訊息: %@. 狀態: %@."; "subscriptions.main.userview.hint" = "點擊兩下變更狀態"; "subscriptions.main.channel.hint" = "Double tap to enter"; // TODO +"subscriptions.list.message.label" = "Message: "; // TODO +"subscriptions.list.notification.label" = "Notification"; // TODO +"subscriptions.list.notifications.label" = "Notifications"; // TODO // MARK: Preferences "preferences.profile.edit.label" = "Profile picture"; // TODO From c690c33c79167fa18c7e1d114b138d429a7fd8f7 Mon Sep 17 00:00:00 2001 From: Rudrank Date: Mon, 19 Aug 2019 12:48:07 +0530 Subject: [PATCH 5/5] formatting the date and time for natural VoiceOver --- .../Cells/Subscription/BaseSubscriptionCell.swift | 10 ++++++++++ .../Cells/Subscription/SubscriptionCell.swift | 14 +++++++++----- .../Subscriptions/SubscriptionsTitleView.swift | 1 + 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/Rocket.Chat/Views/Cells/Subscription/BaseSubscriptionCell.swift b/Rocket.Chat/Views/Cells/Subscription/BaseSubscriptionCell.swift index d18ff3b7ac..fe53b18738 100644 --- a/Rocket.Chat/Views/Cells/Subscription/BaseSubscriptionCell.swift +++ b/Rocket.Chat/Views/Cells/Subscription/BaseSubscriptionCell.swift @@ -101,6 +101,16 @@ class BaseSubscriptionCell: SwipeTableViewCell, SubscriptionCellProtocol { if subscription.unread > 0 { viewUnread.isHidden = false labelUnread.text = "\(subscription.unread)" + + if subscription.unread == 1 { + labelUnread.accessibilityLabel = + ["\(subscription.unread) ", VOLocalizedString("subscriptions.list.notification.label")] + .compactMap {$0}.joined() + } else { + labelUnread.accessibilityLabel = + ["\(subscription.unread) ", VOLocalizedString("subscriptions.list.notifications.label")] + .compactMap {$0}.joined() + } } else { viewUnread.isHidden = true } diff --git a/Rocket.Chat/Views/Cells/Subscription/SubscriptionCell.swift b/Rocket.Chat/Views/Cells/Subscription/SubscriptionCell.swift index 2035da39ba..5cf5a038a0 100644 --- a/Rocket.Chat/Views/Cells/Subscription/SubscriptionCell.swift +++ b/Rocket.Chat/Views/Cells/Subscription/SubscriptionCell.swift @@ -27,9 +27,13 @@ final class SubscriptionCell: BaseSubscriptionCell { guard let subscription = subscription?.managedObject else { return } labelLastMessage.text = subscription.roomLastMessageText ?? localized("subscriptions.list.no_message") + labelLastMessage.accessibilityLabel = + [VOLocalizedString("subscriptions.list.message.label"), labelLastMessage.text].compactMap {$0}.joined() if let roomLastMessage = subscription.roomLastMessage?.createdAt { - labelDate.text = dateFormatted(date: roomLastMessage) + let formattedDate = dateFormatted(date: roomLastMessage) + labelDate.text = formattedDate.label + labelDate.accessibilityLabel = formattedDate.accessibilityLabel } else { labelDate.text = nil } @@ -82,18 +86,18 @@ final class SubscriptionCell: BaseSubscriptionCell { } } - func dateFormatted(date: Date) -> String { + func dateFormatted(date: Date) -> (label: String, accessibilityLabel: String) { let calendar = NSCalendar.current if calendar.isDateInYesterday(date) { - return localized("subscriptions.list.date.yesterday") + return (localized("subscriptions.list.date.yesterday"), localized("subscriptions.list.date.yesterday")) } if calendar.isDateInToday(date) { - return RCDateFormatter.time(date) + return (RCDateFormatter.time(date), RCDateFormatter.time(date)) } - return RCDateFormatter.date(date, dateStyle: .short) + return (RCDateFormatter.date(date, dateStyle: .short), RCDateFormatter.date(date, dateStyle: .medium)) } } diff --git a/Rocket.Chat/Views/Subscriptions/SubscriptionsTitleView.swift b/Rocket.Chat/Views/Subscriptions/SubscriptionsTitleView.swift index 1d0bc46ea8..87a597b370 100644 --- a/Rocket.Chat/Views/Subscriptions/SubscriptionsTitleView.swift +++ b/Rocket.Chat/Views/Subscriptions/SubscriptionsTitleView.swift @@ -22,6 +22,7 @@ final class SubscriptionsTitleView: UIView { @IBOutlet weak var labelMessages: UILabel! { didSet { labelMessages.text = localized("subscriptions.messages") + labelMessages.accessibilityTraits = .header } }