diff --git a/WordPress/Classes/Utility/AppLocalizedString.swift b/WordPress/Classes/Utility/AppLocalizedString.swift new file mode 100644 index 000000000000..07552675634b --- /dev/null +++ b/WordPress/Classes/Utility/AppLocalizedString.swift @@ -0,0 +1,69 @@ +import SwiftUI + + +extension Bundle { + /// Returns the `Bundle` for the host `.app`. + /// + /// - If this is called from code already located in the main app's bundle or from a Pod/Framework, + /// this will return the same as `Bundle.main`, aka the bundle of the app itself. + /// - If this is called from an App Extension (Widget, ShareExtension, etc), this will return the bundle of the + /// main app hosting said App Extension (while `Bundle.main` would return the App Extension itself) + /// + /// This is particularly useful to reference a resource or string bundled inside the app from an App Extension / Widget. + /// + /// - Note: + /// In the context of Unit Tests this will return the Test Harness (aka Test Host) app, since that is the app running said tests. + /// + static let app: Bundle = { + var url = Bundle.main.bundleURL + while url.pathExtension != "app" && url.lastPathComponent != "/" { + url.deleteLastPathComponent() + } + guard let appBundle = Bundle(url: url) else { fatalError("Unable to find the parent app bundle") } + return appBundle + }() +} + +/// Use this to express *intent* on your API that the string you are manipulating / returning is intended to already be localized +/// and its value to have been provided via a call to `NSLocalizedString` or `AppLocalizedString`. +/// +/// Semantically speaking, a method taking or returning a `LocalizedString` is signaling that you can display said UI string +/// to the end user, without the need to be treated as a key to be localized. The string is expected to already have been localized +/// at that point of the code, via a call to `NSLocalizedString`, `AppLocalizedString` or similar upstream in the code. +/// +/// - Note: Remember though that, as a `typealias`, this won't provide any compile-time guarantee. +typealias LocalizedString = String + +/// Use this function instead of `NSLocalizedString` to reference localized strings **from the app bundle** – especially +/// when using localized strings from the code of an app extension. +/// +/// You should use this `AppLocalizedString` method in place of `NSLocalizedString` especially when calling it +/// from App Extensions and Widgets, in order to reference strings whose localization live in the app bundle's `.strings` file +/// (rather than the AppExtension's own bundle). +/// +/// In order to avoid duplicating our strings accross targets, and make our localization process & tooling easier, we keep all +/// localized `.strings` in the app's bundle (and don't have a `.strings` file in the App Extension targets themselves); +/// then we make those App Extensions & Widgets reference the strings from the `Localizable.strings` files +/// hosted in the app bundle itself – which is when this helper method is helpful. +/// +/// - Note: +/// Tooling: Be sure to pass this function's name as a custom routine when parsing the code to generate the main `.strings` file, +/// using `genstrings -s AppLocalizedString`, so that this helper method is recognized. You will also have to +/// exclude this very file from being parsed by `genstrings`, so that it won't accidentally misinterpret that routine/function definition +/// below as a call site and generate an error because of it. +/// +/// - Parameters: +/// - key: An identifying value used to reference a localized string. +/// - tableName: The basename of the `.strings` file **in the app bundle** containing +/// the localized values. If `tableName` is `nil`, the `Localizable` table is used. +/// - value: The English/default copy for the string. This is the user-visible string that the +/// translators will use as original to translate, and also the string returned when the localized string for +/// `key` cannot be found in the table. If `value` is `nil` or empty, `key` would be returned instead. +/// - comment: A note to the translator describing the context where the localized string is presented to the user. +/// +/// - Returns: A localized version of the string designated by `key` in the table identified by `tableName`. +/// If the localized string for `key` cannot be found within the table, `value` is returned. +/// (However, `key` is returned instead when `value` is `nil` or the empty string). +func AppLocalizedString(_ key: String, tableName: String? = nil, value: String? = nil, comment: String) -> LocalizedString { + Bundle.app.localizedString(forKey: key, value: value, table: nil) +} diff --git a/WordPress/Classes/ViewRelated/Stats/Extensions/Double+Stats.swift b/WordPress/Classes/ViewRelated/Stats/Extensions/Double+Stats.swift index 0a2757c5aaca..5b1ea82ed58e 100644 --- a/WordPress/Classes/ViewRelated/Stats/Extensions/Double+Stats.swift +++ b/WordPress/Classes/ViewRelated/Stats/Extensions/Double+Stats.swift @@ -42,18 +42,39 @@ extension Double { struct Cache { static let units: [Unit] = { var units: [Unit] = [] - - units.append(Unit(abbreviationFormat: NSLocalizedString("%@K", comment: "Label displaying value in thousands. Ex: 66.6K."), accessibilityLabelFormat: NSLocalizedString("%@ thousand", comment: "Accessibility label for value in thousands. Ex: 66.6 thousand."))) - - units.append(Unit(abbreviationFormat: NSLocalizedString("%@M", comment: "Label displaying value in millions. Ex: 66.6M."), accessibilityLabelFormat: NSLocalizedString("%@ million", comment: "Accessibility label for value in millions. Ex: 66.6 million."))) - - units.append(Unit(abbreviationFormat: NSLocalizedString("%@B", comment: "Label displaying value in billions. Ex: 66.6B."), accessibilityLabelFormat: NSLocalizedString("%@ billion", comment: "Accessibility label for value in billions. Ex: 66.6 billion."))) - - units.append(Unit(abbreviationFormat: NSLocalizedString("%@T", comment: "Label displaying value in trillions. Ex: 66.6T."), accessibilityLabelFormat: NSLocalizedString("%@ trillion", comment: "Accessibility label for value in trillions. Ex: 66.6 trillion."))) - - units.append(Unit(abbreviationFormat: NSLocalizedString("%@P", comment: "Label displaying value in quadrillions. Ex: 66.6P."), accessibilityLabelFormat: NSLocalizedString("%@ quadrillion", comment: "Accessibility label for value in quadrillion. Ex: 66.6 quadrillion."))) - - units.append(Unit(abbreviationFormat: NSLocalizedString("%@E", comment: "Label displaying value in quintillions. Ex: 66.6E."), accessibilityLabelFormat: NSLocalizedString("%@ quintillion", comment: "Accessibility label for value in quintillions. Ex: 66.6 quintillion."))) + // Note: using `AppLocalizedString` here (instead of `NSLocalizedString`) to ensure that strings + // will be looked up from the app's _own_ `Localizable.strings` file, even when this file is used + // as part of an _App Extension_ (especially our various stats Widgets which also use this file) + + units.append(Unit( + abbreviationFormat: AppLocalizedString("%@K", comment: "Label displaying value in thousands. Ex: 66.6K."), + accessibilityLabelFormat: AppLocalizedString("%@ thousand", comment: "Accessibility label for value in thousands. Ex: 66.6 thousand.") + )) + + units.append(Unit( + abbreviationFormat: AppLocalizedString("%@M", comment: "Label displaying value in millions. Ex: 66.6M."), + accessibilityLabelFormat: AppLocalizedString("%@ million", comment: "Accessibility label for value in millions. Ex: 66.6 million.") + )) + + units.append(Unit( + abbreviationFormat: AppLocalizedString("%@B", comment: "Label displaying value in billions. Ex: 66.6B."), + accessibilityLabelFormat: AppLocalizedString("%@ billion", comment: "Accessibility label for value in billions. Ex: 66.6 billion.") + )) + + units.append(Unit( + abbreviationFormat: AppLocalizedString("%@T", comment: "Label displaying value in trillions. Ex: 66.6T."), + accessibilityLabelFormat: AppLocalizedString("%@ trillion", comment: "Accessibility label for value in trillions. Ex: 66.6 trillion.") + )) + + units.append(Unit( + abbreviationFormat: AppLocalizedString("%@P", comment: "Label displaying value in quadrillions. Ex: 66.6P."), + accessibilityLabelFormat: AppLocalizedString("%@ quadrillion", comment: "Accessibility label for value in quadrillion. Ex: 66.6 quadrillion.") + )) + + units.append(Unit( + abbreviationFormat: AppLocalizedString("%@E", comment: "Label displaying value in quintillions. Ex: 66.6E."), + accessibilityLabelFormat: AppLocalizedString("%@ quintillion", comment: "Accessibility label for value in quintillions. Ex: 66.6 quintillion.") + )) return units }() diff --git a/WordPress/Classes/ViewRelated/Stats/Today Widgets/Shared Views/WidgetDifferenceCell.swift b/WordPress/Classes/ViewRelated/Stats/Today Widgets/Shared Views/WidgetDifferenceCell.swift index b843c9a55749..5135866a1c80 100644 --- a/WordPress/Classes/ViewRelated/Stats/Today Widgets/Shared Views/WidgetDifferenceCell.swift +++ b/WordPress/Classes/ViewRelated/Stats/Today Widgets/Shared Views/WidgetDifferenceCell.swift @@ -77,7 +77,7 @@ private extension WidgetDifferenceCell { enum Constants { static let noDataLabel = "-" static let cornerRadius: CGFloat = 4.0 - static let today = NSLocalizedString("Today", comment: "Label for most recent stat row.") + static let today = AppLocalizedString("Today", comment: "Label for most recent stat row.") static let positiveColor: UIColor = .success static let negativeColor: UIColor = .error static let neutralColor: UIColor = .neutral(.shade40) diff --git a/WordPress/Classes/ViewRelated/Stats/Today Widgets/Shared Views/WidgetNoConnectionCell.swift b/WordPress/Classes/ViewRelated/Stats/Today Widgets/Shared Views/WidgetNoConnectionCell.swift index 57fc1d27e334..5028a197381e 100644 --- a/WordPress/Classes/ViewRelated/Stats/Today Widgets/Shared Views/WidgetNoConnectionCell.swift +++ b/WordPress/Classes/ViewRelated/Stats/Today Widgets/Shared Views/WidgetNoConnectionCell.swift @@ -28,8 +28,8 @@ private extension WidgetNoConnectionCell { } enum LocalizedText { - static let title = NSLocalizedString("No network available", comment: "Displayed in the Stats widgets when there is no network") - static let message = NSLocalizedString("Stats will be updated next time you're online", comment: "Displayed in the Stats widgets when there is no network") + static let title = AppLocalizedString("No network available", comment: "Displayed in the Stats widgets when there is no network") + static let message = AppLocalizedString("Stats will be updated next time you're online", comment: "Displayed in the Stats widgets when there is no network") } } diff --git a/WordPress/Classes/ViewRelated/Stats/Today Widgets/Shared Views/WidgetUnconfiguredCell.swift b/WordPress/Classes/ViewRelated/Stats/Today Widgets/Shared Views/WidgetUnconfiguredCell.swift index 6096fec24162..00c849d2f484 100644 --- a/WordPress/Classes/ViewRelated/Stats/Today Widgets/Shared Views/WidgetUnconfiguredCell.swift +++ b/WordPress/Classes/ViewRelated/Stats/Today Widgets/Shared Views/WidgetUnconfiguredCell.swift @@ -69,12 +69,12 @@ private extension WidgetUnconfiguredCell { } enum LocalizedText { - static let configureToday = NSLocalizedString("Display your site stats for today here. Configure in the WordPress app in your site stats.", comment: "Unconfigured stats today widget helper text") - static let configureAllTime = NSLocalizedString("Display your all-time site stats here. Configure in the WordPress app in your site stats.", comment: "Unconfigured stats all-time widget helper text") - static let configureThisWeek = NSLocalizedString("Display your site stats for this week here. Configure in the WordPress app in your site stats.", comment: "Unconfigured stats this week widget helper text") - static let openWordPress = NSLocalizedString("Open WordPress", comment: "Today widget label to launch WP app") - static let loadingFailed = NSLocalizedString("Couldn't load data", comment: "Message displayed when a Stats widget failed to load data.") - static let retry = NSLocalizedString("Retry", comment: "Stats widgets label to reload the widget.") + static let configureToday = AppLocalizedString("Display your site stats for today here. Configure in the WordPress app in your site stats.", comment: "Unconfigured stats today widget helper text") + static let configureAllTime = AppLocalizedString("Display your all-time site stats here. Configure in the WordPress app in your site stats.", comment: "Unconfigured stats all-time widget helper text") + static let configureThisWeek = AppLocalizedString("Display your site stats for this week here. Configure in the WordPress app in your site stats.", comment: "Unconfigured stats this week widget helper text") + static let openWordPress = AppLocalizedString("Open WordPress", comment: "Today widget label to launch WP app") + static let loadingFailed = AppLocalizedString("Couldn't load data", comment: "Message displayed when a Stats widget failed to load data.") + static let retry = AppLocalizedString("Retry", comment: "Stats widgets label to reload the widget.") } } diff --git a/WordPress/WordPress.xcodeproj/project.pbxproj b/WordPress/WordPress.xcodeproj/project.pbxproj index bf3ee407b1be..5bd6afc81911 100644 --- a/WordPress/WordPress.xcodeproj/project.pbxproj +++ b/WordPress/WordPress.xcodeproj/project.pbxproj @@ -138,6 +138,11 @@ 08F8CD371EBD2AA80049D0C0 /* test-image-device-photo-gps.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 08F8CD341EBD2AA80049D0C0 /* test-image-device-photo-gps.jpg */; }; 08F8CD391EBD2C970049D0C0 /* MediaURLExporter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08F8CD381EBD2C970049D0C0 /* MediaURLExporter.swift */; }; 08F8CD3B1EBD2D020049D0C0 /* MediaURLExporterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08F8CD3A1EBD2D020049D0C0 /* MediaURLExporterTests.swift */; }; + 092C3800275E718000BBBDD9 /* AppLocalizedString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F2656A025AF4DFA0073A832 /* AppLocalizedString.swift */; }; + 092C3801275E718100BBBDD9 /* AppLocalizedString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F2656A025AF4DFA0073A832 /* AppLocalizedString.swift */; }; + 092C3802275E718100BBBDD9 /* AppLocalizedString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F2656A025AF4DFA0073A832 /* AppLocalizedString.swift */; }; + 098B8576275E76FE004D299F /* AppLocalizedString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F2656A025AF4DFA0073A832 /* AppLocalizedString.swift */; }; + 098B8577275E9765004D299F /* AppLocalizedString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F2656A025AF4DFA0073A832 /* AppLocalizedString.swift */; }; 1702BBDC1CEDEA6B00766A33 /* BadgeLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1702BBDB1CEDEA6B00766A33 /* BadgeLabel.swift */; }; 1702BBE01CF3034E00766A33 /* DomainsService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1702BBDF1CF3034E00766A33 /* DomainsService.swift */; }; 1703D04C20ECD93800D292E9 /* Routes+Post.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1703D04B20ECD93800D292E9 /* Routes+Post.swift */; }; @@ -1601,7 +1606,6 @@ 9839CEBC26FAA0530097406E /* CommentModerationBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9839CEB926FAA0510097406E /* CommentModerationBar.swift */; }; 983AE84C2399AC5B00E5B7F6 /* SFHFKeychainUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 292CECFF1027259000BD407D /* SFHFKeychainUtils.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; 983AE84D2399AC6B00E5B7F6 /* Constants.m in Sources */ = {isa = PBXBuildFile; fileRef = B5CC05F51962150600975CAC /* Constants.m */; }; - 983AE8512399B19200E5B7F6 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 983AE84F2399B19200E5B7F6 /* Localizable.strings */; }; 983DBBAA22125DD500753988 /* StatsTableFooter.xib in Resources */ = {isa = PBXBuildFile; fileRef = 983DBBA822125DD300753988 /* StatsTableFooter.xib */; }; 983DBBAB22125DD500753988 /* StatsTableFooter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 983DBBA922125DD300753988 /* StatsTableFooter.swift */; }; 98458CB821A39D350025D232 /* StatsNoDataRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98458CB721A39D350025D232 /* StatsNoDataRow.swift */; }; @@ -1748,7 +1752,6 @@ 98D31BAC23970078009CFF43 /* Tracks+AllTimeWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98D31BAB23970078009CFF43 /* Tracks+AllTimeWidget.swift */; }; 98D31BAD2397015C009CFF43 /* Tracks.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5FA22821C99F6180016CA7C /* Tracks.swift */; }; 98D31BAE239708FB009CFF43 /* Constants.m in Sources */ = {isa = PBXBuildFile; fileRef = B5CC05F51962150600975CAC /* Constants.m */; }; - 98D31BBD23971F4B009CFF43 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 98D31BBB23971F4B009CFF43 /* Localizable.strings */; }; 98D31BC223972A79009CFF43 /* SFHFKeychainUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 292CECFF1027259000BD407D /* SFHFKeychainUtils.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; 98D52C3222B1CFEC00831529 /* StatsTwoColumnRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98D52C3022B1CFEB00831529 /* StatsTwoColumnRow.swift */; }; 98D52C3322B1CFEC00831529 /* StatsTwoColumnRow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 98D52C3122B1CFEC00831529 /* StatsTwoColumnRow.xib */; }; @@ -2357,7 +2360,6 @@ E1B23B081BFB3B370006559B /* MyProfileViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1B23B071BFB3B370006559B /* MyProfileViewController.swift */; }; E1B62A7B13AA61A100A6FCA4 /* WPWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E1B62A7A13AA61A100A6FCA4 /* WPWebViewController.m */; }; E1B642131EFA5113001DC6D7 /* ModelTestHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1B642121EFA5113001DC6D7 /* ModelTestHelper.swift */; }; - E1B6A9CC1E54B6B2008FD47E /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = E1B6A9CE1E54B6B2008FD47E /* Localizable.strings */; }; E1B84F001E02E94D00BF6434 /* PingHubManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1B84EFF1E02E94D00BF6434 /* PingHubManager.swift */; }; E1B912811BB00EFD003C25B9 /* People.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E1B912801BB00EFD003C25B9 /* People.storyboard */; }; E1B912831BB01047003C25B9 /* PeopleRoleBadgeLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1B912821BB01047003C25B9 /* PeopleRoleBadgeLabel.swift */; }; @@ -6231,7 +6233,6 @@ 9835F16D25E492EE002EFF23 /* CommentsList.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = CommentsList.storyboard; sourceTree = ""; }; 98390AC2254C984700868F0A /* Tracks+StatsWidgets.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Tracks+StatsWidgets.swift"; sourceTree = ""; }; 9839CEB926FAA0510097406E /* CommentModerationBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CommentModerationBar.swift; sourceTree = ""; }; - 983AE8502399B19200E5B7F6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Localizable.strings; sourceTree = ""; }; 983DBBA822125DD300753988 /* StatsTableFooter.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = StatsTableFooter.xib; sourceTree = ""; }; 983DBBA922125DD300753988 /* StatsTableFooter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StatsTableFooter.swift; sourceTree = ""; }; 98458CB721A39D350025D232 /* StatsNoDataRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatsNoDataRow.swift; sourceTree = ""; }; @@ -6347,7 +6348,6 @@ 98D31BA82396FAD2009CFF43 /* WordPressAllTimeWidget-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "WordPressAllTimeWidget-Bridging-Header.h"; sourceTree = ""; }; 98D31BA92396FBDC009CFF43 /* AllTimeWidgetPrefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AllTimeWidgetPrefix.pch; sourceTree = ""; }; 98D31BAB23970078009CFF43 /* Tracks+AllTimeWidget.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Tracks+AllTimeWidget.swift"; sourceTree = ""; }; - 98D31BBC23971F4B009CFF43 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Localizable.strings; sourceTree = ""; }; 98D52C3022B1CFEB00831529 /* StatsTwoColumnRow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StatsTwoColumnRow.swift; sourceTree = ""; }; 98D52C3122B1CFEC00831529 /* StatsTwoColumnRow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = StatsTwoColumnRow.xib; sourceTree = ""; }; 98DCF4A3275945DF0008630F /* ReaderDetailNoCommentCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReaderDetailNoCommentCell.swift; sourceTree = ""; }; @@ -6970,35 +6970,6 @@ E131CB5716CACFB4004B0314 /* get-user-blogs_doesnt-have-blog.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "get-user-blogs_doesnt-have-blog.json"; sourceTree = ""; }; E133DB40137AE180003C0AF9 /* he */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = he; path = he.lproj/Localizable.strings; sourceTree = ""; }; E135965C1E7152D1006C6606 /* RecentSitesServiceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RecentSitesServiceTests.swift; sourceTree = ""; }; - E135CD6E1E54BC0A0021E79F /* fr */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = fr; path = fr.lproj/Localizable.strings; sourceTree = ""; }; - E135CD6F1E54BC0C0021E79F /* de */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = de; path = de.lproj/Localizable.strings; sourceTree = ""; }; - E135CD711E54BCA70021E79F /* bg */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = bg; path = bg.lproj/Localizable.strings; sourceTree = ""; }; - E135CD721E54BD300021E79F /* cs */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = cs; path = cs.lproj/Localizable.strings; sourceTree = ""; }; - E135CD731E54BD350021E79F /* cy */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = cy; path = cy.lproj/Localizable.strings; sourceTree = ""; }; - E135CD741E54BD410021E79F /* da */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = da; path = da.lproj/Localizable.strings; sourceTree = ""; }; - E135CD751E54BD4C0021E79F /* en-AU */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = "en-AU"; path = "en-AU.lproj/Localizable.strings"; sourceTree = ""; }; - E135CD761E54BD4F0021E79F /* en-CA */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = "en-CA"; path = "en-CA.lproj/Localizable.strings"; sourceTree = ""; }; - E135CD771E54BD510021E79F /* en-GB */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = "en-GB"; path = "en-GB.lproj/Localizable.strings"; sourceTree = ""; }; - E135CD781E54BD530021E79F /* pt-BR */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = "pt-BR"; path = "pt-BR.lproj/Localizable.strings"; sourceTree = ""; }; - E135CD791E54BD590021E79F /* zh-Hans */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = ""; }; - E135CD7A1E54BD5B0021E79F /* zh-Hant */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.strings"; sourceTree = ""; }; - E135CD7B1E54BD620021E79F /* it */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = it; path = it.lproj/Localizable.strings; sourceTree = ""; }; - E135CD7C1E54BD6D0021E79F /* ko */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = ko; path = ko.lproj/Localizable.strings; sourceTree = ""; }; - E135CD7D1E54BD730021E79F /* nb */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = nb; path = nb.lproj/Localizable.strings; sourceTree = ""; }; - E135CD7E1E54BD7B0021E79F /* nl */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = nl; path = nl.lproj/Localizable.strings; sourceTree = ""; }; - E135CD7F1E54BD810021E79F /* pl */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = pl; path = pl.lproj/Localizable.strings; sourceTree = ""; }; - E135CD801E54BD860021E79F /* pt */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = pt; path = pt.lproj/Localizable.strings; sourceTree = ""; }; - E135CD811E54BD8A0021E79F /* sv */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = sv; path = sv.lproj/Localizable.strings; sourceTree = ""; }; - E135CD821E54BD910021E79F /* ro */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = ro; path = ro.lproj/Localizable.strings; sourceTree = ""; }; - E135CD831E54BD980021E79F /* ru */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = ru; path = ru.lproj/Localizable.strings; sourceTree = ""; }; - E135CD841E54BD9D0021E79F /* sq */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = sq; path = sq.lproj/Localizable.strings; sourceTree = ""; }; - E135CD851E54BDA30021E79F /* th */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = th; path = th.lproj/Localizable.strings; sourceTree = ""; }; - E135CD861E54BDAC0021E79F /* tr */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = tr; path = tr.lproj/Localizable.strings; sourceTree = ""; }; - E135CD871E54BDE40021E79F /* he */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = he; path = he.lproj/Localizable.strings; sourceTree = ""; }; - E135CD881E54BDE60021E79F /* hr */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = hr; path = hr.lproj/Localizable.strings; sourceTree = ""; }; - E135CD891E54BDEB0021E79F /* hu */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = hu; path = hu.lproj/Localizable.strings; sourceTree = ""; }; - E135CD8A1E54BDED0021E79F /* id */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = id; path = id.lproj/Localizable.strings; sourceTree = ""; }; - E135CD8B1E54BDEF0021E79F /* is */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = is; path = is.lproj/Localizable.strings; sourceTree = ""; }; E136F3981F1F6FF800AD2DD3 /* WordPress 62.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "WordPress 62.xcdatamodel"; sourceTree = ""; }; E137B1651F8B77D4006AC7FC /* WebNavigationDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebNavigationDelegate.swift; sourceTree = ""; }; E1389ADA1C59F7C200FB2466 /* PlanListViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlanListViewController.swift; sourceTree = ""; }; @@ -7045,7 +7016,6 @@ E16273E21B2AD89A00088AF7 /* MIGRATIONS.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; name = MIGRATIONS.md; path = ../MIGRATIONS.md; sourceTree = ""; }; E163AF9E1ED45B100035317E /* sk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sk; path = sk.lproj/Localizable.strings; sourceTree = ""; }; E163AF9F1ED45B110035317E /* sk */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = sk; path = sk.lproj/Localizable.strings; sourceTree = ""; }; - E163AFA01ED45B110035317E /* sk */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = sk; path = sk.lproj/Localizable.strings; sourceTree = ""; }; E166FA1A1BB0656B00374B5B /* PeopleCellViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PeopleCellViewModel.swift; sourceTree = ""; }; E167745A1377F24300EE44DD /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Localizable.strings; sourceTree = ""; }; E167745B1377F25500EE44DD /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Localizable.strings; sourceTree = ""; }; @@ -7097,16 +7067,12 @@ E1AB5A061E0BF17500574B4E /* Array.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Array.swift; sourceTree = ""; }; E1AB5A081E0BF31E00574B4E /* ArrayTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ArrayTests.swift; sourceTree = ""; }; E1AB5A391E0C464700574B4E /* DelayTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DelayTests.swift; sourceTree = ""; }; - E1AC8CB91E54B891006FD056 /* ar */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = ar; path = ar.lproj/Localizable.strings; sourceTree = ""; }; E1ADE0EA20A9EF6200D6AADC /* PrivacySettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrivacySettingsViewController.swift; sourceTree = ""; }; E1AFA8C21E8E34230004A323 /* WordPressShare.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = WordPressShare.js; path = WordPressShareExtension/WordPressShare.js; sourceTree = SOURCE_ROOT; }; E1B23B071BFB3B370006559B /* MyProfileViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MyProfileViewController.swift; sourceTree = ""; }; E1B62A7913AA61A100A6FCA4 /* WPWebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WPWebViewController.h; sourceTree = ""; }; E1B62A7A13AA61A100A6FCA4 /* WPWebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WPWebViewController.m; sourceTree = ""; }; E1B642121EFA5113001DC6D7 /* ModelTestHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelTestHelper.swift; sourceTree = ""; }; - E1B6A9CD1E54B6B2008FD47E /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Localizable.strings; sourceTree = ""; }; - E1B6AA571E54B83D008FD47E /* ja */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = ja; path = ja.lproj/Localizable.strings; sourceTree = ""; }; - E1B6AA581E54B840008FD47E /* es */ = {isa = PBXFileReference; explicitFileType = file.bplist; name = es; path = es.lproj/Localizable.strings; sourceTree = ""; }; E1B84EFF1E02E94D00BF6434 /* PingHubManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PingHubManager.swift; sourceTree = ""; }; E1B912801BB00EFD003C25B9 /* People.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = People.storyboard; sourceTree = ""; }; E1B912821BB01047003C25B9 /* PeopleRoleBadgeLabel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PeopleRoleBadgeLabel.swift; sourceTree = ""; }; @@ -8994,7 +8960,6 @@ isa = PBXGroup; children = ( 3FE77C8225B0CA89007DE9E5 /* LocalizableStrings.swift */, - 3F2656A025AF4DFA0073A832 /* AppLocalizedString.swift */, ); path = Localization; sourceTree = ""; @@ -11184,6 +11149,7 @@ E1F5A1BB1771C90A00E0495F /* WPTableImageSource.m */, 594DB2931AB891A200E2E456 /* WPUserAgent.h */, 594DB2941AB891A200E2E456 /* WPUserAgent.m */, + 3F2656A025AF4DFA0073A832 /* AppLocalizedString.swift */, FF28B3EF1AEB251200E11AAE /* InfoPListTranslator.h */, FF28B3F01AEB251200E11AAE /* InfoPListTranslator.m */, 85B125431B02937E008A3D95 /* UIAlertControllerProxy.h */, @@ -11497,7 +11463,6 @@ 8546B44A1BEAD3B300193C07 /* Info-Alpha.plist */, 93267A6019B896CD00997EB8 /* Info-Internal.plist */, 93E5283F19A7741A003A1A9C /* Info.plist */, - E1B6A9CE1E54B6B2008FD47E /* Localizable.strings */, 591252291A38AE9C00468279 /* TodayWidgetPrefix.pch */, 8546B4501BEAD4D100193C07 /* WordPressTodayWidget-Alpha.entitlements */, 934884AC19B78723004028D8 /* WordPressTodayWidget-Internal.entitlements */, @@ -11865,7 +11830,6 @@ 98A3C3072399A57D0048D38D /* Info-Alpha.plist */, 98A3C3082399A57D0048D38D /* Info-Internal.plist */, 98A3C2F7239997DA0048D38D /* Info.plist */, - 983AE84F2399B19200E5B7F6 /* Localizable.strings */, 98E419E02399B6C300D8C822 /* ThisWeekWidgetPrefix.pch */, 98A3C30C2399A6570048D38D /* WordPressThisWeekWidget-Alpha.entitlements */, 98A3C30D2399A6580048D38D /* WordPressThisWeekWidget-Internal.entitlements */, @@ -11914,7 +11878,6 @@ 98D31BA02396F417009CFF43 /* Info-Alpha.plist */, 98D31BA12396F417009CFF43 /* Info-Internal.plist */, 98D31B962396ED7F009CFF43 /* Info.plist */, - 98D31BBB23971F4B009CFF43 /* Localizable.strings */, 98D31BA32396F5C1009CFF43 /* WordPressAllTimeWidget-Alpha.entitlements */, 98D31BA42396F5C2009CFF43 /* WordPressAllTimeWidget-Internal.entitlements */, 98D31BA22396F5C1009CFF43 /* WordPressAllTimeWidget.entitlements */, @@ -15655,7 +15618,6 @@ 9A144AC822FD6A650069DD71 /* ColorPalette.xcassets in Resources */, 98712D2023DA1D1000555316 /* WidgetNoConnectionCell.xib in Resources */, 98906505237CC1DF00218CD2 /* WidgetUnconfiguredCell.xib in Resources */, - E1B6A9CC1E54B6B2008FD47E /* Localizable.strings in Resources */, 988F073723D0D15D00AC67A6 /* WidgetUrlCell.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -15669,7 +15631,6 @@ 98A3C3022399A19F0048D38D /* MainInterface.storyboard in Resources */, 98712D2223DA1D1200555316 /* WidgetNoConnectionCell.xib in Resources */, 989643E823A031CD0070720A /* WidgetUnconfiguredCell.xib in Resources */, - 983AE8512399B19200E5B7F6 /* Localizable.strings in Resources */, 988F073923D0D15E00AC67A6 /* WidgetUrlCell.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -15680,7 +15641,6 @@ files = ( 98A6B9942398821B0031AEBD /* WidgetTwoColumnCell.xib in Resources */, 985ED0E223C686CA00B8D06A /* ColorPalette.xcassets in Resources */, - 98D31BBD23971F4B009CFF43 /* Localizable.strings in Resources */, 98712D2123DA1D1100555316 /* WidgetNoConnectionCell.xib in Resources */, 98A6B996239882350031AEBD /* WidgetUnconfiguredCell.xib in Resources */, 98D7ECCE23983D0800B87710 /* MainInterface.storyboard in Resources */, @@ -17604,6 +17564,7 @@ E6F2788121BC1A4A008B4DB5 /* PlanGroup.swift in Sources */, 08216FCE1CDBF96000304BA7 /* MenuItemPostsViewController.m in Sources */, 4322A20D203E1885004EA740 /* SignupUsernameTableViewController.swift in Sources */, + 098B8576275E76FE004D299F /* AppLocalizedString.swift in Sources */, 7E7BEF7022E1AED8009A880D /* Blog+Editor.swift in Sources */, 8BB185C624B5FB8500A4CCE8 /* ReaderCardService.swift in Sources */, 98487E3A21EE8FB500352B4E /* UITableViewCell+Stats.swift in Sources */, @@ -18801,6 +18762,7 @@ 4326191722FCB9F9003C7642 /* MurielColor.swift in Sources */, 436110D922C3ED18000773AD /* UIColor+MurielColors.swift in Sources */, FAD256CA2611B01C00EDAF88 /* UIColor+WordPressColors.swift in Sources */, + 092C3800275E718000BBBDD9 /* AppLocalizedString.swift in Sources */, 988F073A23D0D16700AC67A6 /* WidgetUrlCell.swift in Sources */, 1752D4FB238D702F002B79E7 /* KeyValueDatabase.swift in Sources */, 170BEC89239153120017AEC1 /* FeatureFlagOverrideStore.swift in Sources */, @@ -18828,6 +18790,7 @@ 98E419DE2399B5A700D8C822 /* Tracks+ThisWeekWidget.swift in Sources */, 98712D1F23DA1D0A00555316 /* WidgetNoConnectionCell.swift in Sources */, FAD257F42611B54100EDAF88 /* UIColor+WordPressColors.swift in Sources */, + 092C3802275E718100BBBDD9 /* AppLocalizedString.swift in Sources */, 98A3C3052399A2370048D38D /* ThisWeekViewController.swift in Sources */, 17A4B6A324F911D5002DFB8E /* KeyValueDatabase.swift in Sources */, 989643E523A02F640070720A /* MurielColor.swift in Sources */, @@ -18856,6 +18819,7 @@ 98D31BA72396F7E2009CFF43 /* AllTimeViewController.swift in Sources */, 98712D1E23DA1D0900555316 /* WidgetNoConnectionCell.swift in Sources */, 98A6B993239881860031AEBD /* MurielColor.swift in Sources */, + 092C3801275E718100BBBDD9 /* AppLocalizedString.swift in Sources */, FAD256EE2611B01F00EDAF88 /* UIColor+WordPressColors.swift in Sources */, 17A4B6A224F911D4002DFB8E /* KeyValueDatabase.swift in Sources */, 98D31BC223972A79009CFF43 /* SFHFKeychainUtils.m in Sources */, @@ -20436,6 +20400,7 @@ FABB25382602FC2C00C8785C /* TenorDataLoader.swift in Sources */, FABB25392602FC2C00C8785C /* OverviewCell.swift in Sources */, FABB253A2602FC2C00C8785C /* WordPressAppDelegate.swift in Sources */, + 098B8577275E9765004D299F /* AppLocalizedString.swift in Sources */, FABB253B2602FC2C00C8785C /* MediaService.m in Sources */, FABB253C2602FC2C00C8785C /* FormattableContentAction.swift in Sources */, 3F3DD0B326FD176800F5F121 /* PresentationCard.swift in Sources */, @@ -20958,63 +20923,6 @@ path = Resources; sourceTree = ""; }; - 983AE84F2399B19200E5B7F6 /* Localizable.strings */ = { - isa = PBXVariantGroup; - children = ( - 983AE8502399B19200E5B7F6 /* Base */, - ); - name = Localizable.strings; - sourceTree = ""; - }; - 98D31BBB23971F4B009CFF43 /* Localizable.strings */ = { - isa = PBXVariantGroup; - children = ( - 98D31BBC23971F4B009CFF43 /* Base */, - ); - name = Localizable.strings; - sourceTree = ""; - }; - E1B6A9CE1E54B6B2008FD47E /* Localizable.strings */ = { - isa = PBXVariantGroup; - children = ( - E1B6A9CD1E54B6B2008FD47E /* Base */, - E1B6AA571E54B83D008FD47E /* ja */, - E1B6AA581E54B840008FD47E /* es */, - E1AC8CB91E54B891006FD056 /* ar */, - E135CD6E1E54BC0A0021E79F /* fr */, - E135CD6F1E54BC0C0021E79F /* de */, - E135CD711E54BCA70021E79F /* bg */, - E135CD721E54BD300021E79F /* cs */, - E135CD731E54BD350021E79F /* cy */, - E135CD741E54BD410021E79F /* da */, - E135CD751E54BD4C0021E79F /* en-AU */, - E135CD761E54BD4F0021E79F /* en-CA */, - E135CD771E54BD510021E79F /* en-GB */, - E135CD781E54BD530021E79F /* pt-BR */, - E135CD791E54BD590021E79F /* zh-Hans */, - E135CD7A1E54BD5B0021E79F /* zh-Hant */, - E135CD7B1E54BD620021E79F /* it */, - E135CD7C1E54BD6D0021E79F /* ko */, - E135CD7D1E54BD730021E79F /* nb */, - E135CD7E1E54BD7B0021E79F /* nl */, - E135CD7F1E54BD810021E79F /* pl */, - E135CD801E54BD860021E79F /* pt */, - E135CD811E54BD8A0021E79F /* sv */, - E135CD821E54BD910021E79F /* ro */, - E135CD831E54BD980021E79F /* ru */, - E135CD841E54BD9D0021E79F /* sq */, - E135CD851E54BDA30021E79F /* th */, - E135CD861E54BDAC0021E79F /* tr */, - E135CD871E54BDE40021E79F /* he */, - E135CD881E54BDE60021E79F /* hr */, - E135CD891E54BDEB0021E79F /* hu */, - E135CD8A1E54BDED0021E79F /* id */, - E135CD8B1E54BDEF0021E79F /* is */, - E163AFA01ED45B110035317E /* sk */, - ); - name = Localizable.strings; - sourceTree = ""; - }; E1C5B2131E54C28C00052319 /* Localizable.strings */ = { isa = PBXVariantGroup; children = ( diff --git a/WordPress/WordPressAllTimeWidget/AllTimeViewController.swift b/WordPress/WordPressAllTimeWidget/AllTimeViewController.swift index f9a0a22ec2a5..51e1fdd3e0e4 100644 --- a/WordPress/WordPressAllTimeWidget/AllTimeViewController.swift +++ b/WordPress/WordPressAllTimeWidget/AllTimeViewController.swift @@ -475,10 +475,10 @@ private extension AllTimeViewController { // MARK: - Constants enum LocalizedText { - static let visitors = NSLocalizedString("Visitors", comment: "Stats Visitors Label") - static let views = NSLocalizedString("Views", comment: "Stats Views Label") - static let posts = NSLocalizedString("Posts", comment: "Stats Posts Label") - static let bestViews = NSLocalizedString("Best views ever", comment: "Stats 'Best views ever' Label") + static let visitors = AppLocalizedString("Visitors", comment: "Stats Visitors Label") + static let views = AppLocalizedString("Views", comment: "Stats Views Label") + static let posts = AppLocalizedString("Posts", comment: "Stats Posts Label") + static let bestViews = AppLocalizedString("Best views ever", comment: "Stats 'Best views ever' Label") } enum Constants { diff --git a/WordPress/WordPressAllTimeWidget/Base.lproj/Localizable.strings b/WordPress/WordPressAllTimeWidget/Base.lproj/Localizable.strings deleted file mode 100644 index a8521721851a..000000000000 Binary files a/WordPress/WordPressAllTimeWidget/Base.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressStatsWidgets/Views/Localization/AppLocalizedString.swift b/WordPress/WordPressStatsWidgets/Views/Localization/AppLocalizedString.swift deleted file mode 100644 index 1fe364ba6809..000000000000 --- a/WordPress/WordPressStatsWidgets/Views/Localization/AppLocalizedString.swift +++ /dev/null @@ -1,28 +0,0 @@ -import SwiftUI - -extension Bundle { - static let app: Bundle = { - var url = Bundle.main.bundleURL - while url.pathExtension != "app" && url.lastPathComponent != "/" { - url.deleteLastPathComponent() - } - guard let appBundle = Bundle(url: url) else { fatalError("Unable to find the parent app bundle") } - return appBundle - }() -} - -/// Use this to express *intent* on your API – though remember that, as a `typealias`, it won't provide any compile-time guarantee. -typealias LocalizedString = String - -/// Be sure to use this function instead of `NSLocalizedString` in order to reference localized strings **from the app bundle**. -/// As `NSLocalisedString` by default will look up strings in the current (main) bundle, which could be an App Extension for cases like a Widget -/// but, in order to avoid duplicating our strings accross targets, it is better to make App Extensions / Widgets reference the strings -/// from the `Localizable.strings` files that are hosted in the app bundle instead of hosting their own `.strings` file. -/// -/// Also, be sure to pass this function name as a custom routine when parsing the code to generate the main `.strings` file, -/// using `genstrings -s AppLocalizedString` so that this helper method is recognized. You will also have to -/// exclude this very file from being parsed by `genstrings`, so that it won't accidentally misinterpret that -/// routine/function definition below as a call site and generate an error because of it. -func AppLocalizedString(_ key: String, tableName: String? = nil, value: String? = nil, comment: String) -> LocalizedString { - Bundle.app.localizedString(forKey: key, value: value, table: nil) -} diff --git a/WordPress/WordPressThisWeekWidget/Base.lproj/Localizable.strings b/WordPress/WordPressThisWeekWidget/Base.lproj/Localizable.strings deleted file mode 100644 index ed60b89c4731..000000000000 Binary files a/WordPress/WordPressThisWeekWidget/Base.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/Base.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/Base.lproj/Localizable.strings deleted file mode 100644 index 1e4aff8e894e..000000000000 Binary files a/WordPress/WordPressTodayWidget/Base.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/TodayViewController.swift b/WordPress/WordPressTodayWidget/TodayViewController.swift index b2213060d707..ebaf1587e0e6 100644 --- a/WordPress/WordPressTodayWidget/TodayViewController.swift +++ b/WordPress/WordPressTodayWidget/TodayViewController.swift @@ -484,10 +484,10 @@ private extension TodayViewController { // MARK: - Constants enum LocalizedText { - static let visitors = NSLocalizedString("Visitors", comment: "Stats Visitors Label") - static let views = NSLocalizedString("Views", comment: "Stats Views Label") - static let likes = NSLocalizedString("Likes", comment: "Stats Likes Label") - static let comments = NSLocalizedString("Comments", comment: "Stats Comments Label") + static let visitors = AppLocalizedString("Visitors", comment: "Stats Visitors Label") + static let views = AppLocalizedString("Views", comment: "Stats Views Label") + static let likes = AppLocalizedString("Likes", comment: "Stats Likes Label") + static let comments = AppLocalizedString("Comments", comment: "Stats Comments Label") } enum Constants { diff --git a/WordPress/WordPressTodayWidget/ar.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/ar.lproj/Localizable.strings deleted file mode 100644 index df91d52eaea1..000000000000 Binary files a/WordPress/WordPressTodayWidget/ar.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/bg.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/bg.lproj/Localizable.strings deleted file mode 100644 index eed61e6f57bb..000000000000 Binary files a/WordPress/WordPressTodayWidget/bg.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/cs.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/cs.lproj/Localizable.strings deleted file mode 100644 index 31214acd90a4..000000000000 Binary files a/WordPress/WordPressTodayWidget/cs.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/cy.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/cy.lproj/Localizable.strings deleted file mode 100644 index b7b06ab059ee..000000000000 Binary files a/WordPress/WordPressTodayWidget/cy.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/da.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/da.lproj/Localizable.strings deleted file mode 100644 index 8f5ec76bae66..000000000000 Binary files a/WordPress/WordPressTodayWidget/da.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/de.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/de.lproj/Localizable.strings deleted file mode 100644 index 3eb30fb3133a..000000000000 Binary files a/WordPress/WordPressTodayWidget/de.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/en-AU.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/en-AU.lproj/Localizable.strings deleted file mode 100644 index 8dfa67aabec1..000000000000 Binary files a/WordPress/WordPressTodayWidget/en-AU.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/en-CA.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/en-CA.lproj/Localizable.strings deleted file mode 100644 index 8dfa67aabec1..000000000000 Binary files a/WordPress/WordPressTodayWidget/en-CA.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/en-GB.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/en-GB.lproj/Localizable.strings deleted file mode 100644 index 8dfa67aabec1..000000000000 Binary files a/WordPress/WordPressTodayWidget/en-GB.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/es.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/es.lproj/Localizable.strings deleted file mode 100644 index 1bc4d5e9572b..000000000000 Binary files a/WordPress/WordPressTodayWidget/es.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/fr.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/fr.lproj/Localizable.strings deleted file mode 100644 index 3ab7ff98dbee..000000000000 Binary files a/WordPress/WordPressTodayWidget/fr.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/he.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/he.lproj/Localizable.strings deleted file mode 100644 index 025e1c793976..000000000000 Binary files a/WordPress/WordPressTodayWidget/he.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/hr.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/hr.lproj/Localizable.strings deleted file mode 100644 index feabcb749d5e..000000000000 Binary files a/WordPress/WordPressTodayWidget/hr.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/hu.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/hu.lproj/Localizable.strings deleted file mode 100644 index 6ad18e82fa83..000000000000 Binary files a/WordPress/WordPressTodayWidget/hu.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/id.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/id.lproj/Localizable.strings deleted file mode 100644 index 2fbd4aa7b6ac..000000000000 Binary files a/WordPress/WordPressTodayWidget/id.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/is.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/is.lproj/Localizable.strings deleted file mode 100644 index 5f38153784bb..000000000000 Binary files a/WordPress/WordPressTodayWidget/is.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/it.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/it.lproj/Localizable.strings deleted file mode 100644 index b49a5f524884..000000000000 Binary files a/WordPress/WordPressTodayWidget/it.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/ja.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/ja.lproj/Localizable.strings deleted file mode 100644 index 945a9c1a8fbe..000000000000 Binary files a/WordPress/WordPressTodayWidget/ja.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/ko.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/ko.lproj/Localizable.strings deleted file mode 100644 index 1a88de85e3d4..000000000000 Binary files a/WordPress/WordPressTodayWidget/ko.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/nb.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/nb.lproj/Localizable.strings deleted file mode 100644 index 8b932f477d08..000000000000 Binary files a/WordPress/WordPressTodayWidget/nb.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/nl.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/nl.lproj/Localizable.strings deleted file mode 100644 index 216ce1971f55..000000000000 Binary files a/WordPress/WordPressTodayWidget/nl.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/pl.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/pl.lproj/Localizable.strings deleted file mode 100644 index b9c5473886ed..000000000000 Binary files a/WordPress/WordPressTodayWidget/pl.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/pt-BR.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/pt-BR.lproj/Localizable.strings deleted file mode 100644 index 747808369b63..000000000000 Binary files a/WordPress/WordPressTodayWidget/pt-BR.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/pt.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/pt.lproj/Localizable.strings deleted file mode 100644 index 04af9d38cb14..000000000000 Binary files a/WordPress/WordPressTodayWidget/pt.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/ro.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/ro.lproj/Localizable.strings deleted file mode 100644 index 27741762e07e..000000000000 Binary files a/WordPress/WordPressTodayWidget/ro.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/ru.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/ru.lproj/Localizable.strings deleted file mode 100644 index c5a9761f4b68..000000000000 Binary files a/WordPress/WordPressTodayWidget/ru.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/sk.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/sk.lproj/Localizable.strings deleted file mode 100644 index c8268f249281..000000000000 Binary files a/WordPress/WordPressTodayWidget/sk.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/sq.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/sq.lproj/Localizable.strings deleted file mode 100644 index 291c832c978c..000000000000 Binary files a/WordPress/WordPressTodayWidget/sq.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/sv.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/sv.lproj/Localizable.strings deleted file mode 100644 index 4c2cee7a5407..000000000000 Binary files a/WordPress/WordPressTodayWidget/sv.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/th.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/th.lproj/Localizable.strings deleted file mode 100644 index 281edf75e573..000000000000 Binary files a/WordPress/WordPressTodayWidget/th.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/tr.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/tr.lproj/Localizable.strings deleted file mode 100644 index aca6f9abe924..000000000000 Binary files a/WordPress/WordPressTodayWidget/tr.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/zh-Hans.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/zh-Hans.lproj/Localizable.strings deleted file mode 100644 index 4522cc09f057..000000000000 Binary files a/WordPress/WordPressTodayWidget/zh-Hans.lproj/Localizable.strings and /dev/null differ diff --git a/WordPress/WordPressTodayWidget/zh-Hant.lproj/Localizable.strings b/WordPress/WordPressTodayWidget/zh-Hant.lproj/Localizable.strings deleted file mode 100644 index 6a645692f397..000000000000 Binary files a/WordPress/WordPressTodayWidget/zh-Hant.lproj/Localizable.strings and /dev/null differ