From 71449cb253b10a7f2aca75456cae267bb769195a Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Tue, 9 Aug 2022 12:04:34 +0800 Subject: [PATCH] PrefUI // +upperCaseLetterKeyBehavior. --- Source/Resources/Base.lproj/Localizable.strings | 7 ++++++- Source/Resources/en.lproj/Localizable.strings | 7 ++++++- Source/Resources/ja.lproj/Localizable.strings | 7 ++++++- .../Resources/zh-Hans.lproj/Localizable.strings | 7 ++++++- .../Resources/zh-Hant.lproj/Localizable.strings | 7 ++++++- Source/UI/PrefUI/suiPrefPaneExperience.swift | 15 +++++++++++++++ 6 files changed, 45 insertions(+), 5 deletions(-) diff --git a/Source/Resources/Base.lproj/Localizable.strings b/Source/Resources/Base.lproj/Localizable.strings index 3a5162d4..69440ed2 100644 --- a/Source/Resources/Base.lproj/Localizable.strings +++ b/Source/Resources/Base.lproj/Localizable.strings @@ -113,6 +113,7 @@ "Choose or hit Enter to confim your prefered keys for selecting candidates." = "Choose or hit Enter to confim your prefered keys for selecting candidates."; "Choose the behavior of (Shift+)Space key with candidates." = "Choose the behavior of (Shift+)Space key with candidates."; "Choose the behavior of (Shift+)Tab key in the candidate window." = "Choose the behavior of (Shift+)Tab key in the candidate window."; +"Choose the behavior of Shift+Letter key with letter inputs." = "Choose the behavior of Shift+Letter key with letter inputs."; "Choose the cursor position where you want to list possible candidates." = "Choose the cursor position where you want to list possible candidates."; "Choose the macOS-level basic keyboard layout." = "Choose the macOS-level basic keyboard layout."; "Choose the phonetic layout for Mandarin parser." = "Choose the phonetic layout for Mandarin parser."; @@ -123,6 +124,8 @@ "Dachen 26 (libChewing)" = "Dachen 26 (libChewing)"; "Debug Mode" = "Debug Mode"; "Dictionary" = "Dictionary"; +"Directly commit lowercased letters" = "Directly commit lowercased letters"; +"Directly commit uppercased letters" = "Directly commit uppercased letters"; "Emulating select-candidate-per-character mode" = "Emulating select-candidate-per-character mode"; "Enable CNS11643 Support (2022-07-20)" = "Enable CNS11643 Support (2022-07-20)"; "Enable Space key for calling candidate window" = "Enable Space key for calling candidate window"; @@ -143,8 +146,8 @@ "IBM" = "IBM"; "in front of the phrase (like macOS built-in Zhuyin IME)" = "in front of the phrase (like macOS built-in Zhuyin IME)"; "Japanese" = "Japanese"; -"Keyboard" = "Keyboard"; "Keyboard Shortcuts:" = "Keyboard Shortcuts:"; +"Keyboard" = "Keyboard"; "Misc Settings:" = "Misc Settings:"; "MiTAC" = "MiTAC"; "Non-QWERTY alphanumeral keyboard layouts are for Hanyu Pinyin parser only." = "Non-QWERTY alphanumeral keyboard layouts are for Hanyu Pinyin parser only."; @@ -155,6 +158,7 @@ "Secondary Pinyin with Numeral Intonation" = "Secondary Pinyin with Numeral Intonation"; "Seigyou" = "Seigyou (JinYei)"; "Selection Keys:" = "Selection Keys:"; +"Shift+Letter:" = "Shift+Letter:"; "Show Hanyu-Pinyin in the inline composition buffer & tooltip" = "Show Hanyu-Pinyin in the inline composition buffer & tooltip"; "Show page buttons in candidate window" = "Show page buttons in candidate window"; "Simplified Chinese" = "Simplified Chinese"; @@ -163,6 +167,7 @@ "Starlight" = "Starlight"; "Stop farting (when typed phonetic combination is invalid, etc.)" = "Stop farting (when typed phonetic combination is invalid, etc.)"; "Traditional Chinese" = "Traditional Chinese"; +"Type them into inline composition buffer" = "Type them into inline composition buffer"; "Typing Style:" = "Typing Style:"; "UI Language:" = "UI Language:"; "Universal Pinyin with Numeral Intonation" = "Universal Pinyin with Numeral Intonation"; diff --git a/Source/Resources/en.lproj/Localizable.strings b/Source/Resources/en.lproj/Localizable.strings index 3a5162d4..69440ed2 100644 --- a/Source/Resources/en.lproj/Localizable.strings +++ b/Source/Resources/en.lproj/Localizable.strings @@ -113,6 +113,7 @@ "Choose or hit Enter to confim your prefered keys for selecting candidates." = "Choose or hit Enter to confim your prefered keys for selecting candidates."; "Choose the behavior of (Shift+)Space key with candidates." = "Choose the behavior of (Shift+)Space key with candidates."; "Choose the behavior of (Shift+)Tab key in the candidate window." = "Choose the behavior of (Shift+)Tab key in the candidate window."; +"Choose the behavior of Shift+Letter key with letter inputs." = "Choose the behavior of Shift+Letter key with letter inputs."; "Choose the cursor position where you want to list possible candidates." = "Choose the cursor position where you want to list possible candidates."; "Choose the macOS-level basic keyboard layout." = "Choose the macOS-level basic keyboard layout."; "Choose the phonetic layout for Mandarin parser." = "Choose the phonetic layout for Mandarin parser."; @@ -123,6 +124,8 @@ "Dachen 26 (libChewing)" = "Dachen 26 (libChewing)"; "Debug Mode" = "Debug Mode"; "Dictionary" = "Dictionary"; +"Directly commit lowercased letters" = "Directly commit lowercased letters"; +"Directly commit uppercased letters" = "Directly commit uppercased letters"; "Emulating select-candidate-per-character mode" = "Emulating select-candidate-per-character mode"; "Enable CNS11643 Support (2022-07-20)" = "Enable CNS11643 Support (2022-07-20)"; "Enable Space key for calling candidate window" = "Enable Space key for calling candidate window"; @@ -143,8 +146,8 @@ "IBM" = "IBM"; "in front of the phrase (like macOS built-in Zhuyin IME)" = "in front of the phrase (like macOS built-in Zhuyin IME)"; "Japanese" = "Japanese"; -"Keyboard" = "Keyboard"; "Keyboard Shortcuts:" = "Keyboard Shortcuts:"; +"Keyboard" = "Keyboard"; "Misc Settings:" = "Misc Settings:"; "MiTAC" = "MiTAC"; "Non-QWERTY alphanumeral keyboard layouts are for Hanyu Pinyin parser only." = "Non-QWERTY alphanumeral keyboard layouts are for Hanyu Pinyin parser only."; @@ -155,6 +158,7 @@ "Secondary Pinyin with Numeral Intonation" = "Secondary Pinyin with Numeral Intonation"; "Seigyou" = "Seigyou (JinYei)"; "Selection Keys:" = "Selection Keys:"; +"Shift+Letter:" = "Shift+Letter:"; "Show Hanyu-Pinyin in the inline composition buffer & tooltip" = "Show Hanyu-Pinyin in the inline composition buffer & tooltip"; "Show page buttons in candidate window" = "Show page buttons in candidate window"; "Simplified Chinese" = "Simplified Chinese"; @@ -163,6 +167,7 @@ "Starlight" = "Starlight"; "Stop farting (when typed phonetic combination is invalid, etc.)" = "Stop farting (when typed phonetic combination is invalid, etc.)"; "Traditional Chinese" = "Traditional Chinese"; +"Type them into inline composition buffer" = "Type them into inline composition buffer"; "Typing Style:" = "Typing Style:"; "UI Language:" = "UI Language:"; "Universal Pinyin with Numeral Intonation" = "Universal Pinyin with Numeral Intonation"; diff --git a/Source/Resources/ja.lproj/Localizable.strings b/Source/Resources/ja.lproj/Localizable.strings index 9df877d1..65626401 100644 --- a/Source/Resources/ja.lproj/Localizable.strings +++ b/Source/Resources/ja.lproj/Localizable.strings @@ -113,6 +113,7 @@ "Choose or hit Enter to confim your prefered keys for selecting candidates." = "お好きなる言選り用キー陣列をご指定ください。新しい組み合わせは Enter で効かす。"; "Choose the behavior of (Shift+)Space key with candidates." = "入力候補についての (Shift+)Space キーの輪番切替対象をご指定ください。"; "Choose the behavior of (Shift+)Tab key in the candidate window." = "入力候補陳列での (Shift+)Tab キーの輪番切替対象をご指定ください。"; +"Choose the behavior of Shift+Letter key with letter inputs." = "Shift+文字キーの行為をご指定ください。"; "Choose the cursor position where you want to list possible candidates." = "カーソルはどこで入力候補を呼び出すかとご指定ださい。"; "Choose the macOS-level basic keyboard layout." = "macOS 基礎キーボード配置をご指定ください。"; "Choose the phonetic layout for Mandarin parser." = "共通語分析器の注音配列をご指定ください。"; @@ -123,6 +124,8 @@ "Dachen 26 (libChewing)" = "酷音大千 26 キー配列"; "Debug Mode" = "欠陥辿着モード"; "Dictionary" = "辞書設定"; +"Directly commit lowercased letters" = "ローマ字(小文字)を直接出力"; +"Directly commit uppercased letters" = "ローマ字(大文字)を直接出力"; "Emulating select-candidate-per-character mode" = "漢字1つづつ全候補選択入力モード"; "Enable CNS11643 Support (2022-07-20)" = "全字庫モード // 入力可能な漢字数を倍増す (2022-07-20)"; "Enable Space key for calling candidate window" = "Space キーで入力候補を呼び出す"; @@ -143,8 +146,8 @@ "IBM" = "IBM 配列"; "in front of the phrase (like macOS built-in Zhuyin IME)" = "単語の前で // macOS 内蔵注音入力のやり方"; "Japanese" = "和語"; -"Keyboard" = "配列設定"; "Keyboard Shortcuts:" = "ショートカット:"; +"Keyboard" = "配列設定"; "Misc Settings:" = "他の設定:"; "MiTAC" = "神通配列"; "Non-QWERTY alphanumeral keyboard layouts are for Hanyu Pinyin parser only." = "QWERTY 以外の英数キーボードは漢語弁音以外の配列に不適用。"; @@ -155,6 +158,7 @@ "Secondary Pinyin with Numeral Intonation" = "国音二式 (ローマ字+数字音調)"; "Seigyou" = "精業配列"; "Selection Keys:" = "言選り用キー:"; +"Shift+Letter:" = "Shift+文字キー:"; "Show Hanyu-Pinyin in the inline composition buffer & tooltip" = "弁音合併入力(入力緩衝列とヒントで音読みを漢語弁音に)"; "Show page buttons in candidate window" = "入力候補陳列の側にページボタンを表示"; "Simplified Chinese" = "簡体中国語"; @@ -163,6 +167,7 @@ "Starlight" = "星光配列"; "Stop farting (when typed phonetic combination is invalid, etc.)" = "マナーモード // 外すと入力間違った時に変な声が出る"; "Traditional Chinese" = "繁体中国語"; +"Type them into inline composition buffer" = "入力緩衝列にローマ字入力"; "Typing Style:" = "入力習慣:"; "UI Language:" = "表示用言語:"; "Universal Pinyin with Numeral Intonation" = "汎用弁音 (ローマ字+数字音調)"; diff --git a/Source/Resources/zh-Hans.lproj/Localizable.strings b/Source/Resources/zh-Hans.lproj/Localizable.strings index 1c1113f4..14b6b4c8 100644 --- a/Source/Resources/zh-Hans.lproj/Localizable.strings +++ b/Source/Resources/zh-Hans.lproj/Localizable.strings @@ -113,6 +113,7 @@ "Choose or hit Enter to confim your prefered keys for selecting candidates." = "请选择您所偏好的用来选字的按键组合。自订组合需敲 Enter 键生效。"; "Choose the behavior of (Shift+)Space key with candidates." = "指定 (Shift+)空格键 对候选字词而言的轮替操作对象。"; "Choose the behavior of (Shift+)Tab key in the candidate window." = "指定 (Shift+)Tab 在选字窗内的轮替操作对象。"; +"Choose the behavior of Shift+Letter key with letter inputs." = "指定 Shift+字母键 的行为。"; "Choose the cursor position where you want to list possible candidates." = "请选择用以触发选字的游标相对位置。"; "Choose the macOS-level basic keyboard layout." = "请选择 macOS 基础键盘布局。"; "Choose the phonetic layout for Mandarin parser." = "请指定普通话/国音分析器所使用的注音排列。"; @@ -123,6 +124,8 @@ "Dachen 26 (libChewing)" = "酷音大千二十六键排列"; "Debug Mode" = "侦错模式"; "Dictionary" = "辞典"; +"Directly commit lowercased letters" = "直接递交小写字母"; +"Directly commit uppercased letters" = "直接递交大写字母"; "Emulating select-candidate-per-character mode" = "模拟 90 年代前期注音逐字选字输入风格"; "Enable CNS11643 Support (2022-07-20)" = "启用 CNS11643 全字库支援 (2022-07-20)"; "Enable Space key for calling candidate window" = "敲空格键以呼出候选字窗"; @@ -144,8 +147,8 @@ "IBM" = "IBM 排列"; "in front of the phrase (like macOS built-in Zhuyin IME)" = "将游标置于词语前方 // macOS 内建注音风格"; "Japanese" = "和语"; -"Keyboard" = "键盘"; "Keyboard Shortcuts:" = "键盘快捷键:"; +"Keyboard" = "键盘"; "Misc Settings:" = "杂项:"; "MiTAC" = "神通排列"; "Non-QWERTY alphanumeral keyboard layouts are for Hanyu Pinyin parser only." = "QWERTY 以外的英数布局是为了汉语拼音排列使用者而准备的。"; @@ -156,6 +159,7 @@ "Secondary Pinyin with Numeral Intonation" = "国音二式+数字标调"; "Seigyou" = "精业排列"; "Selection Keys:" = "选字键:"; +"Shift+Letter:" = "Shift+字母键:"; "Show Hanyu-Pinyin in the inline composition buffer & tooltip" = "拼音并击(组字区与工具提示内显示汉语拼音)"; "Show page buttons in candidate window" = "在选字窗内显示翻页按钮"; "Simplified Chinese" = "简体中文"; @@ -164,6 +168,7 @@ "Starlight" = "星光排列"; "Stop farting (when typed phonetic combination is invalid, etc.)" = "廉耻模式 // 取消勾选的话,敲错字时会有异音"; "Traditional Chinese" = "繁体中文"; +"Type them into inline composition buffer" = "直接键入内文组字区"; "Typing Style:" = "输入风格:"; "UI Language:" = "介面语言:"; "Universal Pinyin with Numeral Intonation" = "通用拼音+数字标调"; diff --git a/Source/Resources/zh-Hant.lproj/Localizable.strings b/Source/Resources/zh-Hant.lproj/Localizable.strings index 4f2e921a..17cc4a4f 100644 --- a/Source/Resources/zh-Hant.lproj/Localizable.strings +++ b/Source/Resources/zh-Hant.lproj/Localizable.strings @@ -113,6 +113,7 @@ "Choose or hit Enter to confim your prefered keys for selecting candidates." = "請選擇您所偏好的用來選字的按鍵組合。自訂組合需敲 Enter 鍵生效。"; "Choose the behavior of (Shift+)Space key with candidates." = "指定 (Shift+)空格鍵 對候選字詞而言的輪替操作對象。"; "Choose the behavior of (Shift+)Tab key in the candidate window." = "指定 (Shift+)Tab 在選字窗內的輪替操作對象。"; +"Choose the behavior of Shift+Letter key with letter inputs." = "指定 Shift+字母鍵 的行為。"; "Choose the cursor position where you want to list possible candidates." = "請選擇用以觸發選字的游標相對位置。"; "Choose the macOS-level basic keyboard layout." = "請選擇 macOS 基礎鍵盤佈局。"; "Choose the phonetic layout for Mandarin parser." = "請指定普通話/國音分析器所使用的注音排列。"; @@ -123,6 +124,8 @@ "Dachen 26 (libChewing)" = "酷音大千二十六鍵排列"; "Debug Mode" = "偵錯模式"; "Dictionary" = "辭典"; +"Directly commit lowercased letters" = "直接遞交小寫字母"; +"Directly commit uppercased letters" = "直接遞交大寫字母"; "Emulating select-candidate-per-character mode" = "模擬 90 年代前期注音逐字選字輸入風格"; "Enable CNS11643 Support (2022-07-20)" = "啟用 CNS11643 全字庫支援 (2022-07-20)"; "Enable Space key for calling candidate window" = "敲空格鍵以呼出候選字窗"; @@ -143,8 +146,8 @@ "IBM" = "IBM 排列"; "in front of the phrase (like macOS built-in Zhuyin IME)" = "將游標置於詞語前方 // macOS 內建注音風格"; "Japanese" = "和語"; -"Keyboard" = "鍵盤"; "Keyboard Shortcuts:" = "鍵盤快速鍵:"; +"Keyboard" = "鍵盤"; "Misc Settings:" = "雜項:"; "MiTAC" = "神通排列"; "Non-QWERTY alphanumeral keyboard layouts are for Hanyu Pinyin parser only." = "QWERTY 以外的英數佈局是為了漢語拼音排列使用者而準備的。"; @@ -155,6 +158,7 @@ "Secondary Pinyin with Numeral Intonation" = "國音二式+數字標調"; "Seigyou" = "精業排列"; "Selection Keys:" = "選字鍵:"; +"Shift+Letter:" = "Shift+字母鍵:"; "Show Hanyu-Pinyin in the inline composition buffer & tooltip" = "拼音並擊(組字區與工具提示內顯示漢語拼音)"; "Show page buttons in candidate window" = "在選字窗內顯示翻頁按鈕"; "Simplified Chinese" = "簡體中文"; @@ -163,6 +167,7 @@ "Starlight" = "星光排列"; "Stop farting (when typed phonetic combination is invalid, etc.)" = "廉恥模式 // 取消勾選的話,敲錯字時會有異音"; "Traditional Chinese" = "繁體中文"; +"Type them into inline composition buffer" = "直接鍵入內文組字區"; "Typing Style:" = "輸入風格:"; "UI Language:" = "介面語言:"; "Universal Pinyin with Numeral Intonation" = "通用拼音+數字標調"; diff --git a/Source/UI/PrefUI/suiPrefPaneExperience.swift b/Source/UI/PrefUI/suiPrefPaneExperience.swift index ab8958c6..a95c7b57 100644 --- a/Source/UI/PrefUI/suiPrefPaneExperience.swift +++ b/Source/UI/PrefUI/suiPrefPaneExperience.swift @@ -37,6 +37,8 @@ struct suiPrefPaneExperience: View { forKey: UserDef.kKeepReadingUponCompositionError.rawValue) @State private var selTogglingAlphanumericalModeWithLShift = UserDefaults.standard.bool( forKey: UserDef.kTogglingAlphanumericalModeWithLShift.rawValue) + @State private var selUpperCaseLetterKeyBehavior = UserDefaults.standard.integer( + forKey: UserDef.kUpperCaseLetterKeyBehavior.rawValue) private let contentWidth: Double = { switch mgrPrefs.appleLanguages[0] { case "ja": @@ -123,6 +125,19 @@ struct suiPrefPaneExperience: View { Text(LocalizedStringKey("Choose the behavior of (Shift+)Space key with candidates.")) .preferenceDescription() } + Preferences.Section(label: { Text(LocalizedStringKey("Shift+Letter:")) }) { + Picker("", selection: $selUpperCaseLetterKeyBehavior) { + Text(LocalizedStringKey("Type them into inline composition buffer")).tag(0) + Text(LocalizedStringKey("Directly commit lowercased letters")).tag(1) + Text(LocalizedStringKey("Directly commit uppercased letters")).tag(2) + }.onChange(of: selUpperCaseLetterKeyBehavior) { value in + mgrPrefs.upperCaseLetterKeyBehavior = value + } + .labelsHidden() + .pickerStyle(RadioGroupPickerStyle()) + Text(LocalizedStringKey("Choose the behavior of Shift+Letter key with letter inputs.")) + .preferenceDescription() + } Preferences.Section(label: { Text(LocalizedStringKey("Misc Settings:")) }) { Toggle( LocalizedStringKey("Enable Space key for calling candidate window"),