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) 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..7369413c17 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.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..4c3278a577 100644 --- a/Rocket.Chat/Resources/cs.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/cs.lproj/VoiceOver.strings @@ -22,13 +22,19 @@ // 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"; "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 416806c64b..a19eb8c73d 100644 --- a/Rocket.Chat/Resources/de.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/de.lproj/VoiceOver.strings @@ -22,12 +22,19 @@ // 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"; "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 2551268bf5..57933e5f23 100644 --- a/Rocket.Chat/Resources/el.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/el.lproj/VoiceOver.strings @@ -22,12 +22,19 @@ // 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" = "Πληροφορία Συνόδου"; "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 95c94ada76..f1587bf818 100644 --- a/Rocket.Chat/Resources/en.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/en.lproj/VoiceOver.strings @@ -22,12 +22,19 @@ // 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"; "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 d6bf232c6d..4b4a08139e 100644 --- a/Rocket.Chat/Resources/es.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/es.lproj/VoiceOver.strings @@ -22,12 +22,19 @@ // 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"; "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 9436ebc611..4c3278a577 100644 --- a/Rocket.Chat/Resources/fr.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/fr.lproj/VoiceOver.strings @@ -22,12 +22,19 @@ // 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"; "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 2e0d526b00..7293c61ddf 100644 --- a/Rocket.Chat/Resources/it.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/it.lproj/VoiceOver.strings @@ -22,12 +22,19 @@ // 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"; "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 b70947585f..57c1ef58dd 100644 --- a/Rocket.Chat/Resources/ja.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/ja.lproj/VoiceOver.strings @@ -22,12 +22,19 @@ // 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" = "セッション情報"; "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 af140a3598..b93655d205 100644 --- a/Rocket.Chat/Resources/pl.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/pl.lproj/VoiceOver.strings @@ -22,12 +22,19 @@ // 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"; "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 7d80745784..c05cd2a49a 100644 --- a/Rocket.Chat/Resources/pt-BR.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/pt-BR.lproj/VoiceOver.strings @@ -22,12 +22,19 @@ // 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"; "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 7d80745784..c05cd2a49a 100644 --- a/Rocket.Chat/Resources/pt-PT.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/pt-PT.lproj/VoiceOver.strings @@ -22,12 +22,19 @@ // 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"; "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 486b7d80dd..da34e5f8a8 100644 --- a/Rocket.Chat/Resources/ru.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/ru.lproj/VoiceOver.strings @@ -22,12 +22,19 @@ // 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" = "Информация о сеансе"; "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 e7a8661ac5..d71a749e78 100644 --- a/Rocket.Chat/Resources/zh-Hans.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/zh-Hans.lproj/VoiceOver.strings @@ -22,12 +22,19 @@ // 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" = "会话信息"; "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 fd93a1cc8a..96e6b13e13 100644 --- a/Rocket.Chat/Resources/zh-Hant.lproj/VoiceOver.strings +++ b/Rocket.Chat/Resources/zh-Hant.lproj/VoiceOver.strings @@ -22,12 +22,19 @@ // 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" = "聊天訊息"; "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/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 } }