Shiki: NT351 Emu // Add Keyboard Shortcut + l10n tweaks.

This commit is contained in:
ShikiSuen 2022-01-19 19:49:14 +08:00
parent 57ecd7b5c3
commit e8f895a642
11 changed files with 29 additions and 11 deletions

View File

@ -240,7 +240,7 @@
</button> </button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="mzw-F2-aAQ"> <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="mzw-F2-aAQ">
<rect key="frame" x="19" y="61.5" width="423" height="16"/> <rect key="frame" x="19" y="61.5" width="423" height="16"/>
<buttonCell key="cell" type="check" title="Emulating Windows NT 3.51 legacy phonetic typing experience" bezelStyle="regularSquare" imagePosition="left" controlSize="small" inset="2" id="ArK-Vk-OoT"> <buttonCell key="cell" type="check" title="Emulating Windows NT 3.51 select-candidate-per-character mode" bezelStyle="regularSquare" imagePosition="left" controlSize="small" inset="2" id="ArK-Vk-OoT">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/> <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="cellTitle"/> <font key="font" metaFont="cellTitle"/>
</buttonCell> </buttonCell>

View File

@ -136,11 +136,13 @@ static double FindHighestScore(const vector<NodeAnchor>& nodes, double epsilon)
// a menu instance (autoreleased) is requested every time the user click on the input menu // a menu instance (autoreleased) is requested every time the user click on the input menu
NSMenu *menu = [[NSMenu alloc] initWithTitle:LocalizationNotNeeded(@"Input Method Menu")]; NSMenu *menu = [[NSMenu alloc] initWithTitle:LocalizationNotNeeded(@"Input Method Menu")];
[menu addItemWithTitle:NSLocalizedString(@"vChewing Preferences", @"") action:@selector(showPreferences:) keyEquivalent:@""]; NSMenuItem *useWinNT351BPMFMenuItem = [menu addItemWithTitle:NSLocalizedString(@"NT351 BPMF EMU", @"") action:@selector(toggleWinNT351BPMFMode:) keyEquivalent:@"P"];
useWinNT351BPMFMenuItem.keyEquivalentModifierMask = NSEventModifierFlagCommand | NSEventModifierFlagControl;
useWinNT351BPMFMenuItem.state = Preferences.useWinNT351BPMF ? NSControlStateValueOn : NSControlStateValueOff;
NSMenuItem *chineseConversionMenuItem = [menu addItemWithTitle:NSLocalizedString(@"Force KangXi Writing", @"") action:@selector(toggleChineseConverter:) keyEquivalent:@"K"]; NSMenuItem *chineseConversionMenuItem = [menu addItemWithTitle:NSLocalizedString(@"Force KangXi Writing", @"") action:@selector(toggleChineseConverter:) keyEquivalent:@"K"];
chineseConversionMenuItem.keyEquivalentModifierMask = NSEventModifierFlagCommand | NSEventModifierFlagControl; chineseConversionMenuItem.keyEquivalentModifierMask = NSEventModifierFlagCommand | NSEventModifierFlagControl;
chineseConversionMenuItem.state = Preferences.chineseConversionEnabled ? NSControlStateValueOn : NSControlStateValueOff; chineseConversionMenuItem.state = Preferences.chineseConversionEnabled ? NSControlStateValueOn : NSControlStateValueOff;
NSMenuItem *halfWidthPunctuationMenuItem = [menu addItemWithTitle:NSLocalizedString(@"Use Half-Width Punctuations", @"") action:@selector(toggleHalfWidthPunctuation:) keyEquivalent:@""]; NSMenuItem *halfWidthPunctuationMenuItem = [menu addItemWithTitle:NSLocalizedString(@"Use Half-Width Punctuations", @"") action:@selector(toggleHalfWidthPunctuation:) keyEquivalent:@""];
halfWidthPunctuationMenuItem.state = Preferences.halfWidthPunctuationEnabled ? NSControlStateValueOn : NSControlStateValueOff; halfWidthPunctuationMenuItem.state = Preferences.halfWidthPunctuationEnabled ? NSControlStateValueOn : NSControlStateValueOff;
@ -162,6 +164,7 @@ static double FindHighestScore(const vector<NodeAnchor>& nodes, double epsilon)
[menu addItem:[NSMenuItem separatorItem]]; // ------------------------------ [menu addItem:[NSMenuItem separatorItem]]; // ------------------------------
[menu addItemWithTitle:NSLocalizedString(@"vChewing Preferences", @"") action:@selector(showPreferences:) keyEquivalent:@""];
[menu addItemWithTitle:NSLocalizedString(@"Check for Updates…", @"") action:@selector(checkForUpdate:) keyEquivalent:@""]; [menu addItemWithTitle:NSLocalizedString(@"Check for Updates…", @"") action:@selector(checkForUpdate:) keyEquivalent:@""];
[menu addItemWithTitle:NSLocalizedString(@"About vChewing…", @"") action:@selector(showAbout:) keyEquivalent:@""]; [menu addItemWithTitle:NSLocalizedString(@"About vChewing…", @"") action:@selector(showAbout:) keyEquivalent:@""];
return menu; return menu;
@ -1487,6 +1490,11 @@ NS_INLINE size_t max(size_t a, size_t b) { return a > b ? a : b; }
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES]; [[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
} }
- (void)toggleWinNT351BPMFMode:(id)sender
{
[NotifierController notifyWithMessage:[NSString stringWithFormat:@"%@%@%@", NSLocalizedString(@"NT351 BPMF EMU", @""), @"\n", [Preferences toggleWinNT351BPMFEnabled] ? NSLocalizedString(@"NotificationSwitchON", @"") : NSLocalizedString(@"NotificationSwitchOFF", @"")] stay:NO];
}
- (void)toggleChineseConverter:(id)sender - (void)toggleChineseConverter:(id)sender
{ {
[NotifierController notifyWithMessage:[NSString stringWithFormat:@"%@%@%@", NSLocalizedString(@"Force KangXi Writing", @""), @"\n", [Preferences toggleChineseConversionEnabled] ? NSLocalizedString(@"NotificationSwitchON", @"") : NSLocalizedString(@"NotificationSwitchOFF", @"")] stay:NO]; [NotifierController notifyWithMessage:[NSString stringWithFormat:@"%@%@%@", NSLocalizedString(@"Force KangXi Writing", @""), @"\n", [Preferences toggleChineseConversionEnabled] ? NSLocalizedString(@"NotificationSwitchON", @"") : NSLocalizedString(@"NotificationSwitchOFF", @"")] stay:NO];

View File

@ -220,6 +220,12 @@ struct ComposingBufferSize {
@UserDefault(key: kUseWinNT351BPMF, defaultValue: false) @UserDefault(key: kUseWinNT351BPMF, defaultValue: false)
@objc static var useWinNT351BPMF: Bool @objc static var useWinNT351BPMF: Bool
@objc static func toggleWinNT351BPMFEnabled() -> Bool {
useWinNT351BPMF = !useWinNT351BPMF
UserDefaults.standard.set(useWinNT351BPMF, forKey: kUseWinNT351BPMF)
return useWinNT351BPMF
}
@UserDefault(key: kShouldNotFartInLieuOfBeep, defaultValue: true) @UserDefault(key: kShouldNotFartInLieuOfBeep, defaultValue: true)
@objc static var shouldNotFartInLieuOfBeep: Bool @objc static var shouldNotFartInLieuOfBeep: Bool

View File

@ -33,3 +33,4 @@
"Please specify at least 4 candidate keys." = "Please specify at least 4 candidate keys."; "Please specify at least 4 candidate keys." = "Please specify at least 4 candidate keys.";
"Maximum 15 candidate keys allowed." = "Maximum 15 candidate keys allowed."; "Maximum 15 candidate keys allowed." = "Maximum 15 candidate keys allowed.";
"⚠︎ Phrase replacement mode enabled, interfering user phrase entry." = "⚠︎ Phrase replacement mode enabled, interfering user phrase entry."; "⚠︎ Phrase replacement mode enabled, interfering user phrase entry." = "⚠︎ Phrase replacement mode enabled, interfering user phrase entry.";
"NT351 BPMF EMU" = "NT351 Per-Char Select Mode";

View File

@ -104,8 +104,8 @@
/* Class = "NSTextFieldCell"; title = "UI language setting:"; ObjectID = "9DS-Rc-TXq"; */ /* Class = "NSTextFieldCell"; title = "UI language setting:"; ObjectID = "9DS-Rc-TXq"; */
"9DS-Rc-TXq.title" = "UI language setting:"; "9DS-Rc-TXq.title" = "UI language setting:";
/* Class = "NSButtonCell"; title = "Emulating Windows NT 3.51 legacy phonetic typing experience"; ObjectID = "ArK-Vk-OoT"; */ /* Class = "NSButtonCell"; title = "Emulating Windows NT 3.51 select-candidate-per-character mode"; ObjectID = "ArK-Vk-OoT"; */
"ArK-Vk-OoT.title" = "Emulating Windows NT 3.51 legacy phonetic typing experience"; "ArK-Vk-OoT.title" = "Emulating Windows NT 3.51 select-candidate-per-character mode";
/* Class = "NSButtonCell"; title = "Auto-convert traditional Chinese glyphs to KangXi characters"; ObjectID = "BSK-bH-Gct"; */ /* Class = "NSButtonCell"; title = "Auto-convert traditional Chinese glyphs to KangXi characters"; ObjectID = "BSK-bH-Gct"; */
"BSK-bH-Gct.title" = "Auto-convert traditional Chinese glyphs to KangXi characters"; "BSK-bH-Gct.title" = "Auto-convert traditional Chinese glyphs to KangXi characters";

View File

@ -33,3 +33,4 @@
"Please specify at least 4 candidate keys." = "言選り用キー陣列に少なくとも4つのキーをご登録ください。"; "Please specify at least 4 candidate keys." = "言選り用キー陣列に少なくとも4つのキーをご登録ください。";
"Maximum 15 candidate keys allowed." = "言選り用キー陣列には最多15つキー登録できます。"; "Maximum 15 candidate keys allowed." = "言選り用キー陣列には最多15つキー登録できます。";
"⚠︎ Phrase replacement mode enabled, interfering user phrase entry." = "⚠︎ 言葉置換機能稼働中、新添付言葉にも影響。"; "⚠︎ Phrase replacement mode enabled, interfering user phrase entry." = "⚠︎ 言葉置換機能稼働中、新添付言葉にも影響。";
"NT351 BPMF EMU" = "全候補入力モード";

View File

@ -104,8 +104,8 @@
/* Class = "NSTextFieldCell"; title = "UI language setting:"; ObjectID = "9DS-Rc-TXq"; */ /* Class = "NSTextFieldCell"; title = "UI language setting:"; ObjectID = "9DS-Rc-TXq"; */
"9DS-Rc-TXq.title" = "アプリ表示用言語:"; "9DS-Rc-TXq.title" = "アプリ表示用言語:";
/* Class = "NSButtonCell"; title = "Emulating Windows NT 3.51 legacy phonetic typing experience"; ObjectID = "ArK-Vk-OoT"; */ /* Class = "NSButtonCell"; title = "Emulating Windows NT 3.51 select-candidate-per-character mode"; ObjectID = "ArK-Vk-OoT"; */
"ArK-Vk-OoT.title" = "Windows NT 3.51 内蔵注音入力スタイルを真似する"; "ArK-Vk-OoT.title" = "Windows NT 3.51 内蔵注音らしく漢字1つづつ全候補選択入力";
/* Class = "NSButtonCell"; title = "Auto-convert traditional Chinese glyphs to KangXi characters"; ObjectID = "BSK-bH-Gct"; */ /* Class = "NSButtonCell"; title = "Auto-convert traditional Chinese glyphs to KangXi characters"; ObjectID = "BSK-bH-Gct"; */
"BSK-bH-Gct.title" = "自動的に繁体漢字を康熙文字と変換する"; "BSK-bH-Gct.title" = "自動的に繁体漢字を康熙文字と変換する";

View File

@ -33,3 +33,4 @@
"Please specify at least 4 candidate keys." = "请至少指定四个选字键。"; "Please specify at least 4 candidate keys." = "请至少指定四个选字键。";
"Maximum 15 candidate keys allowed." = "选字键最多只能指定十五个。"; "Maximum 15 candidate keys allowed." = "选字键最多只能指定十五个。";
"⚠︎ Phrase replacement mode enabled, interfering user phrase entry." = "⚠︎ 语汇置换功能已启用,会波及语汇自订。"; "⚠︎ Phrase replacement mode enabled, interfering user phrase entry." = "⚠︎ 语汇置换功能已启用,会波及语汇自订。";
"NT351 BPMF EMU" = "模拟逐字选字输入";

View File

@ -104,7 +104,7 @@
/* Class = "NSTextFieldCell"; title = "UI language setting:"; ObjectID = "9DS-Rc-TXq"; */ /* Class = "NSTextFieldCell"; title = "UI language setting:"; ObjectID = "9DS-Rc-TXq"; */
"9DS-Rc-TXq.title" = "介面语言设定:"; "9DS-Rc-TXq.title" = "介面语言设定:";
/* Class = "NSButtonCell"; title = "Emulating Windows NT 3.51 legacy phonetic typing experience"; ObjectID = "ArK-Vk-OoT"; */ /* Class = "NSButtonCell"; title = "Emulating Windows NT 3.51 select-candidate-per-character mode"; ObjectID = "ArK-Vk-OoT"; */
"ArK-Vk-OoT.title" = "模拟 Windows NT 3.51 注音逐字选字输入风格"; "ArK-Vk-OoT.title" = "模拟 Windows NT 3.51 注音逐字选字输入风格";
/* Class = "NSButtonCell"; title = "Auto-convert traditional Chinese glyphs to KangXi characters"; ObjectID = "BSK-bH-Gct"; */ /* Class = "NSButtonCell"; title = "Auto-convert traditional Chinese glyphs to KangXi characters"; ObjectID = "BSK-bH-Gct"; */

View File

@ -33,3 +33,4 @@
"Please specify at least 4 candidate keys." = "請至少指定四個選字鍵。"; "Please specify at least 4 candidate keys." = "請至少指定四個選字鍵。";
"Maximum 15 candidate keys allowed." = "選字鍵最多只能指定十五個。"; "Maximum 15 candidate keys allowed." = "選字鍵最多只能指定十五個。";
"⚠︎ Phrase replacement mode enabled, interfering user phrase entry." = "⚠︎ 語彙置換功能已啟用,會波及語彙自訂。"; "⚠︎ Phrase replacement mode enabled, interfering user phrase entry." = "⚠︎ 語彙置換功能已啟用,會波及語彙自訂。";
"NT351 BPMF EMU" = "模擬逐字選字輸入";

View File

@ -104,7 +104,7 @@
/* Class = "NSTextFieldCell"; title = "UI language setting:"; ObjectID = "9DS-Rc-TXq"; */ /* Class = "NSTextFieldCell"; title = "UI language setting:"; ObjectID = "9DS-Rc-TXq"; */
"9DS-Rc-TXq.title" = "介面語言設定:"; "9DS-Rc-TXq.title" = "介面語言設定:";
/* Class = "NSButtonCell"; title = "Emulating Windows NT 3.51 legacy phonetic typing experience"; ObjectID = "ArK-Vk-OoT"; */ /* Class = "NSButtonCell"; title = "Emulating Windows NT 3.51 select-candidate-per-character mode"; ObjectID = "ArK-Vk-OoT"; */
"ArK-Vk-OoT.title" = "模擬 Windows NT 3.51 注音逐字選字輸入風格"; "ArK-Vk-OoT.title" = "模擬 Windows NT 3.51 注音逐字選字輸入風格";
/* Class = "NSButtonCell"; title = "Auto-convert traditional Chinese glyphs to KangXi characters"; ObjectID = "BSK-bH-Gct"; */ /* Class = "NSButtonCell"; title = "Auto-convert traditional Chinese glyphs to KangXi characters"; ObjectID = "BSK-bH-Gct"; */