From d2c039c42d7a1b082414f939af333b4f8fde2a9b Mon Sep 17 00:00:00 2001 From: zonble Date: Tue, 18 Jan 2022 22:19:25 +0800 Subject: [PATCH] Notifies the users it is not suggested to add phrase when model is converted. --- Source/InputMethodController.mm | 8 ++++++++ Source/en.lproj/Localizable.strings | 3 +++ Source/zh-Hant.lproj/Localizable.strings | 4 ++++ 3 files changed, 15 insertions(+) diff --git a/Source/InputMethodController.mm b/Source/InputMethodController.mm index 2c503790..4a03fc78 100644 --- a/Source/InputMethodController.mm +++ b/Source/InputMethodController.mm @@ -1456,6 +1456,14 @@ NS_INLINE size_t max(size_t a, size_t b) { return a > b ? a : b; } if (!length) { [self _hideTooltip]; } + else if (Preferences.phraseReplacementEnabled) { + NSString *message = NSLocalizedString(@"Phrase replacement mode is on. Not suggested to add phrase in the mode.", @""); + [self _showTooltip:message client:client]; + } + else if (Preferences.chineseConversionStyle == 1 && Preferences.chineseConversionEnabled) { + NSString *message = NSLocalizedString(@"Model based Chinese conversion is on. Not suggested to add phrase in the mode.", @""); + [self _showTooltip:message client:client]; + } else if (length == 1) { NSString *messsage = [NSString stringWithFormat:NSLocalizedString(@"You are now selecting \"%@\". You can add a phrase with two or more characters.", @""), text]; [self _showTooltip:messsage client:client]; diff --git a/Source/en.lproj/Localizable.strings b/Source/en.lproj/Localizable.strings index dade91ce..ad91a3bd 100644 --- a/Source/en.lproj/Localizable.strings +++ b/Source/en.lproj/Localizable.strings @@ -89,3 +89,6 @@ "The length of your candidate keys can not be larger than 15 characters." = "The length of your candidate keys can not be larger than 15 characters."; +"Phrase replacement mode is on. Not suggested to add phrase in the mode." = "Phrase replacement mode is on. Not suggested to add phrase in the mode."; + +"Model based Chinese conversion is on. Not suggested to add phrase in the mode." = "Model based Chinese conversion is on. Not suggested to add phrase in the mode."; diff --git a/Source/zh-Hant.lproj/Localizable.strings b/Source/zh-Hant.lproj/Localizable.strings index 12785f77..d9ab108a 100644 --- a/Source/zh-Hant.lproj/Localizable.strings +++ b/Source/zh-Hant.lproj/Localizable.strings @@ -88,3 +88,7 @@ "The length of your candidate keys can not be less than 4 characters." = "選字按鍵數量不可小於 4。"; "The length of your candidate keys can not be larger than 15 characters." = "選字按鍵數量不可大於 15。"; + +"Phrase replacement mode is on. Not suggested to add phrase in the mode." = "詞彙轉換已開啟,不建議在此模式下加詞。"; + +"Model based Chinese conversion is on. Not suggested to add phrase in the mode." = "您已開啟將語言模型轉為簡體中文,不建議在此模式下加詞。";