diff --git a/resources/l10n/Localizable.strings b/resources/l10n/Localizable.strings index cc0858c1..412c8c82 100644 --- a/resources/l10n/Localizable.strings +++ b/resources/l10n/Localizable.strings @@ -31,6 +31,9 @@ /* No comment provided by engineer. */ "Appearance" = "Appearance"; +/* No comment provided by engineer. */ +"Are you sure you don’t want a response?" = "Are you sure you don’t want a response?"; + /* No comment provided by engineer. */ "Arrow keys" = "Arrow keys"; @@ -59,7 +62,7 @@ "Close window" = "Close window"; /* No comment provided by engineer. */ -"Don't check for updates periodically" = "Don't check for updates periodically"; +"Don’t check for updates periodically" = "Don’t check for updates periodically"; /* No comment provided by engineer. */ "General" = "General"; @@ -139,6 +142,9 @@ /* No comment provided by engineer. */ "Send" = "Send"; +/* No comment provided by engineer. */ +"Send anyway" = "Send anyway"; + /* No comment provided by engineer. */ "Send debug profile (CPU, memory, etc)" = "Send debug profile (CPU, memory, etc)"; @@ -190,6 +196,9 @@ /* No comment provided by engineer. */ "Window title font size:" = "Window title font size:"; +/* No comment provided by engineer. */ +"You didn’t write your email, thus can’t receive any response." = "You didn’t write your email, thus can’t receive any response."; + /* No comment provided by engineer. */ "❖ Windows 10" = "❖ Windows 10"; diff --git a/resources/l10n/de.lproj/Localizable.strings b/resources/l10n/de.lproj/Localizable.strings index 0e83251b..6668387b 100644 --- a/resources/l10n/de.lproj/Localizable.strings +++ b/resources/l10n/de.lproj/Localizable.strings @@ -63,7 +63,7 @@ "Close window" = "Fenster schließen"; /*No comment provided by engineer.*/ -"Don't check for updates periodically" = "Nicht regelmäßig nach Updates suchen"; +"Don’t check for updates periodically" = "Nicht regelmäßig nach Updates suchen"; /*No comment provided by engineer.*/ "General" = "Allgemein"; diff --git a/resources/l10n/en.lproj/Localizable.strings b/resources/l10n/en.lproj/Localizable.strings index c72648d4..2b561e79 100644 --- a/resources/l10n/en.lproj/Localizable.strings +++ b/resources/l10n/en.lproj/Localizable.strings @@ -63,7 +63,7 @@ "Close window" = "Close window"; /*No comment provided by engineer.*/ -"Don't check for updates periodically" = "Don’t check for updates periodically"; +"Don’t check for updates periodically" = "Don’t check for updates periodically"; /*No comment provided by engineer.*/ "General" = "General"; diff --git a/resources/l10n/es.lproj/Localizable.strings b/resources/l10n/es.lproj/Localizable.strings index 33be3ef1..4e1f82bc 100644 --- a/resources/l10n/es.lproj/Localizable.strings +++ b/resources/l10n/es.lproj/Localizable.strings @@ -63,7 +63,7 @@ "Close window" = "Cerrar ventana"; /*No comment provided by engineer.*/ -"Don't check for updates periodically" = "No comprobar actualizaciones periódicamente"; +"Don’t check for updates periodically" = "No comprobar actualizaciones periódicamente"; /*No comment provided by engineer.*/ "General" = "General"; diff --git a/resources/l10n/fi.lproj/Localizable.strings b/resources/l10n/fi.lproj/Localizable.strings index 29338a84..add8b600 100644 --- a/resources/l10n/fi.lproj/Localizable.strings +++ b/resources/l10n/fi.lproj/Localizable.strings @@ -63,7 +63,7 @@ "Close window" = "Sulje ikkuna"; /*No comment provided by engineer.*/ -"Don't check for updates periodically" = "Älä tarkista päivityksiä"; +"Don’t check for updates periodically" = "Älä tarkista päivityksiä"; /*No comment provided by engineer.*/ "General" = "Yleinen"; diff --git a/resources/l10n/fr.lproj/Localizable.strings b/resources/l10n/fr.lproj/Localizable.strings index 36b371e6..0d74120c 100644 --- a/resources/l10n/fr.lproj/Localizable.strings +++ b/resources/l10n/fr.lproj/Localizable.strings @@ -63,7 +63,7 @@ "Close window" = "Fermer la fenêtre"; /*No comment provided by engineer.*/ -"Don't check for updates periodically" = "Ne pas chercher de mise-à-jour périodiquement"; +"Don’t check for updates periodically" = "Ne pas chercher de mise-à-jour périodiquement"; /*No comment provided by engineer.*/ "General" = "Général"; diff --git a/resources/l10n/hu.lproj/Localizable.strings b/resources/l10n/hu.lproj/Localizable.strings index 122c3435..5f12b991 100644 --- a/resources/l10n/hu.lproj/Localizable.strings +++ b/resources/l10n/hu.lproj/Localizable.strings @@ -63,7 +63,7 @@ "Close window" = "Ablak bezárása"; /*No comment provided by engineer.*/ -"Don't check for updates periodically" = "Ne keressen frissítéseket automatikusan"; +"Don’t check for updates periodically" = "Ne keressen frissítéseket automatikusan"; /*No comment provided by engineer.*/ "General" = "Általános"; diff --git a/resources/l10n/it.lproj/Localizable.strings b/resources/l10n/it.lproj/Localizable.strings index 0cc5a03b..20008fd6 100644 --- a/resources/l10n/it.lproj/Localizable.strings +++ b/resources/l10n/it.lproj/Localizable.strings @@ -63,7 +63,7 @@ "Close window" = "Chiudi la finestra"; /*No comment provided by engineer.*/ -"Don't check for updates periodically" = "Non controllare gli aggiornamenti periodicamente"; +"Don’t check for updates periodically" = "Non controllare gli aggiornamenti periodicamente"; /*No comment provided by engineer.*/ "General" = "Generale"; diff --git a/resources/l10n/ja.lproj/Localizable.strings b/resources/l10n/ja.lproj/Localizable.strings index da2492c1..caba21fc 100644 --- a/resources/l10n/ja.lproj/Localizable.strings +++ b/resources/l10n/ja.lproj/Localizable.strings @@ -63,7 +63,7 @@ "Close window" = "ウィンドウを閉じる"; /*No comment provided by engineer.*/ -"Don't check for updates periodically" = "定期的に更新を確認しない"; +"Don’t check for updates periodically" = "定期的に更新を確認しない"; /*No comment provided by engineer.*/ "General" = "一般設定"; diff --git a/resources/l10n/ko.lproj/Localizable.strings b/resources/l10n/ko.lproj/Localizable.strings index 4381a756..e28ea364 100644 --- a/resources/l10n/ko.lproj/Localizable.strings +++ b/resources/l10n/ko.lproj/Localizable.strings @@ -63,7 +63,7 @@ "Close window" = "창 닫기"; /*No comment provided by engineer.*/ -"Don't check for updates periodically" = "주기적으로 업데이트를 확인하지 않기"; +"Don’t check for updates periodically" = "주기적으로 업데이트를 확인하지 않기"; /*No comment provided by engineer.*/ "General" = "일반"; diff --git a/resources/l10n/pt-BR.lproj/Localizable.strings b/resources/l10n/pt-BR.lproj/Localizable.strings index ba59740a..50d4bc08 100644 --- a/resources/l10n/pt-BR.lproj/Localizable.strings +++ b/resources/l10n/pt-BR.lproj/Localizable.strings @@ -63,7 +63,7 @@ "Close window" = "Fechar janela"; /*No comment provided by engineer.*/ -"Don't check for updates periodically" = "Não verifique periodicamente por atualizações"; +"Don’t check for updates periodically" = "Não verifique periodicamente por atualizações"; /*No comment provided by engineer.*/ "General" = "Geral"; diff --git a/resources/l10n/tr.lproj/Localizable.strings b/resources/l10n/tr.lproj/Localizable.strings index 4c57a69f..1d38fd42 100644 --- a/resources/l10n/tr.lproj/Localizable.strings +++ b/resources/l10n/tr.lproj/Localizable.strings @@ -63,7 +63,7 @@ "Close window" = "Pencereyi kapat"; /*No comment provided by engineer.*/ -"Don't check for updates periodically" = "Güncellemeleri periyodik olarak kontrol etme"; +"Don’t check for updates periodically" = "Güncellemeleri periyodik olarak kontrol etme"; /*No comment provided by engineer.*/ "General" = "Genel"; diff --git a/resources/l10n/zh-CN.lproj/Localizable.strings b/resources/l10n/zh-CN.lproj/Localizable.strings index 03f5c059..8dc4b570 100644 --- a/resources/l10n/zh-CN.lproj/Localizable.strings +++ b/resources/l10n/zh-CN.lproj/Localizable.strings @@ -63,7 +63,7 @@ "Close window" = "关闭窗口"; /*No comment provided by engineer.*/ -"Don't check for updates periodically" = "不要自动检查更新"; +"Don’t check for updates periodically" = "不要自动检查更新"; /*No comment provided by engineer.*/ "General" = "通用"; diff --git a/resources/l10n/zh-TW.lproj/Localizable.strings b/resources/l10n/zh-TW.lproj/Localizable.strings index 01c2e981..be10ba1c 100644 --- a/resources/l10n/zh-TW.lproj/Localizable.strings +++ b/resources/l10n/zh-TW.lproj/Localizable.strings @@ -63,7 +63,7 @@ "Close window" = "關閉視窗"; /*No comment provided by engineer.*/ -"Don't check for updates periodically" = "不要定期自動檢查更新"; +"Don’t check for updates periodically" = "不要定期自動檢查更新"; /*No comment provided by engineer.*/ "General" = "一般"; diff --git a/src/ui/FeedbackWindow.swift b/src/ui/FeedbackWindow.swift index 3ce26caa..8c18b84c 100644 --- a/src/ui/FeedbackWindow.swift +++ b/src/ui/FeedbackWindow.swift @@ -63,13 +63,18 @@ class FeedbackWindow: NSWindow { contentView = view } - @objc - private func cancelCallback() { + @objc private func cancelCallback() { close() } - @objc - private func sendCallback() { + @objc private func sendCallback() { + if email.stringValue.isEmpty && !warnAboutNoEmail() { + return + } + openTicket() + } + + func openTicket() { URLSession.shared.dataTask(with: prepareRequest(), completionHandler: { data, response, error in if error != nil || response == nil || (response as! HTTPURLResponse).statusCode != 201 { debugPrint("HTTP call failed:", response ?? "nil", error ?? "nil") @@ -78,6 +83,16 @@ class FeedbackWindow: NSWindow { close() } + func warnAboutNoEmail() -> Bool { + let alert = NSAlert() + alert.alertStyle = .warning + alert.messageText = NSLocalizedString("Are you sure you don’t want a response?", comment: "") + alert.informativeText = NSLocalizedString("You didn’t write your email, thus can’t receive any response.", comment: "") + alert.addButton(withTitle: NSLocalizedString("Send anyway", comment: "")) + alert.addButton(withTitle: NSLocalizedString("Cancel", comment: "")) + return alert.runModal() == NSApplication.ModalResponse.alertFirstButtonReturn + } + private func prepareRequest() -> URLRequest { var request = URLRequest(url: URL(string: "https://api.github.com/repos/lwouis/alt-tab-macos/issues")!) request.httpMethod = "POST" diff --git a/src/ui/preferences-window/tabs/UpdatesTab.swift b/src/ui/preferences-window/tabs/UpdatesTab.swift index 0e4db45d..265456a6 100644 --- a/src/ui/preferences-window/tabs/UpdatesTab.swift +++ b/src/ui/preferences-window/tabs/UpdatesTab.swift @@ -14,7 +14,7 @@ class UpdatesTab: NSViewController, PreferencePane { var policyLock = false override func loadView() { - dontPeriodicallyCheck = NSButton(radioButtonWithTitle: NSLocalizedString("Don't check for updates periodically", comment: ""), target: self, action: #selector(updatePolicyCallback)) + dontPeriodicallyCheck = NSButton(radioButtonWithTitle: NSLocalizedString("Don’t check for updates periodically", comment: ""), target: self, action: #selector(updatePolicyCallback)) dontPeriodicallyCheck.fit() periodicallyCheck = NSButton(radioButtonWithTitle: NSLocalizedString("Check for updates periodically", comment: ""), target: self, action: #selector(updatePolicyCallback)) periodicallyCheck.fit()