diff --git a/Source/Modules/ControllerModules/ctlInputMethod_Menu.swift b/Source/Modules/ControllerModules/ctlInputMethod_Menu.swift index e12562b7..d1bfd7cf 100644 --- a/Source/Modules/ControllerModules/ctlInputMethod_Menu.swift +++ b/Source/Modules/ControllerModules/ctlInputMethod_Menu.swift @@ -139,6 +139,11 @@ extension ctlInputMethod { ) } + menu.addItem( + withTitle: NSLocalizedString("Optimize Memorized Phrases", comment: ""), + action: #selector(removeUnigramsFromUOM(_:)), keyEquivalent: "" + ) + menu.addItem(NSMenuItem.separator()) // --------------------- if optionKeyPressed { @@ -350,6 +355,13 @@ extension ctlInputMethod { IME.initLangModels(userOnly: true) } + @objc func removeUnigramsFromUOM(_: Any?) { + mgrLangModel.removeUnigramsFromUserOverrideModel(IME.getInputMode()) + if NSEvent.modifierFlags.contains(.option) { + mgrLangModel.removeUnigramsFromUserOverrideModel(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 02bb0993..a3575430 100644 --- a/Source/Resources/Base.lproj/Localizable.strings +++ b/Source/Resources/Base.lproj/Localizable.strings @@ -62,6 +62,7 @@ "Loading CHS Core Dict..." = "Loading CHS Core Dict..."; "Loading CHT Core Dict..." = "Loading CHT Core Dict..."; "Core Dict loading complete." = "Core Dict loading complete."; +"Optimize Memorized Phrases" = "Optimize 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 02bb0993..a3575430 100644 --- a/Source/Resources/en.lproj/Localizable.strings +++ b/Source/Resources/en.lproj/Localizable.strings @@ -62,6 +62,7 @@ "Loading CHS Core Dict..." = "Loading CHS Core Dict..."; "Loading CHT Core Dict..." = "Loading CHT Core Dict..."; "Core Dict loading complete." = "Core Dict loading complete."; +"Optimize Memorized Phrases" = "Optimize 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 3f204d09..e059c5d0 100644 --- a/Source/Resources/ja.lproj/Localizable.strings +++ b/Source/Resources/ja.lproj/Localizable.strings @@ -62,6 +62,7 @@ "Loading CHS Core Dict..." = "簡体中国語核心辞書読込中…"; "Loading CHT Core Dict..." = "繁体中国語核心辞書読込中…"; "Core Dict loading complete." = "核心辞書読込完了"; +"Optimize 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 125d7d85..c26119fe 100644 --- a/Source/Resources/zh-Hans.lproj/Localizable.strings +++ b/Source/Resources/zh-Hans.lproj/Localizable.strings @@ -62,6 +62,7 @@ "Loading CHS Core Dict..." = "载入简体中文核心辞典…"; "Loading CHT Core Dict..." = "载入繁体中文核心辞典…"; "Core Dict loading complete." = "核心辞典载入完毕"; +"Optimize 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 c15a77f3..f7bd537a 100644 --- a/Source/Resources/zh-Hant.lproj/Localizable.strings +++ b/Source/Resources/zh-Hant.lproj/Localizable.strings @@ -62,6 +62,7 @@ "Loading CHS Core Dict..." = "載入簡體中文核心辭典…"; "Loading CHT Core Dict..." = "載入繁體中文核心辭典…"; "Core Dict loading complete." = "核心辭典載入完畢"; +"Optimize Memorized Phrases" = "精簡臨時記憶語彙資料"; // The followings are the category names used in the Symbol menu. "catCommonSymbols" = "常用";