Update Strings

This commit is contained in:
Ivan Grachyov 2021-08-26 21:17:23 +03:00
parent 7ca27c2335
commit a07161aa9f
5 changed files with 13 additions and 11 deletions

View File

@ -161,8 +161,8 @@ class Agent: NSObject {
alert.messageText = "Quit Encrypted Ink?"
alert.informativeText = "You won't be able to sign requests."
alert.alertStyle = .warning
alert.addButton(withTitle: "OK")
alert.addButton(withTitle: "Cancel")
alert.addButton(withTitle: Strings.ok)
alert.addButton(withTitle: Strings.cancel)
if alert.runModal() == .alertFirstButtonReturn {
NSApp.terminate(nil)
}
@ -268,7 +268,7 @@ class Agent: NSObject {
}
if canDoLocalAuthentication {
context.localizedCancelTitle = "Cancel"
context.localizedCancelTitle = Strings.cancel
didStartInitialLAEvaluation = true
context.evaluatePolicy(.deviceOwnerAuthentication, localizedReason: reason.title) { [weak self] success, _ in
DispatchQueue.main.async {

View File

@ -162,8 +162,8 @@ class AccountsListViewController: NSViewController {
alert.messageText = "Back up new account."
alert.informativeText = "You will see 12 secret words."
alert.alertStyle = .critical
alert.addButton(withTitle: "OK")
alert.addButton(withTitle: "Cancel")
alert.addButton(withTitle: Strings.ok)
alert.addButton(withTitle: Strings.cancel)
if alert.runModal() == .alertFirstButtonReturn {
createNewAccountAndShowSecretWords()
}
@ -214,7 +214,7 @@ class AccountsListViewController: NSViewController {
alert.messageText = "Removed accounts can't be recovered."
alert.alertStyle = .critical
alert.addButton(withTitle: "Remove anyway")
alert.addButton(withTitle: "Cancel")
alert.addButton(withTitle: Strings.cancel)
if alert.runModal() == .alertFirstButtonReturn {
agent.askAuthentication(on: view.window, getBackTo: self, onStart: false, reason: .removeAccount) { [weak self] allowed in
Window.activateWindow(self?.view.window)
@ -234,7 +234,7 @@ class AccountsListViewController: NSViewController {
alert.messageText = "\(isMnemonic ? "Secret words give" : "Private key gives") full access to your funds."
alert.alertStyle = .critical
alert.addButton(withTitle: "I understand the risks")
alert.addButton(withTitle: "Cancel")
alert.addButton(withTitle: Strings.cancel)
if alert.runModal() == .alertFirstButtonReturn {
let reason: AuthenticationReason = isMnemonic ? .showSecretWords : .showPrivateKey
agent.askAuthentication(on: view.window, getBackTo: self, onStart: false, reason: reason) { [weak self] allowed in
@ -264,7 +264,7 @@ class AccountsListViewController: NSViewController {
alert.messageText = mnemonic ? "Secret words" : "Private key"
alert.informativeText = secret
alert.alertStyle = .informational
alert.addButton(withTitle: "OK")
alert.addButton(withTitle: Strings.ok)
alert.addButton(withTitle: "Copy")
if alert.runModal() != .alertFirstButtonReturn {
NSPasteboard.general.clearAndSetString(secret)

View File

@ -32,8 +32,8 @@ class ImportViewController: NSViewController {
let alert = Alert()
alert.messageText = "Enter keystore password."
alert.alertStyle = .informational
alert.addButton(withTitle: "OK")
alert.addButton(withTitle: "Cancel")
alert.addButton(withTitle: Strings.ok)
alert.addButton(withTitle: Strings.cancel)
let passwordTextField = NSSecureTextField(frame: NSRect(x: 0, y: 0, width: 160, height: 20))
passwordTextField.bezelStyle = .roundedBezel

View File

@ -8,5 +8,7 @@ struct Strings {
static let signMessage = "Sign Message"
static let signPersonalMessage = "Sign Personal Message"
static let signTypedData = "Sign Typed Data"
static let cancel = "Cancel"
static let ok = "OK"
}

View File

@ -20,7 +20,7 @@ class Alert: NSAlert {
let alert = Alert()
alert.messageText = message
alert.alertStyle = style
alert.addButton(withTitle: "OK")
alert.addButton(withTitle: Strings.ok)
_ = alert.runModal()
}