Skip to content

Commit 5fb2296

Browse files
authored
Fix Reader localization (#23774)
1 parent 00c2b36 commit 5fb2296

File tree

6 files changed

+12
-6
lines changed

6 files changed

+12
-6
lines changed

WordPress/Classes/Utility/SharedStrings.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ enum SharedStrings {
2626
}
2727

2828
enum Reader {
29+
/// - warning: This is the legacy value. It's not compliant with the new format but has the correct translation for different languages.
30+
static let title = NSLocalizedString("Reader", comment: "The accessibility value of the Reader tab.")
2931
static let unfollow = NSLocalizedString("reader.button.unfollow", value: "Unfollow", comment: "Reader sidebar button title")
3032
static let recent = NSLocalizedString("reader.recent.title", value: "Recent", comment: "Used in multiple contexts, usually as a screen title")
3133
static let discover = NSLocalizedString("reader.discover.title", value: "Discover", comment: "Used in multiple contexts, usually as a screen title")

WordPress/Classes/ViewRelated/Reader/Controllers/ReaderStreamViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ import AutomatticTracks
550550
if contentType == .saved {
551551
title = SharedStrings.Reader.saved
552552
} else {
553-
title = NSLocalizedString("Reader", comment: "The default title of the Reader")
553+
title = SharedStrings.Reader.title
554554
}
555555
return
556556
}
@@ -1543,7 +1543,7 @@ extension ReaderStreamViewController: SearchableActivityConvertable {
15431543
}
15441544

15451545
var activityTitle: String {
1546-
return NSLocalizedString("Reader", comment: "Title of the 'Reader' tab - used for spotlight indexing on iOS.")
1546+
return SharedStrings.Reader.title
15471547
}
15481548

15491549
var activityKeywords: Set<String>? {

WordPress/Classes/ViewRelated/Reader/Sidebar/ReaderSidebarViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ private extension View {
205205
}
206206

207207
private struct Strings {
208-
static let reader = NSLocalizedString("reader.sidebar.navigationTitle", value: "Reader", comment: "Reader sidebar title")
208+
static let reader = SharedStrings.Reader.title
209209
static let subscriptions = NSLocalizedString("reader.sidebar.section.subscriptions.title", value: "Subscriptions", comment: "Reader sidebar section title")
210210
static let lists = NSLocalizedString("reader.sidebar.section.lists.title", value: "Lists", comment: "Reader sidebar section title")
211211
static let tags = NSLocalizedString("reader.sidebar.section.tags.title", value: "Tags", comment: "Reader sidebar section title")

WordPress/Classes/ViewRelated/System/Sidebar/SidebarViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ private enum Strings {
257257
static let addSite = NSLocalizedString("sidebar.addSite", value: "Add Site", comment: "Sidebar button title on iPad")
258258
static let createSite = NSLocalizedString("sidebar.createSite", value: "Create Site", comment: "Sidebar button title on iPad")
259259
static let notifications = NSLocalizedString("sidebar.notifications", value: "Notifications", comment: "Sidebar item on iPad")
260-
static let reader = NSLocalizedString("sidebar.reader", value: "Reader", comment: "Sidebar item on iPad")
260+
static let reader = SharedStrings.Reader.title
261261
static let domains = NSLocalizedString("sidebar.domains", value: "Domains", comment: "Sidebar item on iPad")
262262
static let help = NSLocalizedString("sidebar.help", value: "Help & Support", comment: "Sidebar item on iPad")
263263
static let me = NSLocalizedString("sidebar.me", value: "Me", comment: "Sidebar item on iPad")

WordPress/Classes/ViewRelated/System/WPTabBarController+Swift.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ fileprivate extension WPTab {
1818
}
1919

2020
extension WPTabBarController {
21+
@objc class func readerLocalizedTitle() -> String {
22+
SharedStrings.Reader.title
23+
}
24+
2125
func showReader(path: ReaderNavigationPath?) {
2226
showReaderTab()
2327
if let path {

WordPress/Classes/ViewRelated/System/WPTabBarController.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ - (UINavigationController *)readerNavigationController
135135

136136
_readerNavigationController.tabBarItem.image = [UIImage imageNamed:@"tab-bar-reader"];
137137
_readerNavigationController.tabBarItem.accessibilityIdentifier = @"tabbar_reader";
138-
_readerNavigationController.tabBarItem.title = NSLocalizedString(@"Reader", @"The accessibility value of the Reader tab.");
138+
_readerNavigationController.tabBarItem.title = [WPTabBarController readerLocalizedTitle];
139139

140140
UITabBarAppearance *scrollEdgeAppearance = [UITabBarAppearance new];
141141
[scrollEdgeAppearance configureWithOpaqueBackground];
@@ -424,7 +424,7 @@ - (BOOL)canBecomeFirstResponder
424424
showMySitesTabCommand.discoverabilityTitle = NSLocalizedString(@"My Site", @"The accessibility value of the my site tab.");
425425

426426
UIKeyCommand *showReaderTabCommand = [UIKeyCommand keyCommandWithInput:@"2" modifierFlags:UIKeyModifierCommand action:@selector(showReaderTab)];
427-
showMySitesTabCommand.discoverabilityTitle = NSLocalizedString(@"Reader", @"The accessibility value of the reader tab.");
427+
showMySitesTabCommand.discoverabilityTitle = [WPTabBarController readerLocalizedTitle];
428428

429429
UIKeyCommand *showNotificationsTabCommand = [UIKeyCommand keyCommandWithInput:@"4" modifierFlags:UIKeyModifierCommand action:@selector(showNotificationsTab)];
430430
showMySitesTabCommand.discoverabilityTitle = NSLocalizedString(@"Notifications", @"Notifications tab bar item accessibility label");

0 commit comments

Comments
 (0)