Skip to content

Commit c16a40a

Browse files
author
Emily Laguna
authored
Merge pull request #18614 from wordpress-mobile/fix/onboarding-enable-notifications-title
Fix onboarding enable notifications localization
2 parents cd9f78b + e7bc59f commit c16a40a

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

WordPress/Classes/ViewRelated/Blog/Onboarding Questions Prompt/OnboardingEnableNotificationsViewController.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ class OnboardingEnableNotificationsViewController: UIViewController {
44
@IBOutlet weak var titleLabel: UILabel!
55
@IBOutlet weak var subTitleLabel: UILabel!
66
@IBOutlet weak var detailView: UIView!
7+
@IBOutlet weak var enableButton: UIButton!
8+
@IBOutlet weak var cancelButton: UIButton!
79

810
let option: OnboardingOption
911
let coordinator: OnboardingQuestionsCoordinator
@@ -26,6 +28,7 @@ class OnboardingEnableNotificationsViewController: UIViewController {
2628
navigationController?.delegate = self
2729

2830
applyStyles()
31+
applyLocalization()
2932
updateContent()
3033

3134
coordinator.notificationsDisplayed(option: option)
@@ -86,6 +89,12 @@ private extension OnboardingEnableNotificationsViewController {
8689
subTitleLabel.textColor = .secondaryLabel
8790
}
8891

92+
func applyLocalization() {
93+
titleLabel.text = Strings.title
94+
enableButton.setTitle(Strings.enableButton, for: .normal)
95+
cancelButton.setTitle(Strings.cancelButton, for: .normal)
96+
}
97+
8998
func updateContent() {
9099
let text: String
91100
let notificationContent: UnifiedPrologueNotificationsContent?
@@ -125,6 +134,12 @@ private extension OnboardingEnableNotificationsViewController {
125134
}
126135

127136
// MARK: - Constants / Strings
137+
private struct Strings {
138+
static let title = NSLocalizedString("Enable Notifications?", comment: "Title of the view, asking the user if they want to enable notifications.")
139+
static let enableButton = NSLocalizedString("Enable Notifications", comment: "Title of button that enables push notifications when tapped")
140+
static let cancelButton = NSLocalizedString("Not Now", comment: "Title of a button that cancels enabling notifications when tapped")
141+
}
142+
128143
private struct StatsStrings {
129144
static let subTitle = NSLocalizedString("Know when your site is getting more traffic, new followers, or when it passes a new milestone!", comment: "Subtitle giving the user more context about why to enable notifications.")
130145

WordPress/Classes/ViewRelated/Blog/Onboarding Questions Prompt/OnboardingEnableNotificationsViewController.xib

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
<objects>
1414
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="OnboardingEnableNotificationsViewController" customModule="WordPress" customModuleProvider="target">
1515
<connections>
16+
<outlet property="cancelButton" destination="TsX-gV-qHT" id="LwJ-1J-eDF"/>
1617
<outlet property="detailView" destination="E9E-nc-B5q" id="H5P-Fa-E6T"/>
18+
<outlet property="enableButton" destination="0z0-r0-F4b" id="MYg-CR-0wL"/>
1719
<outlet property="subTitleLabel" destination="50P-8O-Ctu" id="4dY-dn-nT7"/>
1820
<outlet property="titleLabel" destination="cpw-1P-GER" id="tqX-v7-b8v"/>
1921
<outlet property="view" destination="Mlb-pH-BGO" id="zZL-y0-ws4"/>

0 commit comments

Comments
 (0)