diff --git a/Source/Modules/ControllerModules/ctlInputMethod_Menu.swift b/Source/Modules/ControllerModules/ctlInputMethod_Menu.swift index d1bfd7cf..3c1727e1 100644 --- a/Source/Modules/ControllerModules/ctlInputMethod_Menu.swift +++ b/Source/Modules/ControllerModules/ctlInputMethod_Menu.swift @@ -143,6 +143,10 @@ extension ctlInputMethod { withTitle: NSLocalizedString("Optimize Memorized Phrases", comment: ""), action: #selector(removeUnigramsFromUOM(_:)), keyEquivalent: "" ) + menu.addItem( + withTitle: NSLocalizedString("Clear Memorized Phrases", comment: ""), + action: #selector(clearUOM(_:)), keyEquivalent: "" + ) menu.addItem(NSMenuItem.separator()) // --------------------- @@ -362,6 +366,13 @@ extension ctlInputMethod { } } + @objc func clearUOM(_: Any?) { + mgrLangModel.clearUserOverrideModelData(IME.getInputMode()) + if NSEvent.modifierFlags.contains(.option) { + mgrLangModel.clearUserOverrideModelData(IME.getInputMode(isReversed: true)) + } + } + @objc func showAbout(_: Any?) { (NSApp.delegate as? AppDelegate)?.showAbout() NSApp.activate(ignoringOtherApps: true) diff --git a/Source/Resources/Base.lproj/Localizable.strings b/Source/Resources/Base.lproj/Localizable.strings index c4faf713..e8ca421a 100644 --- a/Source/Resources/Base.lproj/Localizable.strings +++ b/Source/Resources/Base.lproj/Localizable.strings @@ -63,6 +63,7 @@ "Loading CHT Core Dict..." = "Loading CHT Core Dict..."; "Core Dict loading complete." = "Core Dict loading complete."; "Optimize Memorized Phrases" = "Optimize Memorized Phrases"; +"Clear Memorized Phrases" = "Clear Memorized Phrases"; // The followings are the category names used in the Symbol menu. "catCommonSymbols" = "CommonSymbols"; diff --git a/Source/Resources/en.lproj/Localizable.strings b/Source/Resources/en.lproj/Localizable.strings index c4faf713..e8ca421a 100644 --- a/Source/Resources/en.lproj/Localizable.strings +++ b/Source/Resources/en.lproj/Localizable.strings @@ -63,6 +63,7 @@ "Loading CHT Core Dict..." = "Loading CHT Core Dict..."; "Core Dict loading complete." = "Core Dict loading complete."; "Optimize Memorized Phrases" = "Optimize Memorized Phrases"; +"Clear Memorized Phrases" = "Clear Memorized Phrases"; // The followings are the category names used in the Symbol menu. "catCommonSymbols" = "CommonSymbols"; diff --git a/Source/Resources/ja.lproj/Localizable.strings b/Source/Resources/ja.lproj/Localizable.strings index 79a8751b..60618e9b 100644 --- a/Source/Resources/ja.lproj/Localizable.strings +++ b/Source/Resources/ja.lproj/Localizable.strings @@ -63,6 +63,7 @@ "Loading CHT Core Dict..." = "繁体中国語核心辞書読込中…"; "Core Dict loading complete." = "核心辞書読込完了"; "Optimize Memorized Phrases" = "臨時記憶資料を整う"; +"Clear Memorized Phrases" = "臨時記憶資料を削除"; // The followings are the category names used in the Symbol menu. "catCommonSymbols" = "常用"; diff --git a/Source/Resources/zh-Hans.lproj/Localizable.strings b/Source/Resources/zh-Hans.lproj/Localizable.strings index 8cb3ee1f..a5ccdf70 100644 --- a/Source/Resources/zh-Hans.lproj/Localizable.strings +++ b/Source/Resources/zh-Hans.lproj/Localizable.strings @@ -63,6 +63,7 @@ "Loading CHT Core Dict..." = "载入繁体中文核心辞典…"; "Core Dict loading complete." = "核心辞典载入完毕"; "Optimize Memorized Phrases" = "精简临时记忆语汇资料"; +"Clear Memorized Phrases" = "清除临时记忆语汇资料"; // The followings are the category names used in the Symbol menu. "catCommonSymbols" = "常用"; diff --git a/Source/Resources/zh-Hant.lproj/Localizable.strings b/Source/Resources/zh-Hant.lproj/Localizable.strings index 2f13703c..733e49fa 100644 --- a/Source/Resources/zh-Hant.lproj/Localizable.strings +++ b/Source/Resources/zh-Hant.lproj/Localizable.strings @@ -63,6 +63,7 @@ "Loading CHT Core Dict..." = "載入繁體中文核心辭典…"; "Core Dict loading complete." = "核心辭典載入完畢"; "Optimize Memorized Phrases" = "精簡臨時記憶語彙資料"; +"Clear Memorized Phrases" = "清除臨時記憶語彙資料"; // The followings are the category names used in the Symbol menu. "catCommonSymbols" = "常用";