KeyHandler // Tweak the tooltip of buildInputtingState().

- I can't figure out the meaning of "before and after" in this context, hence the necessity of simplifying the processing model here. Plus, this tooltip won't be presented to the end user anymore since this IME already has NSStringUtils for handling Emojis well.
This commit is contained in:
ShikiSuen 2022-04-21 12:42:45 +08:00
parent 99cf3eb47b
commit fd2074b44e
7 changed files with 7 additions and 22 deletions

View File

@ -282,19 +282,19 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
}
if (builderCursorIndex == 0)
{
resultOfRear =
resultOfFront =
[NSString stringWithUTF8String:_builder->readings()[builderCursorIndex].c_str()];
}
else if (builderCursorIndex >= _builder->readings().size())
{
resultOfFront = [NSString
resultOfRear = [NSString
stringWithUTF8String:_builder->readings()[_builder->readings().size() - 1].c_str()];
}
else
{
resultOfRear =
[NSString stringWithUTF8String:_builder->readings()[builderCursorIndex].c_str()];
resultOfFront =
[NSString stringWithUTF8String:_builder->readings()[builderCursorIndex].c_str()];
resultOfRear =
[NSString stringWithUTF8String:_builder->readings()[builderCursorIndex - 1].c_str()];
}
}

View File

@ -45,20 +45,15 @@ import Cocoa
//
var tooltip = ""
if resultOfRear == "", resultOfFront != "" {
tooltip = String(format: NSLocalizedString("Cursor is in front of \"%@\".", comment: ""), resultOfFront)
}
if resultOfRear != "", resultOfFront == "" {
tooltip = String(format: NSLocalizedString("Cursor is at the rear of \"%@\".", comment: ""), resultOfRear)
}
if resultOfRear != "", resultOfFront != "" {
// NSString Emoji
//
if resultOfRear != "" || resultOfFront != "" {
tooltip = String(
format: NSLocalizedString("Cursor is between \"%@\" and \"%@\".", comment: ""),
resultOfFront, resultOfRear
)
}
//
newState.tooltip = tooltip
return newState
}

View File

@ -56,8 +56,6 @@
"Symbol & Emoji Input" = "Symbol & Emoji Input";
"Edit User Symbol & Emoji Data…" = "Edit User Symbol & Emoji Data…";
"Choose your desired user data folder." = "Choose your desired user data folder.";
"Cursor is in front of \"%@\"." = "Cursor is in front of \"%@\".";
"Cursor is at the rear of \"%@\"." = "Cursor is at the rear of \"%@\".";
"Cursor is between \"%@\" and \"%@\"." = "Cursor is between \"%@\" and \"%@\".";
// The followings are the category names used in the Symbol menu.

View File

@ -56,8 +56,6 @@
"Symbol & Emoji Input" = "Symbol & Emoji Input";
"Edit User Symbol & Emoji Data…" = "Edit User Symbol & Emoji Data…";
"Choose your desired user data folder." = "Choose your desired user data folder.";
"Cursor is in front of \"%@\"." = "Cursor is in front of \"%@\".";
"Cursor is at the rear of \"%@\"." = "Cursor is at the rear of \"%@\".";
"Cursor is between \"%@\" and \"%@\"." = "Cursor is between \"%@\" and \"%@\".";
// The followings are the category names used in the Symbol menu.

View File

@ -56,8 +56,6 @@
"Symbol & Emoji Input" = "符号&絵文字入力";
"Edit User Symbol & Emoji Data…" = "ユーザー符号&絵文字辞書を編集…";
"Choose your desired user data folder." = "欲しがるユーザー辞書フォルダをお選びください。";
"Cursor is in front of \"%@\"." = "カーソルは「%@」の後に。";
"Cursor is at the rear of \"%@\"." = "カーソル「%@」の前に。";
"Cursor is between \"%@\" and \"%@\"." = "カーソルは「%@」と「%@」に間れ。";
// The followings are the category names used in the Symbol menu.

View File

@ -56,8 +56,6 @@
"Symbol & Emoji Input" = "符号&绘文字输入";
"Edit User Symbol & Emoji Data…" = "编辑自订符号&绘文字资料…";
"Choose your desired user data folder." = "请选择您想指定的使用者语汇档案目录。";
"Cursor is in front of \"%@\"." = "游标在「%@」之后。";
"Cursor is at the rear of \"%@\"." = "游标在「%@」之前。";
"Cursor is between \"%@\" and \"%@\"." = "游标介于「%@」与「%@」之间。";
// The followings are the category names used in the Symbol menu.

View File

@ -56,8 +56,6 @@
"Symbol & Emoji Input" = "符號&繪文字輸入";
"Edit User Symbol & Emoji Data…" = "編輯自訂符號&繪文字資料…";
"Choose your desired user data folder." = "請選擇您想指定的使用者語彙檔案目錄。";
"Cursor is in front of \"%@\"." = "游標在「%@」之後。";
"Cursor is at the rear of \"%@\"." = "游標在「%@」之前。";
"Cursor is between \"%@\" and \"%@\"." = "游標介於「%@」與「%@」之間。";
// The followings are the category names used in the Symbol menu.