macOS: Localize export sheets

Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
Roopesh Chander 2019-01-09 02:33:22 +05:30
parent f5059ce55b
commit c9ee549a2e
2 changed files with 10 additions and 4 deletions

View File

@ -245,6 +245,12 @@
"macButtonImportTunnels" = "Import tunnel(s) from file";
"macSheetButtonImport" = "Import";
"macNameFieldExportLog" = "Export log to";
"macSheetButtonExportLog" = "Save";
"macNameFieldExportZip" = "Export tunnels to";
"macSheetButtonExportZip" = "Save";
// Mac detail/edit view fields
"macFieldKey (%@)" = "%@:";

View File

@ -165,8 +165,8 @@ class TunnelsListTableViewController: NSViewController {
@objc func exportLogClicked() {
guard let window = view.window else { return }
let savePanel = NSSavePanel()
savePanel.prompt = "Save"
savePanel.nameFieldLabel = "Export log to"
savePanel.prompt = tr("macSheetButtonExportLog")
savePanel.nameFieldLabel = tr("macNameFieldExportLog")
let dateFormatter = ISO8601DateFormatter()
dateFormatter.formatOptions = [.withFullDate, .withTime, .withTimeZone] // Avoid ':' in the filename
@ -199,8 +199,8 @@ class TunnelsListTableViewController: NSViewController {
guard let window = view.window else { return }
let savePanel = NSSavePanel()
savePanel.allowedFileTypes = ["zip"]
savePanel.prompt = "Save"
savePanel.nameFieldLabel = "Export tunnels to"
savePanel.prompt = tr("macSheetButtonExportZip")
savePanel.nameFieldLabel = tr("macNameFieldExportZip")
savePanel.nameFieldStringValue = "wireguard-export.zip"
savePanel.beginSheetModal(for: window) { [weak tunnelsManager] response in
guard let tunnelsManager = tunnelsManager else { return }