From 167fe5cff5448818e35703e0e4339f619402804c Mon Sep 17 00:00:00 2001 From: Sharker <1548742234@qq.com> Date: Fri, 9 Feb 2024 00:20:38 +0800 Subject: [PATCH] fix: fix review issues and remvoe unused localizable --- Easydict/App/Localizable.xcstrings | 20 ------------------- .../Tabs/View/Shortcut/KeyHolderWrapper.swift | 12 +++++++---- 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/Easydict/App/Localizable.xcstrings b/Easydict/App/Localizable.xcstrings index fe1356419..db79188c4 100644 --- a/Easydict/App/Localizable.xcstrings +++ b/Easydict/App/Localizable.xcstrings @@ -3648,16 +3648,6 @@ } } }, - "shortcut_confict_message (Shortcut.shared.confictMenuItem?.title ?? \"\")" : { - "localizations" : { - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "" - } - } - } - }, "shortcut_confict_message %@" : { "extractionState" : "manual", "localizations" : { @@ -3675,16 +3665,6 @@ } } }, - "shortcut_confict_title (keyCombo!.keyEquivalentModifierMaskString + keyCombo!.characters)" : { - "localizations" : { - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "" - } - } - } - }, "shortcut_confict_title %@" : { "extractionState" : "manual", "localizations" : { diff --git a/Easydict/NewApp/View/SettingView/Tabs/View/Shortcut/KeyHolderWrapper.swift b/Easydict/NewApp/View/SettingView/Tabs/View/Shortcut/KeyHolderWrapper.swift index 097541b2b..b366864cc 100644 --- a/Easydict/NewApp/View/SettingView/Tabs/View/Shortcut/KeyHolderWrapper.swift +++ b/Easydict/NewApp/View/SettingView/Tabs/View/Shortcut/KeyHolderWrapper.swift @@ -66,16 +66,20 @@ extension KeyHolderWrapper { func recordViewDidEndRecording(_: RecordView) {} func recordView(_ recordView: RecordView, didChangeKeyCombo keyCombo: KeyCombo?) { - if keyCombo == nil { // clear shortcut - Shortcut.shared.updateMenu(type) - } if let key = keyCombo { // shortcut validate confict if Shortcut.validateShortcut(key) { - confictAlterMessage = ShortcutConfictAlertMessage(title: String(localized: "shortcut_confict_title \(keyCombo!.keyEquivalentModifierMaskString + keyCombo!.characters)"), message: String(localized: "shortcut_confict_message \(Shortcut.shared.confictMenuItem?.title ?? "")")) + let title = String(localized: "shortcut_confict_title \(key.keyEquivalentModifierMaskString + key.characters)") + let message = String(localized: "shortcut_confict_message \(Shortcut.shared.confictMenuItem?.title ?? "")") + confictAlterMessage = ShortcutConfictAlertMessage( + title: title, + message: message + ) recordView.clear() return } + } else { // clear shortcut + Shortcut.shared.updateMenu(type) } storeKeyCombo(with: keyCombo) Shortcut.shared.bindingShortcut(keyCombo: keyCombo, type: type)