Wraps Alert strings in `NSLocalizedString`

Also removes `tel` scheme handling.
This commit is contained in:
Stuart Breckenridge 2020-05-04 13:24:35 +08:00
parent e825a5d516
commit f58ac4d160
No known key found for this signature in database
GPG Key ID: 977FF9C8CE7AB207
2 changed files with 2 additions and 6 deletions

View File

@ -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
}
}

View File

@ -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" {