Skip to content

Commit

Permalink
Move empty search results format string to Strings enum.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaclync committed Jul 27, 2020
1 parent 6273528 commit 7f63443
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ final class ProductListMultiSelectorSearchUICommand: SearchUICommand {
let boldSearchKeyword = NSAttributedString(string: searchKeyword,
attributes: [.font: EmptyStateViewController.Config.messageFont.bold])

let format = NSLocalizedString("We're sorry, we couldn't find results for “%@”",
comment: "Message for empty Products search results. The %@ is a placeholder for the text entered by the user.")
let message = NSMutableAttributedString(string: format)
let message = NSMutableAttributedString(string: Strings.emptySearchResultsFormat)
message.replaceFirstOccurrence(of: "%@", with: boldSearchKeyword)

viewController.configure(.simple(message: message, image: .emptySearchResultsImage))
Expand Down Expand Up @@ -119,5 +117,8 @@ private extension ProductListMultiSelectorSearchUICommand {
enum Strings {
static let cancel = NSLocalizedString("Cancel", comment: "Action title to cancel selecting products to add to a grouped product from search results")
static let done = NSLocalizedString("Done", comment: "Action title to select products to add to a grouped product from search results")
static let emptySearchResultsFormat =
NSLocalizedString("We're sorry, we couldn't find results for “%@”",
comment: "Message for empty Products search results. The %@ is a placeholder for the text entered by the user.")
}
}

0 comments on commit 7f63443

Please sign in to comment.