Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

Commit

Permalink
Display the translated string for text view in onboarding (#1057)
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyg authored and devinreams committed Jun 22, 2019
1 parent f114bb7 commit 3880614
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
1 change: 1 addition & 0 deletions lockbox-ios/Common/Resources/Constants.swift
Expand Up @@ -105,4 +105,5 @@ extension Constant.string {
static let disclaimerLabel = NSLocalizedString("settings.unlinkDisclaimer", value: "This removes synced logins from %@, but will not delete your logins from Firefox.", comment: "Label on account setting explaining unlink. %@ will be replaced with the application name")
static let onboardingTitle = NSLocalizedString("onboarding.title", value: "Welcome to %@", comment: "Title on onboarding screen. %@ will be replaced with the application name")
static let getStarted = NSLocalizedString("get.started", value: "Get Started", comment: "Title for the FxA login screen.")
static let syncBetweenDevicesEncryption = NSLocalizedString("securityTheather.syncBetweenDevices", value: "Sync between devices with secure 256-bit encryption", comment: "Text shown on security screen during onboarding.")
}
30 changes: 14 additions & 16 deletions lockbox-ios/View/OnboardingConfirmationView.swift
Expand Up @@ -57,24 +57,22 @@ extension OnboardingConfirmationView {
self.finishButton.layer.cornerRadius = 5
self.finishButton.clipsToBounds = true

if let encryptionText = self.encryptionTextView.text {
self.encryptionTextView.delegate = self
let text = NSMutableAttributedString(string: encryptionText)
let range = text.mutableString.range(of: Constant.string.onboardingSecurityPostfix)
text.addAttributes([
NSAttributedString.Key.font: UIFont.systemFont(ofSize: 15.0)
], range: NSMakeRange(0, text.length)) // swiftlint:disable:this legacy_constructor
self.encryptionTextView.delegate = self
let text = NSMutableAttributedString(string: Constant.string.syncBetweenDevicesEncryption)
let range = text.mutableString.range(of: Constant.string.onboardingSecurityPostfix)
text.addAttributes([
NSAttributedString.Key.font: UIFont.systemFont(ofSize: 15.0)
], range: NSMakeRange(0, text.length)) // swiftlint:disable:this legacy_constructor

text.addAttributes(
[
NSAttributedString.Key.link: NSString(string: Constant.app.securityFAQ),
NSAttributedString.Key.foregroundColor: Constant.color.lockBoxViolet
],
range: range
)
text.addAttributes(
[
NSAttributedString.Key.link: NSString(string: Constant.app.securityFAQ),
NSAttributedString.Key.foregroundColor: Constant.color.lockBoxViolet
],
range: range
)

self.encryptionTextView.attributedText = text
}
self.encryptionTextView.attributedText = text
}

private func setupStrings() {
Expand Down

0 comments on commit 3880614

Please sign in to comment.