Fix email-confirmation-screen-title (#690)

what a word.
This commit is contained in:
Nathan Mattes 2022-12-28 15:25:54 +01:00
parent 18e25aea30
commit 9e1dbe1dff
6 changed files with 19 additions and 47 deletions

View File

@ -383,8 +383,7 @@
},
"confirm_email": {
"title": "One last thing.",
"subtitle": "Tap the link we emailed to you to verify your account.",
"tap_the_link_we_emailed_to_you_to_verify_your_account": "Tap the link we emailed to you to verify your account",
"tap_the_link_we_emailed_to_you_to_verify_your_account": "Tap the link we sent you to verify %@. Well wait right here.",
"button": {
"open_email_app": "Open Email App",
"resend": "Resend"

View File

@ -393,9 +393,8 @@
}
},
"confirm_email": {
"title": "One last thing.",
"subtitle": "Tap the link we emailed to you to verify your account.",
"tap_the_link_we_emailed_to_you_to_verify_your_account": "Tap the link we emailed to you to verify your account",
"title": "Check Your Inbox",
"tap_the_link_we_emailed_to_you_to_verify_your_account": "Tap the link we sent you to verify %@. Well wait right here.",
"button": {
"open_email_app": "Open Email App",
"resend": "Resend"

View File

@ -26,19 +26,10 @@ final class MastodonConfirmEmailViewController: UIViewController, NeedsDependenc
let stackView = UIStackView()
let largeTitleLabel: UILabel = {
let label = UILabel()
label.font = UIFontMetrics(forTextStyle: .largeTitle).scaledFont(for: UIFont.systemFont(ofSize: 34, weight: .bold))
label.textColor = .label
label.text = L10n.Scene.ConfirmEmail.title
return label
}()
private(set) lazy var subtitleLabel: UILabel = {
let label = UILabel()
label.font = UIFontMetrics(forTextStyle: .title1).scaledFont(for: UIFont.systemFont(ofSize: 20))
label.textColor = .secondaryLabel
label.text = L10n.Scene.ConfirmEmail.tapTheLinkWeEmailedToYouToVerifyYourAccount
label.font = UIFontMetrics(forTextStyle: .body).scaledFont(for: UIFont.systemFont(ofSize: 17))
label.textColor = .label
label.numberOfLines = 0
return label
}()
@ -57,10 +48,6 @@ final class MastodonConfirmEmailViewController: UIViewController, NeedsDependenc
return navigationActionView
}()
deinit {
os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s", ((#file as NSString).lastPathComponent), #line, #function)
}
}
extension MastodonConfirmEmailViewController {
@ -68,16 +55,16 @@ extension MastodonConfirmEmailViewController {
override func viewDidLoad() {
setupOnboardingAppearance()
configureTitleLabel()
configureMargin()
subtitleLabel.text = L10n.Scene.ConfirmEmail.tapTheLinkWeEmailedToYouToVerifyYourAccount(viewModel.email)
// stackView
stackView.axis = .vertical
stackView.distribution = .fill
stackView.spacing = 10
stackView.layoutMargins = UIEdgeInsets(top: 10, left: 0, bottom: 23, right: 0)
stackView.isLayoutMarginsRelativeArrangement = true
stackView.addArrangedSubview(largeTitleLabel)
stackView.addArrangedSubview(subtitleLabel)
stackView.addArrangedSubview(emailImageView)
emailImageView.setContentHuggingPriority(.defaultLow, for: .vertical)
@ -140,31 +127,19 @@ extension MastodonConfirmEmailViewController {
navigationActionView.nextButton.setTitle(L10n.Scene.ConfirmEmail.Button.openEmailApp, for: .normal)
navigationActionView.nextButton.addTarget(self, action: #selector(MastodonConfirmEmailViewController.openEmailButtonPressed(_:)), for: .touchUpInside)
title = L10n.Scene.ConfirmEmail.title
}
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
super.traitCollectionDidChange(previousTraitCollection)
configureTitleLabel()
configureMargin()
}
}
extension MastodonConfirmEmailViewController {
private func configureTitleLabel() {
switch traitCollection.horizontalSizeClass {
case .regular:
navigationItem.largeTitleDisplayMode = .always
navigationItem.title = L10n.Scene.ConfirmEmail.title.replacingOccurrences(of: "\n", with: " ")
largeTitleLabel.isHidden = true
default:
navigationItem.largeTitleDisplayMode = .never
navigationItem.title = nil
largeTitleLabel.isHidden = false
}
}
private func configureMargin() {
switch traitCollection.horizontalSizeClass {
case .regular:

View File

@ -620,12 +620,12 @@ public enum L10n {
}
}
public enum ConfirmEmail {
/// Tap the link we emailed to you to verify your account.
public static let subtitle = L10n.tr("Localizable", "Scene.ConfirmEmail.Subtitle", fallback: "Tap the link we emailed to you to verify your account.")
/// Tap the link we emailed to you to verify your account
public static let tapTheLinkWeEmailedToYouToVerifyYourAccount = L10n.tr("Localizable", "Scene.ConfirmEmail.TapTheLinkWeEmailedToYouToVerifyYourAccount", fallback: "Tap the link we emailed to you to verify your account")
/// One last thing.
public static let title = L10n.tr("Localizable", "Scene.ConfirmEmail.Title", fallback: "One last thing.")
/// Tap the link we sent you to verify %@. We'll wait right here.
public static func tapTheLinkWeEmailedToYouToVerifyYourAccount(_ p1: Any) -> String {
return L10n.tr("Localizable", "Scene.ConfirmEmail.TapTheLinkWeEmailedToYouToVerifyYourAccount", String(describing: p1), fallback: "Tap the link we sent you to verify %@. We'll wait right here.")
}
/// Check Your Inbox
public static let title = L10n.tr("Localizable", "Scene.ConfirmEmail.Title", fallback: "Check Your Inbox")
public enum Button {
/// Open Email App
public static let openEmailApp = L10n.tr("Localizable", "Scene.ConfirmEmail.Button.OpenEmailApp", fallback: "Open Email App")

View File

@ -233,9 +233,8 @@ uploaded to Mastodon.";
"Scene.ConfirmEmail.OpenEmailApp.Mail" = "Mail";
"Scene.ConfirmEmail.OpenEmailApp.OpenEmailClient" = "Open Email Client";
"Scene.ConfirmEmail.OpenEmailApp.Title" = "Check your inbox.";
"Scene.ConfirmEmail.Subtitle" = "Tap the link we emailed to you to verify your account.";
"Scene.ConfirmEmail.TapTheLinkWeEmailedToYouToVerifyYourAccount" = "Tap the link we emailed to you to verify your account";
"Scene.ConfirmEmail.Title" = "One last thing.";
"Scene.ConfirmEmail.TapTheLinkWeEmailedToYouToVerifyYourAccount" = "Tap the link we sent you to verify %@. We'll wait right here.";
"Scene.ConfirmEmail.Title" = "Check Your Inbox";
"Scene.Discovery.Intro" = "These are the posts gaining traction in your corner of Mastodon.";
"Scene.Discovery.Tabs.Community" = "Community";
"Scene.Discovery.Tabs.ForYou" = "For You";

View File

@ -228,8 +228,8 @@ uploaded to Mastodon.";
"Scene.ConfirmEmail.OpenEmailApp.OpenEmailClient" = "Open Email Client";
"Scene.ConfirmEmail.OpenEmailApp.Title" = "Check your inbox.";
"Scene.ConfirmEmail.Subtitle" = "Tap the link we emailed to you to verify your account.";
"Scene.ConfirmEmail.TapTheLinkWeEmailedToYouToVerifyYourAccount" = "Tap the link we emailed to you to verify your account";
"Scene.ConfirmEmail.Title" = "One last thing.";
"Scene.ConfirmEmail.TapTheLinkWeEmailedToYouToVerifyYourAccount" = "Tap the link we sent you to verify %@. We'll wait right here.";
"Scene.ConfirmEmail.Title" = "Check Your Inbox";
"Scene.Discovery.Intro" = "These are the posts gaining traction in your corner of Mastodon.";
"Scene.Discovery.Tabs.Community" = "Community";
"Scene.Discovery.Tabs.ForYou" = "For You";