ctlIME // Add currency numeral output menu item.

This commit is contained in:
ShikiSuen 2022-07-26 19:04:24 +08:00
parent d5da36147f
commit bd343df4f2
6 changed files with 23 additions and 0 deletions

View File

@ -79,6 +79,13 @@ extension ctlInputMethod {
shiftJISConversionItem.state = mgrPrefs.shiftJISShinjitaiOutputEnabled.state
}
let currencyNumeralsItem = menu.addItem(
withTitle: NSLocalizedString("Currency Numeral Output", comment: ""),
action: #selector(toggleCurrencyNumerals(_:)), keyEquivalent: mgrPrefs.usingHotKeyCurrencyNumerals ? "M" : ""
)
currencyNumeralsItem.keyEquivalentModifierMask = [.command, .control]
currencyNumeralsItem.state = mgrPrefs.currencyNumeralsEnabled.state
let halfWidthPunctuationItem = menu.addItem(
withTitle: NSLocalizedString("Half-Width Punctuation Mode", comment: ""),
action: #selector(toggleHalfWidthPunctuation(_:)), keyEquivalent: mgrPrefs.usingHotKeyHalfWidthASCII ? "H" : ""
@ -245,6 +252,17 @@ extension ctlInputMethod {
))
}
@objc func toggleCurrencyNumerals(_: Any?) {
resetKeyHandler()
NotifierController.notify(
message: String(
format: "%@%@%@", NSLocalizedString("Currency Numeral Output", comment: ""), "\n",
mgrPrefs.toggleCurrencyNumeralsEnabled()
? NSLocalizedString("NotificationSwitchON", comment: "")
: NSLocalizedString("NotificationSwitchOFF", comment: "")
))
}
@objc func toggleHalfWidthPunctuation(_: Any?) {
resetKeyHandler()
NotifierController.notify(

View File

@ -64,6 +64,7 @@
"Core Dict loading complete." = "Core Dict loading complete.";
"Optimize Memorized Phrases" = "Optimize Memorized Phrases";
"Clear Memorized Phrases" = "Clear Memorized Phrases";
"Currency Numeral Output" = "Currency Numeral Output";
// The followings are the category names used in the Symbol menu.
"catCommonSymbols" = "CommonSymbols";

View File

@ -64,6 +64,7 @@
"Core Dict loading complete." = "Core Dict loading complete.";
"Optimize Memorized Phrases" = "Optimize Memorized Phrases";
"Clear Memorized Phrases" = "Clear Memorized Phrases";
"Currency Numeral Output" = "Currency Numeral Output";
// The followings are the category names used in the Symbol menu.
"catCommonSymbols" = "CommonSymbols";

View File

@ -64,6 +64,7 @@
"Core Dict loading complete." = "核心辞書読込完了";
"Optimize Memorized Phrases" = "臨時記憶資料を整う";
"Clear Memorized Phrases" = "臨時記憶資料を削除";
"Currency Numeral Output" = "数字大字変換";
// The followings are the category names used in the Symbol menu.
"catCommonSymbols" = "常用";

View File

@ -64,6 +64,7 @@
"Core Dict loading complete." = "核心辞典载入完毕";
"Optimize Memorized Phrases" = "精简临时记忆语汇资料";
"Clear Memorized Phrases" = "清除临时记忆语汇资料";
"Currency Numeral Output" = "大写汉字数字输出";
// The followings are the category names used in the Symbol menu.
"catCommonSymbols" = "常用";

View File

@ -64,6 +64,7 @@
"Core Dict loading complete." = "核心辭典載入完畢";
"Optimize Memorized Phrases" = "精簡臨時記憶語彙資料";
"Clear Memorized Phrases" = "清除臨時記憶語彙資料";
"Currency Numeral Output" = "大寫漢字數字輸出";
// The followings are the category names used in the Symbol menu.
"catCommonSymbols" = "常用";