Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

No Bug: Add non breaking space for "Learn more" strings. #2236

Merged
merged 1 commit into from
Jan 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Client/Frontend/NTP/NTPNotificationViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ class NTPNotificationViewController: TranslucentBottomSheet {

switch state {
case .getPaidTurnRewardsOn, .getPaidTurnAdsOn:
let learnMore = Strings.learnMore
let learnMore = Strings.learnMore.withNonBreakingSpace
config.bodyText =
(text: "\(Strings.NTP.getPaidToSeeThisImage)\n\(learnMore)",
(text: "\(Strings.NTP.getPaidToSeeThisImage) \(learnMore)",
urlInfo: [learnMore: "learn-more"],
action: { [weak self] action in
self?.learnMoreHandler?()
Expand All @@ -100,10 +100,10 @@ class NTPNotificationViewController: TranslucentBottomSheet {
self?.close()
})
case .gettingPaidAlready:
let learnMore = Strings.learnMore
let learnMore = Strings.learnMore.withNonBreakingSpace

config.bodyText =
(text: "\(Strings.NTP.youArePaidToSeeThisImage)\n\(learnMore)",
(text: "\(Strings.NTP.youArePaidToSeeThisImage) \(learnMore)",
urlInfo: [learnMore: "learn-more"],
action: { [weak self] action in
self?.learnMoreHandler?()
Expand Down
4 changes: 4 additions & 0 deletions Shared/Extensions/StringExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,8 @@ extension String {
attributedString.addAttributes(boldFontAttribute, range: range)
return attributedString
}

public var withNonBreakingSpace: String {
self.replacingOccurrences(of: " ", with: "\u{00a0}")
}
}