From f58ac4d1608b785d489bc0dad9cc272c489a7497 Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Mon, 4 May 2020 13:24:35 +0800 Subject: [PATCH] Wraps Alert strings in `NSLocalizedString` Also removes `tel` scheme handling. --- Shared/Extensions/URL-Extensions.swift | 4 ---- iOS/Article/WebViewController.swift | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Shared/Extensions/URL-Extensions.swift b/Shared/Extensions/URL-Extensions.swift index 1cac0dc6a..4fb9b8d7f 100644 --- a/Shared/Extensions/URL-Extensions.swift +++ b/Shared/Extensions/URL-Extensions.swift @@ -15,8 +15,4 @@ extension URL { scheme == "mailto" ? URLComponents(url: self, resolvingAgainstBaseURL: false)?.path : nil } - /// Extracts telephone number from a `URL` with a `tel` scheme, otherwise `nil`. - var telNumber: String? { - scheme == "tel" ? URLComponents(url: self, resolvingAgainstBaseURL: false)?.path : nil - } } diff --git a/iOS/Article/WebViewController.swift b/iOS/Article/WebViewController.swift index c25d4b29b..9e6d62555 100644 --- a/iOS/Article/WebViewController.swift +++ b/iOS/Article/WebViewController.swift @@ -324,8 +324,8 @@ extension WebViewController: WKNavigationDelegate { mailComposeViewController.mailComposeDelegate = self self.present(mailComposeViewController, animated: true, completion: {}) } else { - let alert = UIAlertController(title: "Error", message: "This device cannot send emails.", preferredStyle: .alert) - alert.addAction(.init(title: "Dismiss", style: .cancel, handler: nil)) + let alert = UIAlertController(title: NSLocalizedString("Error", comment: "Error"), message: NSLocalizedString("This device cannot send emails.", comment: "This device cannot send emails."), preferredStyle: .alert) + alert.addAction(.init(title: NSLocalizedString("Dismiss", comment: "Dismiss"), style: .cancel, handler: nil)) self.present(alert, animated: true, completion: nil) } } else if components?.scheme == "tel" {