Localize strings in code

This commit is contained in:
Danny Moesch 2019-01-14 20:57:45 +01:00 committed by Mingshen Sun
parent 2d5ca58bd9
commit 1b4040135e
36 changed files with 626 additions and 334 deletions

View file

@ -23,7 +23,7 @@ class SSHKeySettingTableViewController: UITableViewController {
@IBAction func doneButtonTapped(_ sender: UIButton) {
guard let privateKeyURL = URL(string: privateKeyURLTextField.text!.trimmed) else {
Utils.alert(title: "Cannot Save", message: "Please set Private Key URL first.", controller: self, completion: nil)
Utils.alert(title: "CannotSave".localize(), message: "SetPrivateKeyUrl.".localize(), controller: self, completion: nil)
return
}
@ -32,7 +32,7 @@ class SSHKeySettingTableViewController: UITableViewController {
do {
try Data(contentsOf: privateKeyURL).write(to: URL(fileURLWithPath: Globals.gitSSHPrivateKeyPath), options: .atomic)
} catch {
Utils.alert(title: "Error", message: error.localizedDescription, controller: self, completion: nil)
Utils.alert(title: "Error".localize(), message: error.localizedDescription, controller: self, completion: nil)
}
SharedDefaults[.gitSSHKeySource] = "url"
self.navigationController!.popViewController(animated: true)