I have code to check for insertion only from digits.
How can I translate ": can not be pasted" using Localizable.strings?
let pastAction = UIAlertAction(title: NSLocalizedString("Past",comment: ""), style: .default, handler: {
(alert: UIAlertAction!) -> Void in
if UIPasteboard.general.string?.onlyNumbers() == "" {
let alertController = UIAlertController(title: "Calc Pro", message: "\(UIPasteboard.general.string ?? ""): cannot be pasted", preferredStyle: .alert)
alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))
self.present(alertController, animated: false, completion: nil)
alertController.view.tintColor = UIColor(colorLiteralRed: 235/255, green: 92/255, blue: 48/255, alpha: 1)
print("Cannot be pasted")
} else {
self.displayResultLabel.text = UIPasteboard.general.string
print("Pasted")
}
})