From deb968ca70ce2ff532fe1dabb4d3ae214806d217 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Mon, 12 Sep 2022 18:11:25 +0800 Subject: [PATCH] PrefUI // +allowedAlphanumericalTISInputSources, etc. --- .../PrefUI/suiPrefPaneKeyboard.swift | 41 +++++++++++++++---- .../Resources/Base.lproj/Localizable.strings | 5 ++- Source/Resources/en.lproj/Localizable.strings | 5 ++- Source/Resources/ja.lproj/Localizable.strings | 5 ++- .../zh-Hans.lproj/Localizable.strings | 5 ++- .../zh-Hant.lproj/Localizable.strings | 5 ++- 6 files changed, 49 insertions(+), 17 deletions(-) diff --git a/Source/Modules/UIModules/PrefUI/suiPrefPaneKeyboard.swift b/Source/Modules/UIModules/PrefUI/suiPrefPaneKeyboard.swift index d75bea8b..53049c55 100644 --- a/Source/Modules/UIModules/PrefUI/suiPrefPaneKeyboard.swift +++ b/Source/Modules/UIModules/PrefUI/suiPrefPaneKeyboard.swift @@ -16,6 +16,9 @@ struct suiPrefPaneKeyboard: View { @State private var selMandarinParser = UserDefaults.standard.integer(forKey: UserDef.kMandarinParser.rawValue) @State private var selBasicKeyboardLayout: String = UserDefaults.standard.string(forKey: UserDef.kBasicKeyboardLayout.rawValue) ?? mgrPrefs.basicKeyboardLayout + @State private var selAlphanumericalKeyboardLayout: String = + UserDefaults.standard.string(forKey: UserDef.kAlphanumericalKeyboardLayout.rawValue) + ?? mgrPrefs.alphanumericalKeyboardLayout @State private var selUsingHotKeySCPC = UserDefaults.standard.bool(forKey: UserDef.kUsingHotKeySCPC.rawValue) @State private var selUsingHotKeyAssociates = UserDefaults.standard.bool( @@ -163,7 +166,7 @@ struct suiPrefPaneKeyboard: View { Spacer().frame(width: 30) } } - Preferences.Section(bottomDivider: true, label: { Text(LocalizedStringKey("Basic Keyboard Layout:")) }) { + Preferences.Section(label: { Text(LocalizedStringKey("Basic Keyboard Layout:")) }) { HStack { Picker( "", @@ -191,13 +194,37 @@ struct suiPrefPaneKeyboard: View { HStack { Text( NSLocalizedString( - "Choose the macOS-level basic keyboard layout.", + "Choose the macOS-level basic keyboard layout. Non-QWERTY alphanumerical keyboard layouts are for Pinyin parser only.", comment: "" - ) + (mgrPrefs.appleLanguages[0].contains("en") ? " " : "") - + NSLocalizedString( - "Non-QWERTY alphanumerical keyboard layouts are for Pinyin parser only.", - comment: "" - ) + ) + ) + .preferenceDescription().fixedSize(horizontal: false, vertical: true) + Spacer().frame(width: 30) + } + } + Preferences.Section(bottomDivider: true, label: { Text(LocalizedStringKey("Alphanumerical Layout:")) }) { + HStack { + Picker( + "", + selection: $selAlphanumericalKeyboardLayout.onChange { + mgrPrefs.alphanumericalKeyboardLayout = selAlphanumericalKeyboardLayout + } + ) { + ForEach(0...(IMKHelper.allowedAlphanumericalTISInputSources.count - 1), id: \.self) { id in + if let theEntry = IMKHelper.allowedAlphanumericalTISInputSources[id] { + Text(theEntry.vChewingLocalizedName).tag(theEntry.identifier) + } + }.id(UUID()) + } + .labelsHidden() + .frame(width: 240.0) + } + HStack { + Text( + NSLocalizedString( + "Choose the macOS-level alphanumerical keyboard layout. This setting is for the alphanumerical mode toggled by Shift key.", + comment: "" + ) ) .preferenceDescription().fixedSize(horizontal: false, vertical: true) Spacer().frame(width: 30) diff --git a/Source/Resources/Base.lproj/Localizable.strings b/Source/Resources/Base.lproj/Localizable.strings index 39aea529..7fae8b95 100644 --- a/Source/Resources/Base.lproj/Localizable.strings +++ b/Source/Resources/Base.lproj/Localizable.strings @@ -115,6 +115,7 @@ "Allow backspace-editing miscomposed readings" = "Allow backspace-editing miscomposed readings"; "Allow boosting / excluding a candidate of single kanji" = "Allow boosting / excluding a candidate of single kanji"; "Allow using Enter key to confirm associated candidate selection" = "Allow using Enter key to confirm associated candidate selection"; +"Alphanumerical Layout:" = "Alphanumerical Layout:"; "Also toggle alphanumerical mode with Left-Shift" = "Also toggle alphanumerical mode with Left-Shift"; "Always drop the previous reading" = "Always drop the previous reading"; "Always show tooltip texts horizontally" = "Always show tooltip texts horizontally"; @@ -142,7 +143,8 @@ "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 macOS-level alphanumerical keyboard layout. This setting is for the alphanumerical mode toggled by Shift key." = "Choose the macOS-level alphanumerical keyboard layout. This setting is for the alphanumerical mode toggled by Shift key."; +"Choose the macOS-level basic keyboard layout. Non-QWERTY alphanumerical keyboard layouts are for Pinyin parser only." = "Choose the macOS-level basic keyboard layout. Non-QWERTY alphanumerical keyboard layouts are for Pinyin parser only."; "Choose the phonetic layout for Mandarin parser." = "Choose the phonetic layout for Mandarin parser."; "Choose your desired user data folder path. Will be omitted if invalid." = "Choose your desired user data folder path. Will be omitted if invalid."; "Choose your preferred layout of the candidate window." = "Choose your preferred layout of the candidate window."; @@ -190,7 +192,6 @@ "Keyboard" = "Keyboard"; "Misc Settings:" = "Misc Settings:"; "MiTAC" = "MiTAC"; -"Non-QWERTY alphanumerical keyboard layouts are for Pinyin parser only." = "Non-QWERTY alphanumerical keyboard layouts are for Pinyin parser only."; "Note: The “Delete ⌫” key on Mac keyboard is named as “BackSpace ⌫” here in order to distinguish the real “Delete ⌦” key from full-sized desktop keyboards. If you want to use the real “Delete ⌦” key on a Mac keyboard with no numpad equipped, you have to press “Fn+⌫” instead." = "Note: The “Delete ⌫” key on Mac keyboard is named as “BackSpace ⌫” here in order to distinguish the real “Delete ⌦” key from full-sized desktop keyboards. If you want to use the real “Delete ⌦” key on a Mac keyboard with no numpad equipped, you have to press “Fn+⌫” instead."; "Only override the intonation of the previous reading if different" = "Only override the intonation of the previous reading if different"; "Only use this with known Chromium-based browsers" = "Only use this with known Chromium-based browsers"; diff --git a/Source/Resources/en.lproj/Localizable.strings b/Source/Resources/en.lproj/Localizable.strings index 39aea529..7fae8b95 100644 --- a/Source/Resources/en.lproj/Localizable.strings +++ b/Source/Resources/en.lproj/Localizable.strings @@ -115,6 +115,7 @@ "Allow backspace-editing miscomposed readings" = "Allow backspace-editing miscomposed readings"; "Allow boosting / excluding a candidate of single kanji" = "Allow boosting / excluding a candidate of single kanji"; "Allow using Enter key to confirm associated candidate selection" = "Allow using Enter key to confirm associated candidate selection"; +"Alphanumerical Layout:" = "Alphanumerical Layout:"; "Also toggle alphanumerical mode with Left-Shift" = "Also toggle alphanumerical mode with Left-Shift"; "Always drop the previous reading" = "Always drop the previous reading"; "Always show tooltip texts horizontally" = "Always show tooltip texts horizontally"; @@ -142,7 +143,8 @@ "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 macOS-level alphanumerical keyboard layout. This setting is for the alphanumerical mode toggled by Shift key." = "Choose the macOS-level alphanumerical keyboard layout. This setting is for the alphanumerical mode toggled by Shift key."; +"Choose the macOS-level basic keyboard layout. Non-QWERTY alphanumerical keyboard layouts are for Pinyin parser only." = "Choose the macOS-level basic keyboard layout. Non-QWERTY alphanumerical keyboard layouts are for Pinyin parser only."; "Choose the phonetic layout for Mandarin parser." = "Choose the phonetic layout for Mandarin parser."; "Choose your desired user data folder path. Will be omitted if invalid." = "Choose your desired user data folder path. Will be omitted if invalid."; "Choose your preferred layout of the candidate window." = "Choose your preferred layout of the candidate window."; @@ -190,7 +192,6 @@ "Keyboard" = "Keyboard"; "Misc Settings:" = "Misc Settings:"; "MiTAC" = "MiTAC"; -"Non-QWERTY alphanumerical keyboard layouts are for Pinyin parser only." = "Non-QWERTY alphanumerical keyboard layouts are for Pinyin parser only."; "Note: The “Delete ⌫” key on Mac keyboard is named as “BackSpace ⌫” here in order to distinguish the real “Delete ⌦” key from full-sized desktop keyboards. If you want to use the real “Delete ⌦” key on a Mac keyboard with no numpad equipped, you have to press “Fn+⌫” instead." = "Note: The “Delete ⌫” key on Mac keyboard is named as “BackSpace ⌫” here in order to distinguish the real “Delete ⌦” key from full-sized desktop keyboards. If you want to use the real “Delete ⌦” key on a Mac keyboard with no numpad equipped, you have to press “Fn+⌫” instead."; "Only override the intonation of the previous reading if different" = "Only override the intonation of the previous reading if different"; "Only use this with known Chromium-based browsers" = "Only use this with known Chromium-based browsers"; diff --git a/Source/Resources/ja.lproj/Localizable.strings b/Source/Resources/ja.lproj/Localizable.strings index 0e969efb..fecd955d 100644 --- a/Source/Resources/ja.lproj/Localizable.strings +++ b/Source/Resources/ja.lproj/Localizable.strings @@ -115,6 +115,7 @@ "Allow backspace-editing miscomposed readings" = "効かぬ音読みを BackSpace で再編集"; "Allow boosting / excluding a candidate of single kanji" = "即排除/即最優先にできる候補の文字数の最低限は1字とする"; "Allow using Enter key to confirm associated candidate selection" = "Enter キーを連想語彙候補の確認のために使う"; +"Alphanumerical Layout:" = "英数キーボード:"; "Also toggle alphanumerical mode with Left-Shift" = "左側の Shift キーでも英数入力モードの切り替え"; "Always drop the previous reading" = "カーソルの後部の音読みを常に削除する"; "Always show tooltip texts horizontally" = "ヒントを常に横書きにする"; @@ -142,7 +143,8 @@ "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 macOS-level alphanumerical keyboard layout. This setting is for the alphanumerical mode toggled by Shift key." = "macOS 英数キーボード配置をご指定ください。「Shift キーで切り替える英数入力モード」に使われる配置である。"; +"Choose the macOS-level basic keyboard layout. Non-QWERTY alphanumerical keyboard layouts are for Pinyin parser only." = "macOS 基礎キーボード配置をご指定ください。QWERTY 以外の英数キーボードは弁音以外の配列に不適用。"; "Choose the phonetic layout for Mandarin parser." = "共通語分析器の注音配列をご指定ください。"; "Choose your desired user data folder path. Will be omitted if invalid." = "欲しがるユーザー辞書保存先をご指定ください。無効なる保存先設定は省かれる。"; "Choose your preferred layout of the candidate window." = "入力候補陳列の仕様をご指定ください。"; @@ -190,7 +192,6 @@ "Keyboard" = "配列設定"; "Misc Settings:" = "他の設定:"; "MiTAC" = "神通配列"; -"Non-QWERTY alphanumerical keyboard layouts are for Pinyin parser only." = "QWERTY 以外の英数キーボードは弁音以外の配列に不適用。"; "Note: The “Delete ⌫” key on Mac keyboard is named as “BackSpace ⌫” here in order to distinguish the real “Delete ⌦” key from full-sized desktop keyboards. If you want to use the real “Delete ⌦” key on a Mac keyboard with no numpad equipped, you have to press “Fn+⌫” instead." = "ご注意:Mac キーボードの「Delete ⌫」キーはここで「BackSpace ⌫」と呼ばれ、それはパソコンの常識としての本物の「Delete ⌦」と区別するためである。もし、テンキーの付いていない Mac キーボードで本物の「Delete ⌦」を使いたければ、代わりに「Fn+⌫」をご使用ください。"; "Only override the intonation of the previous reading if different" = "カーソルの後部の音読みの異なる音調だけを上書きする"; "Only use this with known Chromium-based browsers" = "有名なる Chromium 系ブラウザーだけに、この装置を起用"; diff --git a/Source/Resources/zh-Hans.lproj/Localizable.strings b/Source/Resources/zh-Hans.lproj/Localizable.strings index 487eec0a..52754d5c 100644 --- a/Source/Resources/zh-Hans.lproj/Localizable.strings +++ b/Source/Resources/zh-Hans.lproj/Localizable.strings @@ -115,6 +115,7 @@ "Allow backspace-editing miscomposed readings" = "允许对无效的读音使用 BackSpace 编辑"; "Allow boosting / excluding a candidate of single kanji" = "将可以就地升权/排除的候选字词的最短词长设为单个汉字"; "Allow using Enter key to confirm associated candidate selection" = "允许使用 Enter 确认当前选中的联想词"; +"Alphanumerical Layout:" = "英数键盘布局:"; "Also toggle alphanumerical mode with Left-Shift" = "也允许使用左侧的 Shift 键盘切换英数输入模式"; "Always drop the previous reading" = "始终剔除游标正后方的字音"; "Always show tooltip texts horizontally" = "始终使用横排来显示工具提示视窗"; @@ -142,7 +143,8 @@ "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 macOS-level alphanumerical keyboard layout. This setting is for the alphanumerical mode toggled by Shift key." = "请选择 macOS 英数键盘布局。该布局用于以 Shift 切换至的英数输入模式。"; +"Choose the macOS-level basic keyboard layout. Non-QWERTY alphanumerical keyboard layouts are for Pinyin parser only." = "请选择 macOS 基础键盘布局。QWERTY 以外的英数布局是为了拼音排列使用者而准备的。"; "Choose the phonetic layout for Mandarin parser." = "请指定普通话/国音分析器所使用的注音排列。"; "Choose your desired user data folder path. Will be omitted if invalid." = "请在此指定您想指定的使用者语汇档案目录。无效值会被忽略。"; "Choose your preferred layout of the candidate window." = "选择您所偏好的候选字窗布局。"; @@ -190,7 +192,6 @@ "Keyboard" = "键盘设定"; "Misc Settings:" = "杂项:"; "MiTAC" = "神通排列"; -"Non-QWERTY alphanumerical keyboard layouts are for Pinyin parser only." = "QWERTY 以外的英数布局是为了拼音排列使用者而准备的。"; "Note: The “Delete ⌫” key on Mac keyboard is named as “BackSpace ⌫” here in order to distinguish the real “Delete ⌦” key from full-sized desktop keyboards. If you want to use the real “Delete ⌦” key on a Mac keyboard with no numpad equipped, you have to press “Fn+⌫” instead." = "注意:Mac 键盘的「Delete ⌫」键在此被称作「BackSpace 退格键 ⌫」以与 PC 键盘的真正的「Delete ⌦」键彼此区分开。若您想在没有数字小键盘的 Mac 电脑上使用真正的「Delete ⌦」按键的话,请改用「Fn+⌫」。"; "Only override the intonation of the previous reading if different" = "仅在键入的声调与游标正后方的字音不同时,尝试覆写"; "Only use this with known Chromium-based browsers" = "仅针对知名的 Chromium 核心的浏览器启用该措施"; diff --git a/Source/Resources/zh-Hant.lproj/Localizable.strings b/Source/Resources/zh-Hant.lproj/Localizable.strings index 1886dff6..e681e0d5 100644 --- a/Source/Resources/zh-Hant.lproj/Localizable.strings +++ b/Source/Resources/zh-Hant.lproj/Localizable.strings @@ -115,6 +115,7 @@ "Allow backspace-editing miscomposed readings" = "允許對無效的讀音使用 BackSpace 編輯"; "Allow boosting / excluding a candidate of single kanji" = "將可以就地升權/排除的候選字詞的最短詞長設為單個漢字"; "Allow using Enter key to confirm associated candidate selection" = "允許使用 Enter 確認當前選中的聯想詞"; +"Alphanumerical Layout:" = "英數鍵盤佈局:"; "Also toggle alphanumerical mode with Left-Shift" = "也允許使用左側的 Shift 鍵盤切換英數輸入模式"; "Always drop the previous reading" = "始終剔除游標正後方的字音"; "Always show tooltip texts horizontally" = "始終使用橫排來顯示工具提示視窗"; @@ -142,7 +143,8 @@ "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 macOS-level alphanumerical keyboard layout. This setting is for the alphanumerical mode toggled by Shift key." = "請選擇 macOS 英數鍵盤佈局。該佈局用於以 Shift 切換至的英數輸入模式。"; +"Choose the macOS-level basic keyboard layout. Non-QWERTY alphanumerical keyboard layouts are for Pinyin parser only." = "請選擇 macOS 基礎鍵盤佈局。QWERTY 以外的英數佈局是為了拼音排列使用者而準備的。"; "Choose the phonetic layout for Mandarin parser." = "請指定普通話/國音分析器所使用的注音排列。"; "Choose your desired user data folder path. Will be omitted if invalid." = "請在此指定您想指定的使用者語彙檔案目錄。無效值會被忽略。"; "Choose your preferred layout of the candidate window." = "選擇您所偏好的候選字窗佈局。"; @@ -190,7 +192,6 @@ "Keyboard" = "鍵盤設定"; "Misc Settings:" = "雜項:"; "MiTAC" = "神通排列"; -"Non-QWERTY alphanumerical keyboard layouts are for Pinyin parser only." = "QWERTY 以外的英數佈局是為了拼音排列使用者而準備的。"; "Note: The “Delete ⌫” key on Mac keyboard is named as “BackSpace ⌫” here in order to distinguish the real “Delete ⌦” key from full-sized desktop keyboards. If you want to use the real “Delete ⌦” key on a Mac keyboard with no numpad equipped, you have to press “Fn+⌫” instead." = "注意:Mac 鍵盤的「Delete ⌫」鍵在此被稱作「BackSpace 退格鍵 ⌫」以與 PC 鍵盤的真正的「Delete ⌦」鍵彼此區分開。若您想在沒有數字小鍵盤的 Mac 電腦上使用真正的「Delete ⌦」按鍵的話,請改用「Fn+⌫」。"; "Only override the intonation of the previous reading if different" = "僅在鍵入的聲調與游標正後方的字音不同時,嘗試覆寫"; "Only use this with known Chromium-based browsers" = "僅針對知名的 Chromium 核心的瀏覽器啟用該措施";