Skip to content

Commit

Permalink
fix: fix review issues and remvoe unused localizable
Browse files Browse the repository at this point in the history
  • Loading branch information
AkaShark committed Feb 8, 2024
1 parent 452a30a commit 167fe5c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 24 deletions.
20 changes: 0 additions & 20 deletions Easydict/App/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -3648,16 +3648,6 @@
}
}
},
"shortcut_confict_message (Shortcut.shared.confictMenuItem?.title ?? \"\")" : {
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : ""
}
}
}
},
"shortcut_confict_message %@" : {
"extractionState" : "manual",
"localizations" : {
Expand All @@ -3675,16 +3665,6 @@
}
}
},
"shortcut_confict_title (keyCombo!.keyEquivalentModifierMaskString + keyCombo!.characters)" : {
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : ""
}
}
}
},
"shortcut_confict_title %@" : {
"extractionState" : "manual",
"localizations" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 167fe5c

Please sign in to comment.