From c89c34584ae006d8c0815754e9fb7fca66c811fc Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Mon, 30 May 2022 19:06:14 +0800 Subject: [PATCH] PrefUI // Allow users to choose composition buffer size. --- .../Resources/Base.lproj/Localizable.strings | 2 ++ Source/Resources/en.lproj/Localizable.strings | 2 ++ Source/Resources/ja.lproj/Localizable.strings | 2 ++ .../zh-Hans.lproj/Localizable.strings | 2 ++ .../zh-Hant.lproj/Localizable.strings | 2 ++ Source/UI/PrefUI/suiPrefPaneExperience.swift | 19 +++++++++++++++++++ 6 files changed, 29 insertions(+) diff --git a/Source/Resources/Base.lproj/Localizable.strings b/Source/Resources/Base.lproj/Localizable.strings index 2b29cada..bcc0dfc5 100644 --- a/Source/Resources/Base.lproj/Localizable.strings +++ b/Source/Resources/Base.lproj/Localizable.strings @@ -90,6 +90,7 @@ "Auto-convert traditional Chinese glyphs to KangXi characters" = "Auto-convert traditional Chinese glyphs to KangXi characters"; "Automatically reload user data files if changes detected" = "Automatically reload user data files if changes detected"; "Basic Keyboard Layout:" = "Basic Keyboard Layout:"; +"Buffer Limit:" = "Buffer Limit:"; "Candidate Layout:" = "Candidate Layout:"; "Candidate Size:" = "Candidate Size:"; "Change user interface language (will reboot the IME)." = "Change user interface language (will reboot the IME)."; @@ -145,6 +146,7 @@ "Space & ESC Key:" = "Space & ESC Key:"; "Space to +cycle candidates, Shift+Space to +cycle pages" = "Space to +cycle candidates, Shift+Space to +cycle pages"; "Space to +cycle pages, Shift+Space to +cycle candidates" = "Space to +cycle pages, Shift+Space to +cycle candidates"; +"Specify the maximum characters allowed in the composition buffer." = "Specify the maximum characters allowed in the composition buffer."; "Stop farting (when typed phonetic combination is invalid, etc.)" = "Stop farting (when typed phonetic combination is invalid, etc.)"; "Traditional Chinese" = "Traditional Chinese"; "Typing Style:" = "Typing Style:"; diff --git a/Source/Resources/en.lproj/Localizable.strings b/Source/Resources/en.lproj/Localizable.strings index 2b29cada..bcc0dfc5 100644 --- a/Source/Resources/en.lproj/Localizable.strings +++ b/Source/Resources/en.lproj/Localizable.strings @@ -90,6 +90,7 @@ "Auto-convert traditional Chinese glyphs to KangXi characters" = "Auto-convert traditional Chinese glyphs to KangXi characters"; "Automatically reload user data files if changes detected" = "Automatically reload user data files if changes detected"; "Basic Keyboard Layout:" = "Basic Keyboard Layout:"; +"Buffer Limit:" = "Buffer Limit:"; "Candidate Layout:" = "Candidate Layout:"; "Candidate Size:" = "Candidate Size:"; "Change user interface language (will reboot the IME)." = "Change user interface language (will reboot the IME)."; @@ -145,6 +146,7 @@ "Space & ESC Key:" = "Space & ESC Key:"; "Space to +cycle candidates, Shift+Space to +cycle pages" = "Space to +cycle candidates, Shift+Space to +cycle pages"; "Space to +cycle pages, Shift+Space to +cycle candidates" = "Space to +cycle pages, Shift+Space to +cycle candidates"; +"Specify the maximum characters allowed in the composition buffer." = "Specify the maximum characters allowed in the composition buffer."; "Stop farting (when typed phonetic combination is invalid, etc.)" = "Stop farting (when typed phonetic combination is invalid, etc.)"; "Traditional Chinese" = "Traditional Chinese"; "Typing Style:" = "Typing Style:"; diff --git a/Source/Resources/ja.lproj/Localizable.strings b/Source/Resources/ja.lproj/Localizable.strings index a6a283f8..9cc3ecbe 100644 --- a/Source/Resources/ja.lproj/Localizable.strings +++ b/Source/Resources/ja.lproj/Localizable.strings @@ -90,6 +90,7 @@ "Auto-convert traditional Chinese glyphs to KangXi characters" = "入力した繁体字を康熙字体と自動変換"; "Automatically reload user data files if changes detected" = "ユーザー辞書データの変更を自動検出し、自動的に再読込"; "Basic Keyboard Layout:" = "基礎キーボード:"; +"Buffer Limit:" = "緩衝列の容量:"; "Candidate Layout:" = "入力候補陳列の仕様"; "Candidate Size:" = "候補文字の字号:"; "Change user interface language (will reboot the IME)." = "アプリ表示用言語をご指定下さい、そして入力アプリは自動的に再起動。"; @@ -145,6 +146,7 @@ "Space & ESC Key:" = "ESC と Space:"; "Space to +cycle candidates, Shift+Space to +cycle pages" = "Shift+Space で次のページ、Space で次の候補文字を"; "Space to +cycle pages, Shift+Space to +cycle candidates" = "Space で次のページ、Shift+Space で次の候補文字を"; +"Specify the maximum characters allowed in the composition buffer." = "緩衝列に入れる文字の数の上限をご指定ください。"; "Stop farting (when typed phonetic combination is invalid, etc.)" = "マナーモード // 外すと入力間違った時に変な声が出る"; "Traditional Chinese" = "繁体中国語"; "Typing Style:" = "入力習慣:"; diff --git a/Source/Resources/zh-Hans.lproj/Localizable.strings b/Source/Resources/zh-Hans.lproj/Localizable.strings index 252b8c5e..89b07c38 100644 --- a/Source/Resources/zh-Hans.lproj/Localizable.strings +++ b/Source/Resources/zh-Hans.lproj/Localizable.strings @@ -90,6 +90,7 @@ "Auto-convert traditional Chinese glyphs to KangXi characters" = "自动将繁体中文字转为康熙正体字"; "Automatically reload user data files if changes detected" = "自动检测并载入使用者语汇档案变更"; "Basic Keyboard Layout:" = "基础键盘布局:"; +"Buffer Limit:" = "组字区容量:"; "Candidate Layout:" = "候选字窗布局:"; "Candidate Size:" = "候选字窗字号:"; "Change user interface language (will reboot the IME)." = "变更输入法介面语言,会自动重启输入法。"; @@ -146,6 +147,7 @@ "Space & ESC Key:" = "ESC 与空格键:"; "Space to +cycle candidates, Shift+Space to +cycle pages" = "Shift+空格键 换下一页,空格键 换选下一个后选字"; "Space to +cycle pages, Shift+Space to +cycle candidates" = "空格键 换下一页,Shift+空格键 换选下一个后选字"; +"Specify the maximum characters allowed in the composition buffer." = "请指定组字缓冲区内的文字数的上限。"; "Stop farting (when typed phonetic combination is invalid, etc.)" = "廉耻模式 // 取消勾选的话,敲错字时会有异音"; "Traditional Chinese" = "繁体中文"; "Typing Style:" = "输入风格:"; diff --git a/Source/Resources/zh-Hant.lproj/Localizable.strings b/Source/Resources/zh-Hant.lproj/Localizable.strings index 12935856..6ce9f89e 100644 --- a/Source/Resources/zh-Hant.lproj/Localizable.strings +++ b/Source/Resources/zh-Hant.lproj/Localizable.strings @@ -90,6 +90,7 @@ "Auto-convert traditional Chinese glyphs to KangXi characters" = "自動將繁體中文字轉為康熙正體字"; "Automatically reload user data files if changes detected" = "自動檢測並載入使用者語彙檔案變更"; "Basic Keyboard Layout:" = "基礎鍵盤佈局:"; +"Buffer Limit:" = "組字區容量:"; "Candidate Layout:" = "候選字窗佈局:"; "Candidate Size:" = "候選字窗字號:"; "Change user interface language (will reboot the IME)." = "變更輸入法介面語言,會自動重啟輸入法。"; @@ -145,6 +146,7 @@ "Space & ESC Key:" = "ESC 與空格鍵:"; "Space to +cycle candidates, Shift+Space to +cycle pages" = "Shift+空格鍵 換下一頁,空格鍵 換選下一個後選字"; "Space to +cycle pages, Shift+Space to +cycle candidates" = "空格鍵 換下一頁,Shift+空格鍵 換選下一個後選字"; +"Specify the maximum characters allowed in the composition buffer." = "請指定組字緩衝區內的文字數的上限。"; "Stop farting (when typed phonetic combination is invalid, etc.)" = "廉恥模式 // 取消勾選的話,敲錯字時會有異音"; "Traditional Chinese" = "繁體中文"; "Typing Style:" = "輸入風格:"; diff --git a/Source/UI/PrefUI/suiPrefPaneExperience.swift b/Source/UI/PrefUI/suiPrefPaneExperience.swift index ffe717e0..a66b7085 100644 --- a/Source/UI/PrefUI/suiPrefPaneExperience.swift +++ b/Source/UI/PrefUI/suiPrefPaneExperience.swift @@ -45,6 +45,7 @@ struct suiPrefPaneExperience: View { @State private var selKeyBehaviorESCForClearingTheBuffer = UserDefaults.standard.bool( forKey: UserDef.kEscToCleanInputBuffer) @State private var selEnableSCPCTypingMode = UserDefaults.standard.bool(forKey: UserDef.kUseSCPCTypingMode) + @State private var selComposingBufferSize = UserDefaults.standard.integer(forKey: UserDef.kComposingBufferSize) private let contentWidth: Double = { switch mgrPrefs.appleLanguages[0] { case "ja": @@ -88,6 +89,24 @@ struct suiPrefPaneExperience: View { ) .preferenceDescription() } + Preferences.Section(bottomDivider: true, label: { Text(LocalizedStringKey("Buffer Limit:")) }) { + Picker("", selection: $selComposingBufferSize) { + Text("10").tag(10) + Text("15").tag(15) + Text("20").tag(20) + Text("25").tag(25) + Text("30").tag(30) + Text("35").tag(35) + Text("40").tag(40) + }.onChange(of: selComposingBufferSize) { value in + mgrPrefs.composingBufferSize = value + } + .labelsHidden() + .horizontalRadioGroupLayout() + .pickerStyle(RadioGroupPickerStyle()) + Text(LocalizedStringKey("Specify the maximum characters allowed in the composition buffer.")) + .preferenceDescription() + } Preferences.Section(bottomDivider: true, label: { Text(LocalizedStringKey("Cursor Selection:")) }) { Picker("", selection: $selCursorPosition) { Text(LocalizedStringKey("in front of the phrase (like macOS built-in Zhuyin IME)")).tag(0)