diff --git a/WMF Framework/CommonStrings.swift b/WMF Framework/CommonStrings.swift index 13e1c741eb..9959a75f20 100644 --- a/WMF Framework/CommonStrings.swift +++ b/WMF Framework/CommonStrings.swift @@ -54,6 +54,11 @@ public class CommonStrings: NSObject { @objc public static let notificationsCenterTitle = WMFLocalizedString("notifications-center-title", value: "Notifications", comment: "Title for Notifications Center interface, as well as the accessibility label for the button that navigates to Notifications Center.") @objc public static let notificationsCenterBadgeTitle = WMFLocalizedString("notifications-center-badge-button-accessibility-label", value: "Notifications with unread badge", comment: "Accessibility label for a button that navigates to Notifications Center. This button has a badge indicating there are unread notifications.") + + @objc public static let profileButtonTitle = WMFLocalizedString("profile-button-accessibility-label", value: "Profile", comment: "Accessibility label for the profile navigation bar button. Tapping it navigates to the user profile view.") + @objc public static let profileButtonAccessibilityHint = WMFLocalizedString("profile-button-accessibility-hint", value: "Navigates to the profile view.", comment: "Accessibility hint for the profile navigation bar button. Explains to the user what will happen upon button tap.") + @objc public static let profileButtonBadgeTitle = WMFLocalizedString("profile-button-badge-accessibility-label", value: "Profile with unread badge", comment: "Accessibility label for the profile navigation bar badge button. This button has a badge indicating there are unread notifications. Tapping it navigates to the user profile view.") + public static let notificationsCenterMarkAsRead = WMFLocalizedString("notifications-center-mark-as-read", value: "Mark as Read", comment: "Button text in Notifications Center to mark a notification as read.") public static let notificationsCenterMarkAsReadSwipe = WMFLocalizedString("notifications-center-swipe-mark-as-read", value: "Mark as read", comment: "Button text in Notifications Center swipe actions to mark a notification as read.") public static let notificationsCenterMarkAsUnread = WMFLocalizedString("notifications-center-mark-as-unread", value: "Mark as Unread", comment: "Button text in Notifications Center to mark a notification as unread.") diff --git a/WMF Framework/NavigationBar.swift b/WMF Framework/NavigationBar.swift index 2ed6caabbc..63be68cf41 100644 --- a/WMF Framework/NavigationBar.swift +++ b/WMF Framework/NavigationBar.swift @@ -281,6 +281,7 @@ public class NavigationBar: SetupView, FakeProgressReceiving, FakeProgressDelega barButtonItem.isEnabled = item.isEnabled barButtonItem.isAccessibilityElement = item.isAccessibilityElement barButtonItem.accessibilityLabel = item.accessibilityLabel + barButtonItem.accessibilityHint = item.accessibilityHint return barButtonItem } diff --git a/Wikipedia/Code/ArticleViewController.swift b/Wikipedia/Code/ArticleViewController.swift index a55b516cdc..62636f9e0a 100644 --- a/Wikipedia/Code/ArticleViewController.swift +++ b/Wikipedia/Code/ArticleViewController.swift @@ -1302,6 +1302,8 @@ private extension ArticleViewController { let profileImage = BarButtonImageStyle.profileButtonImage(theme: theme, indicated: hasUnreadNotifications, isExplore: false) let profileViewButtonItem = UIBarButtonItem(image: profileImage, style: .plain, target: self, action: #selector(userDidTapProfile)) + profileViewButtonItem.accessibilityLabel = hasUnreadNotifications ? CommonStrings.profileButtonBadgeTitle : CommonStrings.profileButtonTitle + profileViewButtonItem.accessibilityHint = CommonStrings.profileButtonAccessibilityHint navigationItem.rightBarButtonItems = [AppSearchBarButtonItem.newAppSearchBarButtonItem, profileViewButtonItem] navigationBar.updateNavigationItems() diff --git a/Wikipedia/Code/ExploreViewController.swift b/Wikipedia/Code/ExploreViewController.swift index 7836b9dd63..90bb0dc80d 100644 --- a/Wikipedia/Code/ExploreViewController.swift +++ b/Wikipedia/Code/ExploreViewController.swift @@ -170,6 +170,8 @@ class ExploreViewController: ColumnarCollectionViewController, ExploreCardViewCo let profileImage = BarButtonImageStyle.profileButtonImage(theme: theme, indicated: hasUnreadNotifications) let profileViewButtonItem = UIBarButtonItem(image: profileImage, style: .plain, target: self, action: #selector(userDidTapProfile)) + profileViewButtonItem.accessibilityLabel = hasUnreadNotifications ? CommonStrings.profileButtonBadgeTitle : CommonStrings.profileButtonTitle + profileViewButtonItem.accessibilityHint = CommonStrings.profileButtonAccessibilityHint navigationItem.rightBarButtonItem = profileViewButtonItem navigationBar.updateNavigationItems() } diff --git a/Wikipedia/Code/WMFSettingsViewController.m b/Wikipedia/Code/WMFSettingsViewController.m index dcac9f24ec..3d0a450e35 100644 --- a/Wikipedia/Code/WMFSettingsViewController.m +++ b/Wikipedia/Code/WMFSettingsViewController.m @@ -133,6 +133,8 @@ - (void)updateProfileViewButton { BOOL hasUnreadNotifications = numUnreadNotifications != 0; UIImage *image = [BarButtonImageStyle profileButtonImageForTheme:self.theme indicated:hasUnreadNotifications isExplore:true]; UIBarButtonItem *profileViewButtonItem = [[UIBarButtonItem alloc] initWithImage:image style:UIBarButtonItemStylePlain target:self action:@selector(userDidTapProfile)]; + profileViewButtonItem.accessibilityLabel = hasUnreadNotifications ? WMFCommonStrings.profileButtonBadgeTitle : WMFCommonStrings.profileButtonTitle; + profileViewButtonItem.accessibilityHint = WMFCommonStrings.profileButtonAccessibilityHint; self.navigationItem.leftBarButtonItem = profileViewButtonItem; } diff --git a/Wikipedia/Localizations/en.lproj/Localizable.strings b/Wikipedia/Localizations/en.lproj/Localizable.strings index cfc8b94a31..819722b57b 100644 --- a/Wikipedia/Localizations/en.lproj/Localizable.strings +++ b/Wikipedia/Localizations/en.lproj/Localizable.strings @@ -952,6 +952,9 @@ "preference-summary-eventlogging-opt-in" = "Allow Wikimedia Foundation to collect information about how you use the app to make the app better"; "privacy-policy-title" = "Privacy policy"; "problem-with-feature-title" = "Problem with feature"; +"profile-button-accessibility-hint" = "Navigates to the profile view."; +"profile-button-accessibility-label" = "Profile"; +"profile-button-badge-accessibility-label" = "Profile with unread badge"; "profile-page-donate" = "Donate"; "profile-page-donate-subtext" = "Or support Wikipedia with a donation to keep it free and accessible for everyone around the world."; "profile-page-join-subtext" = "Sign up for a Wikipedia account to track your contributions, save articles offline, and sync across devices."; diff --git a/Wikipedia/Localizations/qqq.lproj/Localizable.strings b/Wikipedia/Localizations/qqq.lproj/Localizable.strings index 9a7e035aaf..b896044e6a 100644 --- a/Wikipedia/Localizations/qqq.lproj/Localizable.strings +++ b/Wikipedia/Localizations/qqq.lproj/Localizable.strings @@ -952,6 +952,9 @@ "preference-summary-eventlogging-opt-in" = "Description of preference that when checked enables data collection of user behavior."; "privacy-policy-title" = "Title for the privacy Policy"; "problem-with-feature-title" = "Button title text that allows user to send feedback to the iOS support email about a particular feature."; +"profile-button-accessibility-hint" = "Accessibility hint for the profile navigation bar button. Explains to the user what will happen upon button tap."; +"profile-button-accessibility-label" = "Accessibility label for the profile navigation bar button. Tapping it navigates to the user profile view."; +"profile-button-badge-accessibility-label" = "Accessibility label for the profile navigation bar badge button. This button has a badge indicating there are unread notifications. Tapping it navigates to the user profile view."; "profile-page-donate" = "Link to donate"; "profile-page-donate-subtext" = "Information about supporting Wikipedia through donations"; "profile-page-join-subtext" = "Information about signing in or up"; diff --git a/Wikipedia/iOS Native Localizations/en.lproj/Localizable.strings b/Wikipedia/iOS Native Localizations/en.lproj/Localizable.strings index 417db02353..3db90eb36f 100644 Binary files a/Wikipedia/iOS Native Localizations/en.lproj/Localizable.strings and b/Wikipedia/iOS Native Localizations/en.lproj/Localizable.strings differ