簡體中文模式禁用康熙模式熱鍵與選單項

Disabling KangXi mode menu & hotkeys in CHS mode.
This commit is contained in:
ShikiSuen 2022-01-18 19:53:50 +08:00
parent 37e6c4f9cb
commit e8475c8723
4 changed files with 12 additions and 8 deletions

View File

@ -138,9 +138,11 @@ static double FindHighestScore(const vector<NodeAnchor>& nodes, double epsilon)
[menu addItemWithTitle:NSLocalizedString(@"vChewing Preferences", @"") action:@selector(showPreferences:) keyEquivalent:@""];
NSMenuItem *chineseConversionMenuItem = [menu addItemWithTitle:NSLocalizedString(@"Chinese Conversion", @"") action:@selector(toggleChineseConverter:) keyEquivalent:@"K"];
chineseConversionMenuItem.keyEquivalentModifierMask = NSEventModifierFlagCommand | NSEventModifierFlagControl;
chineseConversionMenuItem.state = Preferences.chineseConversionEnabled ? NSControlStateValueOn : NSControlStateValueOff;
if ((_inputMode == kBopomofoModeIdentifierCHT) && optionKeyPressed) {
NSMenuItem *chineseConversionMenuItem = [menu addItemWithTitle:NSLocalizedString(@"Force KangXi Writing", @"") action:@selector(toggleChineseConverter:) keyEquivalent:@"K"];
chineseConversionMenuItem.keyEquivalentModifierMask = NSEventModifierFlagCommand | NSEventModifierFlagControl;
chineseConversionMenuItem.state = Preferences.chineseConversionEnabled ? NSControlStateValueOn : NSControlStateValueOff;
}
NSMenuItem *halfWidthPunctuationMenuItem = [menu addItemWithTitle:NSLocalizedString(@"Use Half-Width Punctuations", @"") action:@selector(toggleHalfWidthPunctuation:) keyEquivalent:@""];
halfWidthPunctuationMenuItem.state = Preferences.halfWidthPunctuationEnabled ? NSControlStateValueOn : NSControlStateValueOff;
@ -1477,8 +1479,10 @@ NS_INLINE size_t max(size_t a, size_t b) { return a > b ? a : b; }
- (void)toggleChineseConverter:(id)sender
{
BOOL chineseConversionEnabled = [Preferences toggleChineseConversionEnabled];
[NotifierController notifyWithMessage:[NSString stringWithFormat:@"%@%@%@", NSLocalizedString(@"Chinese Conversion", @""), @"\n", chineseConversionEnabled ? NSLocalizedString(@"NotificationSwitchON", @"") : NSLocalizedString(@"NotificationSwitchOFF", @"")] stay:NO];
if (_inputMode == kBopomofoModeIdentifierCHT) {
BOOL chineseConversionEnabled = [Preferences toggleChineseConversionEnabled];
[NotifierController notifyWithMessage:[NSString stringWithFormat:@"%@%@%@", NSLocalizedString(@"Force KangXi Writing", @""), @"\n", chineseConversionEnabled ? NSLocalizedString(@"NotificationSwitchON", @"") : NSLocalizedString(@"NotificationSwitchOFF", @"")] stay:NO];
}
}
- (void)toggleHalfWidthPunctuation:(id)sender

View File

@ -16,7 +16,7 @@
"Not Now" = "Not Now";
"Visit Website" = "Visit Website";
"You're currently using vChewing %@ (%@), a new version %@ (%@) is now available. Do you want to visit vChewing's website to download the version?%@" = "You're currently using vChewing %@ (%@), a new version %@ (%@) is now available. Do you want to visit vChewing's website to download the version?%@";
"Chinese Conversion" = "Convert zh-TW Kanji to KangXi Variants";
"Force KangXi Writing" = "Force KangXi Writing";
"NotificationSwitchON" = "✔ ON";
"NotificationSwitchOFF" = "✘ OFF";
"Edit User Phrases" = "Edit User Phrases";

View File

@ -16,7 +16,7 @@
"Not Now" = "以后再说";
"Visit Website" = "前往网站";
"You're currently using vChewing %@ (%@), a new version %@ (%@) is now available. Do you want to visit vChewing's website to download the version?%@" = "目前使用的威注音官方版本是 %1$@ (%2$@),网路上有更新版本 %3$@ (%4$@) 可供下载。是否要前往威注音网站下载新版来安装?%5$@";
"Chinese Conversion" = "优先使用康熙繁体字";
"Force KangXi Writing" = "康熙繁体字模式";
"NotificationSwitchON" = "✔ 已启用";
"NotificationSwitchOFF" = "✘ 已停用";
"Edit User Phrases" = "编辑自订语汇";

View File

@ -16,7 +16,7 @@
"Not Now" = "以後再說";
"Visit Website" = "前往網站";
"You're currently using vChewing %@ (%@), a new version %@ (%@) is now available. Do you want to visit vChewing's website to download the version?%@" = "目前使用的威注音官方版本是 %1$@ (%2$@),網路上有更新版本 %3$@ (%4$@) 可供下載。是否要前往威注音網站下載新版來安裝?%5$@";
"Chinese Conversion" = "優先使用康熙繁體字";
"Force KangXi Writing" = "康熙繁體字模式";
"NotificationSwitchON" = "✔ 已啟用";
"NotificationSwitchOFF" = "✘ 已停用";
"Edit User Phrases" = "編輯自訂語彙";