diff --git a/Source/Resources/Base.lproj/Localizable.strings b/Source/Resources/Base.lproj/Localizable.strings index 77feb523..0438965e 100644 --- a/Source/Resources/Base.lproj/Localizable.strings +++ b/Source/Resources/Base.lproj/Localizable.strings @@ -130,6 +130,7 @@ "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:"; "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."; diff --git a/Source/Resources/en.lproj/Localizable.strings b/Source/Resources/en.lproj/Localizable.strings index 77feb523..0438965e 100644 --- a/Source/Resources/en.lproj/Localizable.strings +++ b/Source/Resources/en.lproj/Localizable.strings @@ -130,6 +130,7 @@ "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:"; "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."; diff --git a/Source/Resources/ja.lproj/Localizable.strings b/Source/Resources/ja.lproj/Localizable.strings index 812521c2..d3d58d5b 100644 --- a/Source/Resources/ja.lproj/Localizable.strings +++ b/Source/Resources/ja.lproj/Localizable.strings @@ -130,6 +130,7 @@ "in front of the phrase (like macOS built-in Zhuyin IME)" = "単語の前で // macOS 内蔵注音入力のやり方"; "Japanese" = "和語"; "Keyboard" = "配列設定"; +"Keyboard Shortcuts:" = "ショートカット:"; "Misc Settings:" = "他の設定:"; "MiTAC" = "神通配列"; "Non-QWERTY alphanumeral keyboard layouts are for Hanyu Pinyin parser only." = "QWERTY 以外の英数キーボードは漢語弁音以外の配列に不適用。"; diff --git a/Source/Resources/zh-Hans.lproj/Localizable.strings b/Source/Resources/zh-Hans.lproj/Localizable.strings index 928d130e..c8ef2517 100644 --- a/Source/Resources/zh-Hans.lproj/Localizable.strings +++ b/Source/Resources/zh-Hans.lproj/Localizable.strings @@ -15,7 +15,7 @@ "Not Now" = "以后再说"; "Visit Website" = "前往网站"; "You're currently using vChewing %@ (%@), a new version %@ (%@) is now available. Do you want to visit vChewing's website to download the version?%@" = "目前使用的威注音官方版本是 %1$@ (%2$@),网路上有更新版本 %3$@ (%4$@) 可供下载。是否要前往威注音网站下载新版来安装?%5$@"; -"Force KangXi Writing" = "康熙繁体字模式"; +"Force KangXi Writing" = "康熙正体字模式"; "NotificationSwitchON" = "✔ 已启用"; "NotificationSwitchOFF" = "✘ 已停用"; "Edit User Phrases…" = "编辑自订语汇…"; @@ -131,6 +131,7 @@ "in front of the phrase (like macOS built-in Zhuyin IME)" = "将游标置于词语前方 // macOS 内建注音风格"; "Japanese" = "和语"; "Keyboard" = "键盘"; +"Keyboard Shortcuts:" = "键盘快捷键:"; "Misc Settings:" = "杂项:"; "MiTAC" = "神通排列"; "Non-QWERTY alphanumeral keyboard layouts are for Hanyu Pinyin parser only." = "QWERTY 以外的英数布局是为了汉语拼音排列使用者而准备的。"; diff --git a/Source/Resources/zh-Hant.lproj/Localizable.strings b/Source/Resources/zh-Hant.lproj/Localizable.strings index faa80a99..3a1579cd 100644 --- a/Source/Resources/zh-Hant.lproj/Localizable.strings +++ b/Source/Resources/zh-Hant.lproj/Localizable.strings @@ -15,7 +15,7 @@ "Not Now" = "以後再說"; "Visit Website" = "前往網站"; "You're currently using vChewing %@ (%@), a new version %@ (%@) is now available. Do you want to visit vChewing's website to download the version?%@" = "目前使用的威注音官方版本是 %1$@ (%2$@),網路上有更新版本 %3$@ (%4$@) 可供下載。是否要前往威注音網站下載新版來安裝?%5$@"; -"Force KangXi Writing" = "康熙繁體字模式"; +"Force KangXi Writing" = "康熙正體字模式"; "NotificationSwitchON" = "✔ 已啟用"; "NotificationSwitchOFF" = "✘ 已停用"; "Edit User Phrases…" = "編輯自訂語彙…"; @@ -130,6 +130,7 @@ "in front of the phrase (like macOS built-in Zhuyin IME)" = "將游標置於詞語前方 // macOS 內建注音風格"; "Japanese" = "和語"; "Keyboard" = "鍵盤"; +"Keyboard Shortcuts:" = "鍵盤快速鍵:"; "Misc Settings:" = "雜項:"; "MiTAC" = "神通排列"; "Non-QWERTY alphanumeral keyboard layouts are for Hanyu Pinyin parser only." = "QWERTY 以外的英數佈局是為了漢語拼音排列使用者而準備的。"; diff --git a/Source/UI/PrefUI/suiPrefPaneKeyboard.swift b/Source/UI/PrefUI/suiPrefPaneKeyboard.swift index edeed2b8..27fbae6e 100644 --- a/Source/UI/PrefUI/suiPrefPaneKeyboard.swift +++ b/Source/UI/PrefUI/suiPrefPaneKeyboard.swift @@ -29,6 +29,15 @@ struct suiPrefPaneKeyboard: View { @State private var selMandarinParser = UserDefaults.standard.integer(forKey: UserDef.kMandarinParser) @State private var selBasicKeyboardLayout: String = UserDefaults.standard.string(forKey: UserDef.kBasicKeyboardLayout) ?? mgrPrefs.basicKeyboardLayout + + @State private var selUsingHotKeySCPC = UserDefaults.standard.bool(forKey: UserDef.kUsingHotKeySCPC) + @State private var selUsingHotKeyAssociates = UserDefaults.standard.bool(forKey: UserDef.kUsingHotKeyAssociates) + @State private var selUsingHotKeyCNS = UserDefaults.standard.bool(forKey: UserDef.kUsingHotKeyCNS) + @State private var selUsingHotKeyKangXi = UserDefaults.standard.bool(forKey: UserDef.kUsingHotKeyKangXi) + @State private var selUsingHotKeyJIS = UserDefaults.standard.bool(forKey: UserDef.kUsingHotKeyJIS) + @State private var selUsingHotKeyHalfWidthASCII = UserDefaults.standard.bool( + forKey: UserDef.kUsingHotKeyHalfWidthASCII) + private let contentWidth: Double = { switch mgrPrefs.appleLanguages[0] { case "ja": @@ -122,6 +131,50 @@ struct suiPrefPaneKeyboard: View { Text(LocalizedStringKey("Choose the macOS-level basic keyboard layout.")) .preferenceDescription() } + Preferences.Section(bottomDivider: true, label: { Text(LocalizedStringKey("Keyboard Shortcuts:")) }) { + Toggle( + LocalizedStringKey("Per-Char Select Mode"), + isOn: $selUsingHotKeySCPC + ).onChange(of: selUsingHotKeySCPC) { value in + mgrPrefs.usingHotKeySCPC = value + selUsingHotKeySCPC = value + } + Toggle( + LocalizedStringKey("Per-Char Associated Phrases"), + isOn: $selUsingHotKeyAssociates + ).onChange(of: selUsingHotKeyAssociates) { value in + mgrPrefs.usingHotKeyAssociates = value + selUsingHotKeyAssociates = value + } + Toggle( + LocalizedStringKey("CNS11643 Mode"), + isOn: $selUsingHotKeyCNS + ).onChange(of: selUsingHotKeyCNS) { value in + mgrPrefs.usingHotKeyCNS = value + selUsingHotKeyCNS = value + } + Toggle( + LocalizedStringKey("Force KangXi Writing"), + isOn: $selUsingHotKeyKangXi + ).onChange(of: selUsingHotKeyKangXi) { value in + mgrPrefs.usingHotKeyKangXi = value + selUsingHotKeyKangXi = value + } + Toggle( + LocalizedStringKey("JIS Shinjitai Output"), + isOn: $selUsingHotKeyJIS + ).onChange(of: selUsingHotKeyJIS) { value in + mgrPrefs.usingHotKeyJIS = value + selUsingHotKeyJIS = value + } + Toggle( + LocalizedStringKey("Half-Width Punctuation Mode"), + isOn: $selUsingHotKeyHalfWidthASCII + ).onChange(of: selUsingHotKeyHalfWidthASCII) { value in + mgrPrefs.usingHotKeyHalfWidthASCII = value + selUsingHotKeyHalfWidthASCII = value + } + } } Divider() Preferences.Container(contentWidth: contentWidth) {