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

Disabling KangXi mode menu & hotkeys in CHS mode.
This commit is contained in:
ShikiSuen 2022-01-18 19:53:50 +08:00
parent 308a282e51
commit 3b3793253d
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:@""]; [menu addItemWithTitle:NSLocalizedString(@"vChewing Preferences", @"") action:@selector(showPreferences:) keyEquivalent:@""];
NSMenuItem *chineseConversionMenuItem = [menu addItemWithTitle:NSLocalizedString(@"Chinese Conversion", @"") action:@selector(toggleChineseConverter:) keyEquivalent:@"K"]; if ((_inputMode == kBopomofoModeIdentifierCHT) && optionKeyPressed) {
chineseConversionMenuItem.keyEquivalentModifierMask = NSEventModifierFlagCommand | NSEventModifierFlagControl; NSMenuItem *chineseConversionMenuItem = [menu addItemWithTitle:NSLocalizedString(@"Force KangXi Writing", @"") action:@selector(toggleChineseConverter:) keyEquivalent:@"K"];
chineseConversionMenuItem.state = Preferences.chineseConversionEnabled ? NSControlStateValueOn : NSControlStateValueOff; chineseConversionMenuItem.keyEquivalentModifierMask = NSEventModifierFlagCommand | NSEventModifierFlagControl;
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;
@ -1477,8 +1479,10 @@ NS_INLINE size_t max(size_t a, size_t b) { return a > b ? a : b; }
- (void)toggleChineseConverter:(id)sender - (void)toggleChineseConverter:(id)sender
{ {
BOOL chineseConversionEnabled = [Preferences toggleChineseConversionEnabled]; if (_inputMode == kBopomofoModeIdentifierCHT) {
[NotifierController notifyWithMessage:[NSString stringWithFormat:@"%@%@%@", NSLocalizedString(@"Chinese Conversion", @""), @"\n", chineseConversionEnabled ? NSLocalizedString(@"NotificationSwitchON", @"") : NSLocalizedString(@"NotificationSwitchOFF", @"")] stay:NO]; BOOL chineseConversionEnabled = [Preferences toggleChineseConversionEnabled];
[NotifierController notifyWithMessage:[NSString stringWithFormat:@"%@%@%@", NSLocalizedString(@"Force KangXi Writing", @""), @"\n", chineseConversionEnabled ? NSLocalizedString(@"NotificationSwitchON", @"") : NSLocalizedString(@"NotificationSwitchOFF", @"")] stay:NO];
}
} }
- (void)toggleHalfWidthPunctuation:(id)sender - (void)toggleHalfWidthPunctuation:(id)sender

View File

@ -16,7 +16,7 @@
"Not Now" = "Not Now"; "Not Now" = "Not Now";
"Visit Website" = "Visit Website"; "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?%@"; "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"; "NotificationSwitchON" = "✔ ON";
"NotificationSwitchOFF" = "✘ OFF"; "NotificationSwitchOFF" = "✘ OFF";
"Edit User Phrases" = "Edit User Phrases"; "Edit User Phrases" = "Edit User Phrases";

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?%@" = "目前使用的威注音官方版本是 %1$@ (%2$@),网路上有更新版本 %3$@ (%4$@) 可供下载。是否要前往威注音网站下载新版来安装?%5$@"; "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" = "✔ 已启用"; "NotificationSwitchON" = "✔ 已启用";
"NotificationSwitchOFF" = "✘ 已停用"; "NotificationSwitchOFF" = "✘ 已停用";
"Edit User Phrases" = "编辑自订语汇"; "Edit User Phrases" = "编辑自订语汇";

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?%@" = "目前使用的威注音官方版本是 %1$@ (%2$@),網路上有更新版本 %3$@ (%4$@) 可供下載。是否要前往威注音網站下載新版來安裝?%5$@"; "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" = "✔ 已啟用"; "NotificationSwitchON" = "✔ 已啟用";
"NotificationSwitchOFF" = "✘ 已停用"; "NotificationSwitchOFF" = "✘ 已停用";
"Edit User Phrases" = "編輯自訂語彙"; "Edit User Phrases" = "編輯自訂語彙";