diff --git a/WordPress/Classes/ViewRelated/Post/PostSettingsViewController+FeaturedImageUpload.swift b/WordPress/Classes/ViewRelated/Post/PostSettingsViewController+FeaturedImageUpload.swift index 972767a17a97..0766a2027d99 100644 --- a/WordPress/Classes/ViewRelated/Post/PostSettingsViewController+FeaturedImageUpload.swift +++ b/WordPress/Classes/ViewRelated/Post/PostSettingsViewController+FeaturedImageUpload.swift @@ -118,10 +118,26 @@ extension PostSettingsViewController { } struct FeaturedImageActionSheet { - static let title = NSLocalizedString("Featured Image Options", comment: "Title for action sheet with featured media options.") - static let dismissActionTitle = NSLocalizedString("Dismiss", comment: "User action to dismiss featured media options.") - static let retryUploadActionTitle = NSLocalizedString("Retry", comment: "User action to retry featured media upload.") - static let removeActionTitle = NSLocalizedString("Remove", comment: "User action to remove featured media.") + static let title = NSLocalizedString( + "postSettings.featuredImageUploadActionSheet.title", + value: "Featured Image Options", + comment: "Title for action sheet with featured media options." + ) + static let dismissActionTitle = NSLocalizedString( + "postSettings.featuredImageUploadActionSheet.dismiss", + value: "Dismiss", + comment: "User action to dismiss featured media options." + ) + static let retryUploadActionTitle = NSLocalizedString( + "postSettings.featuredImageUploadActionSheet.retryUpload", + value: "Retry", + comment: "User action to retry featured media upload." + ) + static let removeActionTitle = NSLocalizedString( + "postSettings.featuredImageUploadActionSheet.remove", + value: "Remove", + comment: "User action to remove featured media." + ) } } diff --git a/WordPress/Classes/ViewRelated/QR Login/View Controllers/QRLoginVerifyAuthorizationViewController.swift b/WordPress/Classes/ViewRelated/QR Login/View Controllers/QRLoginVerifyAuthorizationViewController.swift index 70928ccdc163..c28f5b8878e2 100644 --- a/WordPress/Classes/ViewRelated/QR Login/View Controllers/QRLoginVerifyAuthorizationViewController.swift +++ b/WordPress/Classes/ViewRelated/QR Login/View Controllers/QRLoginVerifyAuthorizationViewController.swift @@ -196,9 +196,22 @@ extension QRLoginVerifyAuthorizationViewController { enum completed { static let imageName = "domains-success" - static let title = NSLocalizedString("You're logged in!", comment: "Title for the success view when the user has successfully logged in") - static let subtitle = NSLocalizedString("Tap dismiss and head back to your web browser to continue.", comment: "Subtitle instructing the user to tap the dismiss button to leave the log in flow") - static let confirmButton = NSLocalizedString("Dismiss", comment: "Button label that dismisses the qr log in flow and returns the user back to the previous screen") + static let title = NSLocalizedString( + "qrLoginVerifyAuthorization.completedInstructions.title", + value: "You're logged in!", + comment: "Title for the success view when the user has successfully logged in" + ) + private static let subtitleFormat = NSLocalizedString( + "qrLoginVerifyAuthorization.completedInstructions.subtitle", + value: "Tap '%@' and head back to your web browser to continue.", + comment: "Subtitle instructing the user to tap the dismiss button to leave the log in flow. %@ is a placeholder for the dismiss button name." + ) + static let confirmButton = NSLocalizedString( + "qrLoginVerifyAuthorization.completedInstructions.dismiss", + value: "Dismiss", + comment: "Button label that dismisses the qr log in flow and returns the user back to the previous screen" + ) + static let subtitle = String(format: subtitleFormat, Self.confirmButton) } enum noConnection { diff --git a/WordPress/Classes/ViewRelated/Reader/Detail/ReaderDetailViewController.swift b/WordPress/Classes/ViewRelated/Reader/Detail/ReaderDetailViewController.swift index bacceb6e5865..74e8dc9def4f 100644 --- a/WordPress/Classes/ViewRelated/Reader/Detail/ReaderDetailViewController.swift +++ b/WordPress/Classes/ViewRelated/Reader/Detail/ReaderDetailViewController.swift @@ -1101,20 +1101,61 @@ extension ReaderDetailViewController: UIViewControllerRestoration { // MARK: - Strings extension ReaderDetailViewController { private struct Strings { - static let backButtonAccessibilityLabel = NSLocalizedString("Back", comment: "Spoken accessibility label") - static let dismissButtonAccessibilityLabel = NSLocalizedString("Dismiss", comment: "Spoken accessibility label") - static let safariButtonAccessibilityLabel = NSLocalizedString("Open in Safari", comment: "Spoken accessibility label") - static let shareButtonAccessibilityLabel = NSLocalizedString("Share", comment: "Spoken accessibility label") - static let moreButtonAccessibilityLabel = NSLocalizedString("More", comment: "Spoken accessibility label") - static let localPostsSectionTitle = NSLocalizedString("More from %1$@", comment: "Section title for local related posts. %1$@ is a placeholder for the blog display name.") - static let globalPostsSectionTitle = NSLocalizedString("More on WordPress.com", comment: "Section title for global related posts.") - static let tooltipTitle = NSLocalizedString("Follow the conversation", comment: "Title of follow conversations tooltip.") + static let backButtonAccessibilityLabel = NSLocalizedString( + "readerDetail.backButton.accessibilityLabel", + value: "Back", + comment: "Spoken accessibility label" + ) + static let dismissButtonAccessibilityLabel = NSLocalizedString( + "readerDetail.dismissButton.accessibilityLabel", + value: "Dismiss", + comment: "Spoken accessibility label" + ) + static let safariButtonAccessibilityLabel = NSLocalizedString( + "readerDetail.backButton.accessibilityLabel", + value: "Open in Safari", + comment: "Spoken accessibility label" + ) + static let shareButtonAccessibilityLabel = NSLocalizedString( + "readerDetail.shareButton.accessibilityLabel", + value: "Share", + comment: "Spoken accessibility label" + ) + static let moreButtonAccessibilityLabel = NSLocalizedString( + "readerDetail.moreButton.accessibilityLabel", + value: "More", + comment: "Spoken accessibility label" + ) + static let localPostsSectionTitle = NSLocalizedString( + "readerDetail.localPostsSection.accessibilityLabel", + value: "More from %1$@", + comment: "Section title for local related posts. %1$@ is a placeholder for the blog display name." + ) + static let globalPostsSectionTitle = NSLocalizedString( + "readerDetail.globalPostsSection.accessibilityLabel", + value: "More on WordPress.com", + comment: "Section title for global related posts." + ) + static let tooltipTitle = NSLocalizedString( + "readerDetail.followConversationTooltipTitle.accessibilityLabel", + value: "Follow the conversation", + comment: "Title of follow conversations tooltip." + ) static let tooltipMessage = NSLocalizedString( - "Get notified when new comments are added to this post.", + "readerDetail.followConversationTooltipMessage.accessibilityLabel", + value: "Get notified when new comments are added to this post.", comment: "Message for the follow conversations tooltip." ) - static let tooltipButtonTitle = NSLocalizedString("Got it", comment: "Button title for the follow conversations tooltip.") - static let tooltipAnchorTitle = NSLocalizedString("New", comment: "Title for the tooltip anchor.") + static let tooltipButtonTitle = NSLocalizedString( + "readerDetail.followConversationTooltipButton.accessibilityLabel", + value: "Got it", + comment: "Button title for the follow conversations tooltip." + ) + static let tooltipAnchorTitle = NSLocalizedString( + "readerDetail.tooltipAnchorTitle.accessibilityLabel", + value: "New", + comment: "Title for the tooltip anchor." + ) } } diff --git a/WordPress/Classes/ViewRelated/Stats/Insights/Insights Management/CustomizeInsightsCell.swift b/WordPress/Classes/ViewRelated/Stats/Insights/Insights Management/CustomizeInsightsCell.swift index 970cb542f56f..93c81d1431d2 100644 --- a/WordPress/Classes/ViewRelated/Stats/Insights/Insights Management/CustomizeInsightsCell.swift +++ b/WordPress/Classes/ViewRelated/Stats/Insights/Insights Management/CustomizeInsightsCell.swift @@ -75,12 +75,36 @@ private extension CustomizeInsightsCell { // MARK: - Constants struct Labels { - static let title = NSLocalizedString("Customize your insights", comment: "Customize Insights title") - static let content = NSLocalizedString("Create your own customized dashboard and choose what reports to see. Focus on the data you care most about.", comment: "Customize Insights description") - static let tryIt = NSLocalizedString("Try it now", comment: "Customize Insights button title") - static let dismiss = NSLocalizedString("Dismiss", comment: "Customize Insights button title") - static let dismissHint = NSLocalizedString("Tap to dismiss this card", comment: "Accessibility hint") - static let tryItHint = NSLocalizedString("Tap to customize insights", comment: "Accessibility hint") + static let title = NSLocalizedString( + "customizeInsightsCell.title", + value: "Customize your insights", + comment: "Customize Insights title" + ) + static let content = NSLocalizedString( + "customizeInsightsCell.content", + value: "Create your own customized dashboard and choose what reports to see. Focus on the data you care most about.", + comment: "Customize Insights description" + ) + static let tryIt = NSLocalizedString( + "customizeInsightsCell.tryItButton.title", + value: "Try it now", + comment: "Customize Insights button title" + ) + static let dismiss = NSLocalizedString( + "customizeInsightsCell.dismissButton.title", + value: "Dismiss", + comment: "Customize Insights button title" + ) + static let dismissHint = NSLocalizedString( + "customizeInsightsCell.dismissButton.accessibilityHint", + value: "Tap to dismiss this card", + comment: "Accessibility hint" + ) + static let tryItHint = NSLocalizedString( + "customizeInsightsCell.tryItButton.accessibilityHint", + value: "Tap to customize insights", + comment: "Accessibility hint" + ) } } diff --git a/WordPress/Classes/ViewRelated/Stats/Shared Views/GrowAudienceCell.swift b/WordPress/Classes/ViewRelated/Stats/Shared Views/GrowAudienceCell.swift index 29c32271a88f..4f881cbec7de 100644 --- a/WordPress/Classes/ViewRelated/Stats/Shared Views/GrowAudienceCell.swift +++ b/WordPress/Classes/ViewRelated/Stats/Shared Views/GrowAudienceCell.swift @@ -143,18 +143,29 @@ class GrowAudienceCell: UITableViewCell, NibLoadable { private enum Strings { - static let viewsCountDescriptionSingular = - NSLocalizedString("View to your site so far", comment: "Description for view count. Singular.") - - static let viewsCountDescriptionPlural = - NSLocalizedString("Views to your site so far", comment: "Description for view count. Singular.") - - static let tipTitle = - NSLocalizedString("A tip to grow your audience", - comment: "A hint to users about growing the audience for their site, when their site doesn't have many views yet.") - - static let dismissButtonTitle = - NSLocalizedString("Dismiss", comment: "Title for button that will dismiss the Grow Your Audience card.") + static let viewsCountDescriptionSingular = NSLocalizedString( + "growAudienceCell.viewsCount.singular", + value: "View to your site so far", + comment: "Description for view count. Singular." + ) + + static let viewsCountDescriptionPlural = NSLocalizedString( + "growAudienceCell.viewsCount.plural", + value: "Views to your site so far", + comment: "Description for view count. Singular." + ) + + static let tipTitle = NSLocalizedString( + "growAudienceCell.tip", + value: "A tip to grow your audience", + comment: "A hint to users about growing the audience for their site, when their site doesn't have many views yet." + ) + + static let dismissButtonTitle = NSLocalizedString( + "growAudienceCell.dismiss", + value: "Dismiss", + comment: "Title for button that will dismiss the Grow Your Audience card." + ) static func getViewsCountDescription(viewsCount: Int) -> String { return viewsCount == 1 ? viewsCountDescriptionSingular : viewsCountDescriptionPlural @@ -166,63 +177,99 @@ class GrowAudienceCell: UITableViewCell, NibLoadable { } enum Social { - static let detailsTitle = - NSLocalizedString("Automatically share new posts to your social media to start bringing that audience over to your site.", - comment: "A detailed message to users about growing the audience for their site through enabling post sharing.") - - static let actionButtonTitle = - NSLocalizedString("Enable post sharing", comment: "Title for button that will open up the social media Sharing screen.") - - static let completedTipTitle = - NSLocalizedString("Sharing is set up!", - comment: "A hint to users that they've set up post sharing.") - - static let completedDetailsTitle = - NSLocalizedString("When you publish your next post it will be automatically shared to your connected networks.", - comment: "A detailed message to users indicating that they've set up post sharing.") - - static let completedActionButtonTitle = - NSLocalizedString("Connect more networks", comment: "Title for button that will open up the social media Sharing screen.") + static let detailsTitle = NSLocalizedString( + "growAudienceCell.social.title", + value: "Automatically share new posts to your social media to start bringing that audience over to your site.", + comment: "A detailed message to users about growing the audience for their site through enabling post sharing." + ) + + static let actionButtonTitle = NSLocalizedString( + "growAudienceCell.social.actionButton", + value: "Enable post sharing", + comment: "Title for button that will open up the social media Sharing screen." + ) + + static let completedTipTitle = NSLocalizedString( + "growAudienceCell.social.completed.title", + value: "Sharing is set up!", + comment: "A hint to users that they've set up post sharing." + ) + + static let completedDetailsTitle = NSLocalizedString( + "growAudienceCell.social.completed.details", + value: "When you publish your next post it will be automatically shared to your connected networks.", + comment: "A detailed message to users indicating that they've set up post sharing." + ) + + static let completedActionButtonTitle = NSLocalizedString( + "growAudienceCell.social.completed.button", + value: "Connect more networks", + comment: "Title for button that will open up the social media Sharing screen." + ) } enum BloggingReminders { - static let detailsTitle = - NSLocalizedString("Posting regularly can help build an audience. Reminders help keep you on track.", - comment: "A detailed message to users about growing the audience for their site through blogging reminders.") - - static let actionButtonTitle = - NSLocalizedString("Set up blogging reminders", comment: "Title for button that will open up the blogging reminders screen.") - - static let completedTipTitle = - NSLocalizedString("You set up blogging reminders", - comment: "A hint to users that they've set up blogging reminders.") - - static let completedDetailsTitle = - NSLocalizedString("Keep blogging and check back to see visitors arriving at your site.", - comment: "A detailed message to users indicating that they've set up blogging reminders.") - - static let completedActionButtonTitle = - NSLocalizedString("Edit reminders", comment: "Title for button that will open up the blogging reminders screen.") + static let detailsTitle = NSLocalizedString( + "growAudienceCell.bloggingReminders.details", + value: "Posting regularly can help build an audience. Reminders help keep you on track.", + comment: "A detailed message to users about growing the audience for their site through blogging reminders." + ) + + static let actionButtonTitle = NSLocalizedString( + "growAudienceCell.bloggingReminders.actionButton", + value: "Set up blogging reminders", + comment: "Title for button that will open up the blogging reminders screen." + ) + + static let completedTipTitle = NSLocalizedString( + "growAudienceCell.bloggingReminders.completed.tip", + value: "You set up blogging reminders", + comment: "A hint to users that they've set up blogging reminders." + ) + + static let completedDetailsTitle = NSLocalizedString( + "growAudienceCell.bloggingReminders.completed.details", + value: "Keep blogging and check back to see visitors arriving at your site.", + comment: "A detailed message to users indicating that they've set up blogging reminders." + ) + + static let completedActionButtonTitle = NSLocalizedString( + "growAudienceCell.bloggingReminders.completed.actionButton", + value: "Edit reminders", + comment: "Title for button that will open up the blogging reminders screen." + ) } enum ReaderDiscover { - static let detailsTitle = - NSLocalizedString("Connect with other bloggers by following, liking and commenting on their posts.", - comment: "A detailed message to users about growing the audience for their site through reader discover.") - - static let actionButtonTitle = - NSLocalizedString("Discover blogs to follow", comment: "Title for button that will open up the follow topics screen.") - - static let completedTipTitle = - NSLocalizedString("You've connected with other blogs", - comment: "A hint to users that they've set up reader discover.") - - static let completedDetailsTitle = - NSLocalizedString("Keep going! Liking and commenting is a good way to build a network. Go to Reader to find more posts.", - comment: "A detailed message to users indicating that they've set up reader discover.") - - static let completedActionButtonTitle = - NSLocalizedString("Do it again", comment: "Title for button that will open up the follow topics screen.") + static let detailsTitle = NSLocalizedString( + "growAudienceCell.readerDiscover.details", + value: "Connect with other bloggers by following, liking and commenting on their posts.", + comment: "A detailed message to users about growing the audience for their site through reader discover." + ) + + static let actionButtonTitle = NSLocalizedString( + "growAudienceCell.readerDiscover.actionButton", + value: "Discover blogs to follow", + comment: "Title for button that will open up the follow topics screen." + ) + + static let completedTipTitle = NSLocalizedString( + "growAudienceCell.readerDiscover.completed.tip", + value: "You've connected with other blogs", + comment: "A hint to users that they've set up reader discover." + ) + + static let completedDetailsTitle = NSLocalizedString( + "growAudienceCell.readerDiscover.completed.details", + value: "Keep going! Liking and commenting is a good way to build a network. Go to Reader to find more posts.", + comment: "A detailed message to users indicating that they've set up reader discover." + ) + + static let completedActionButtonTitle = NSLocalizedString( + "growAudienceCell.readerDiscover.completed.action", + value: "Do it again", + comment: "Title for button that will open up the follow topics screen." + ) } } diff --git a/WordPress/Classes/ViewRelated/Views/NoResultsViewController.swift b/WordPress/Classes/ViewRelated/Views/NoResultsViewController.swift index 4eb60c1bb98f..49442b6563a1 100644 --- a/WordPress/Classes/ViewRelated/Views/NoResultsViewController.swift +++ b/WordPress/Classes/ViewRelated/Views/NoResultsViewController.swift @@ -235,7 +235,11 @@ import Reachability /// Accepts an optional title, if none is provided, will default to 'Dismiss' func showDismissButton(title: String? = nil) { navigationItem.hidesBackButton = true - let buttonTitle = title ?? AppLocalizedString("Dismiss", comment: "Dismiss button title.") + let buttonTitle = title ?? AppLocalizedString( + "noResultsViewController.dismissButton", + value: "Dismiss", + comment: "Dismiss button title." + ) let dismissButton = UIBarButtonItem(title: buttonTitle, style: .done, diff --git a/WordPress/WordPressShareExtension/ShareExtensionEditorViewController.swift b/WordPress/WordPressShareExtension/ShareExtensionEditorViewController.swift index 8fbc3ec73e90..ac11c5e1a405 100644 --- a/WordPress/WordPressShareExtension/ShareExtensionEditorViewController.swift +++ b/WordPress/WordPressShareExtension/ShareExtensionEditorViewController.swift @@ -944,23 +944,39 @@ extension ShareExtensionEditorViewController { func displayActions(forAttachment attachment: MediaAttachment, position: CGPoint) { let mediaID = attachment.identifier - let title: String = AppLocalizedString("Media Options", comment: "Title for action sheet with media options.") + let title: String = AppLocalizedString( + "shareExtension.editor.attachmentActions.title", + value: "Media Options", + comment: "Title for action sheet with media options." + ) let alertController = UIAlertController(title: title, message: nil, preferredStyle: .actionSheet) - alertController.addActionWithTitle(AppLocalizedString("Dismiss", comment: "User action to dismiss media options."), - style: .cancel, - handler: { (action) in - if attachment == self.currentSelectedAttachment { - self.currentSelectedAttachment = nil - self.resetMediaAttachmentOverlay(attachment) - self.richTextView.refresh(attachment) - } - }) + alertController.addActionWithTitle( + AppLocalizedString( + "shareExtension.editor.attachmentActions.dismiss", + value: "Dismiss", + comment: "User action to dismiss media options." + ), + style: .cancel, + handler: { (action) in + if attachment == self.currentSelectedAttachment { + self.currentSelectedAttachment = nil + self.resetMediaAttachmentOverlay(attachment) + self.richTextView.refresh(attachment) + } + } + ) if attachment is ImageAttachment { - alertController.addActionWithTitle(AppLocalizedString("Remove", comment: "User action to remove media."), - style: .destructive, - handler: { (action) in - self.richTextView.remove(attachmentID: mediaID) - }) + alertController.addActionWithTitle( + AppLocalizedString( + "shareExtension.editor.attachmentActions.remove", + value: "Remove", + comment: "User action to remove media." + ), + style: .destructive, + handler: { (action) in + self.richTextView.remove(attachmentID: mediaID) + } + ) } alertController.title = title diff --git a/WordPress/WordPressShareExtension/ShareModularViewController.swift b/WordPress/WordPressShareExtension/ShareModularViewController.swift index 1931958144d0..119f1f0f9bb9 100644 --- a/WordPress/WordPressShareExtension/ShareModularViewController.swift +++ b/WordPress/WordPressShareExtension/ShareModularViewController.swift @@ -883,12 +883,28 @@ fileprivate extension ShareModularViewController { } func showRetryAlert() { - let title: String = AppLocalizedString("Sharing Error", comment: "Share extension error dialog title.") - let message: String = AppLocalizedString("Whoops, something went wrong while sharing. You can try again, maybe it was a glitch.", comment: "Share extension error dialog text.") - let dismiss: String = AppLocalizedString("Dismiss", comment: "Share extension error dialog cancel button label.") + let title: String = AppLocalizedString( + "shareModularViewController.retryAlert.title", + value: "Sharing Error", + comment: "Share extension error dialog title." + ) + let message: String = AppLocalizedString( + "shareModularViewController.retryAlert.message", + value: "Whoops, something went wrong while sharing. You can try again, maybe it was a glitch.", + comment: "Share extension error dialog text." + ) + let dismiss: String = AppLocalizedString( + "shareModularViewController.retryAlert.dismiss", + value: "Dismiss", + comment: "Share extension error dialog cancel button label." + ) let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert) - let acceptButtonText = AppLocalizedString("Try again", comment: "Share extension error dialog retry button label.") + let acceptButtonText = AppLocalizedString( + "shareModularViewController.retryAlert.accept", + value: "Try again", + comment: "Share extension error dialog retry button label." + ) let acceptAction = UIAlertAction(title: acceptButtonText, style: .default) { (action) in self.savePostToRemoteSite() }