From 1427e1d8c67958ca449fe3a8ec4bdb226bcdb6f7 Mon Sep 17 00:00:00 2001 From: Rizwan Mohamed Ibrahim Date: Tue, 14 Jul 2020 18:07:29 +0530 Subject: [PATCH 1/3] Add a11y label for expanded/collapsed status for Master Feed --- .../Cell/MasterFeedTableViewSectionHeader.swift | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/iOS/MasterFeed/Cell/MasterFeedTableViewSectionHeader.swift b/iOS/MasterFeed/Cell/MasterFeedTableViewSectionHeader.swift index 3fcf7506f..0742fcb47 100644 --- a/iOS/MasterFeed/Cell/MasterFeedTableViewSectionHeader.swift +++ b/iOS/MasterFeed/Cell/MasterFeedTableViewSectionHeader.swift @@ -21,12 +21,22 @@ class MasterFeedTableViewSectionHeader: UITableViewHeaderFooterView { get { if unreadCount > 0 { let unreadLabel = NSLocalizedString("unread", comment: "Unread label for accessiblity") - return "\(name) \(unreadCount) \(unreadLabel)" + return "\(name) \(unreadCount) \(unreadLabel) \(expandedStateMessage) " } else { - return name + return "\(name) \(expandedStateMessage) " } } } + + private var expandedStateMessage: String { + set {} + get { + if disclosureExpanded { + return NSLocalizedString("Expanded", comment: "Disclosure button expanded state for accessibility") + } + return NSLocalizedString("Collapsed", comment: "Disclosure button expanded state for accessibility") + } + } var unreadCount: Int { get { From 1a3bbf7dbf105bd9c50ce35b83ced8f652da455e Mon Sep 17 00:00:00 2001 From: Rizwan Mohamed Ibrahim Date: Tue, 14 Jul 2020 18:08:07 +0530 Subject: [PATCH 2/3] Add a11y label for starred status on master timeline --- iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift b/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift index 813420cf6..76684e7f5 100644 --- a/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift +++ b/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift @@ -237,8 +237,9 @@ private extension MasterTimelineTableViewCell { } func updateAccessiblityLabel() { - var label = cellData.read ? "" : "\(NSLocalizedString("Unread", comment: "Unread")), " - label += "\(cellData.feedName), \(cellData.title), \(cellData.summary), \(cellData.dateString)" + let starredStatus = cellData.starred ? "\(NSLocalizedString("Starred", comment: "Favourites article for accessibility")), " : "" + let unreadStatus = cellData.read ? "" : "\(NSLocalizedString("Unread", comment: "Unread")), " + let label = starredStatus + unreadStatus + "\(cellData.feedName), \(cellData.title), \(cellData.summary), \(cellData.dateString)" accessibilityLabel = label } From 64a4d9bbe5c1d1d3761b47a9ffdfd4d62bafd6f5 Mon Sep 17 00:00:00 2001 From: Rizwan Mohamed Ibrahim Date: Tue, 14 Jul 2020 22:04:20 +0530 Subject: [PATCH 3/3] Fix localised comments --- iOS/MasterFeed/Cell/MasterFeedTableViewSectionHeader.swift | 2 +- iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iOS/MasterFeed/Cell/MasterFeedTableViewSectionHeader.swift b/iOS/MasterFeed/Cell/MasterFeedTableViewSectionHeader.swift index 0742fcb47..dc5b21ed6 100644 --- a/iOS/MasterFeed/Cell/MasterFeedTableViewSectionHeader.swift +++ b/iOS/MasterFeed/Cell/MasterFeedTableViewSectionHeader.swift @@ -34,7 +34,7 @@ class MasterFeedTableViewSectionHeader: UITableViewHeaderFooterView { if disclosureExpanded { return NSLocalizedString("Expanded", comment: "Disclosure button expanded state for accessibility") } - return NSLocalizedString("Collapsed", comment: "Disclosure button expanded state for accessibility") + return NSLocalizedString("Collapsed", comment: "Disclosure button collapsed state for accessibility") } } diff --git a/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift b/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift index 76684e7f5..7d3a1b936 100644 --- a/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift +++ b/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift @@ -237,7 +237,7 @@ private extension MasterTimelineTableViewCell { } func updateAccessiblityLabel() { - let starredStatus = cellData.starred ? "\(NSLocalizedString("Starred", comment: "Favourites article for accessibility")), " : "" + let starredStatus = cellData.starred ? "\(NSLocalizedString("Starred", comment: "Starred article for accessibility")), " : "" let unreadStatus = cellData.read ? "" : "\(NSLocalizedString("Unread", comment: "Unread")), " let label = starredStatus + unreadStatus + "\(cellData.feedName), \(cellData.title), \(cellData.summary), \(cellData.dateString)" accessibilityLabel = label