Ich habe Code, um nur von Ziffern zur Einfügung zu überprüfen.Application Localization (IOS)
Wie kann ich übersetzen ": kann nicht eingefügt werden" mit 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")
}
})
Scan [diese Suchergebnissen] (https://stackoverflow.com/search?q=%5Bswift%5D+NSLocalizedString+variable) für weitere Lösungen. – rmaddy