From 4e5e10dfbbcb7db0916f42fe363efd76e7110e70 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Sat, 14 May 2022 17:05:49 +0800 Subject: [PATCH] PrefUI // +showHanyuPinyinInCompositionBuffer. --- Source/Resources/Base.lproj/Localizable.strings | 1 + Source/Resources/en.lproj/Localizable.strings | 1 + Source/Resources/ja.lproj/Localizable.strings | 1 + Source/Resources/zh-Hans.lproj/Localizable.strings | 1 + Source/Resources/zh-Hant.lproj/Localizable.strings | 1 + Source/UI/PrefUI/suiPrefPaneGeneral.swift | 9 +++++++++ 6 files changed, 14 insertions(+) diff --git a/Source/Resources/Base.lproj/Localizable.strings b/Source/Resources/Base.lproj/Localizable.strings index 223c3dfd..6861371e 100644 --- a/Source/Resources/Base.lproj/Localizable.strings +++ b/Source/Resources/Base.lproj/Localizable.strings @@ -132,6 +132,7 @@ "Phonetic Parser:" = "Phonetic Parser:"; "Push the cursor in front of the phrase after selection" = "Push the cursor in front of the phrase after selection"; "Selection Keys:" = "Selection Keys:"; +"Show Hanyu-Pinyin in the inline composition buffer" = "Show Hanyu-Pinyin in the inline composition buffer"; "Show page buttons in candidate window" = "Show page buttons in candidate window"; "Simplified Chinese" = "Simplified Chinese"; "Space & ESC Key:" = "Space & ESC Key:"; diff --git a/Source/Resources/en.lproj/Localizable.strings b/Source/Resources/en.lproj/Localizable.strings index 223c3dfd..6861371e 100644 --- a/Source/Resources/en.lproj/Localizable.strings +++ b/Source/Resources/en.lproj/Localizable.strings @@ -132,6 +132,7 @@ "Phonetic Parser:" = "Phonetic Parser:"; "Push the cursor in front of the phrase after selection" = "Push the cursor in front of the phrase after selection"; "Selection Keys:" = "Selection Keys:"; +"Show Hanyu-Pinyin in the inline composition buffer" = "Show Hanyu-Pinyin in the inline composition buffer"; "Show page buttons in candidate window" = "Show page buttons in candidate window"; "Simplified Chinese" = "Simplified Chinese"; "Space & ESC Key:" = "Space & ESC Key:"; diff --git a/Source/Resources/ja.lproj/Localizable.strings b/Source/Resources/ja.lproj/Localizable.strings index 50be3fbf..6efa35c3 100644 --- a/Source/Resources/ja.lproj/Localizable.strings +++ b/Source/Resources/ja.lproj/Localizable.strings @@ -132,6 +132,7 @@ "Phonetic Parser:" = "注音配列:"; "Push the cursor in front of the phrase after selection" = "候補選択の直後、すぐカーソルを単語の向こうに推し進める"; "Selection Keys:" = "言選り用キー:"; +"Show Hanyu-Pinyin in the inline composition buffer" = "弁音合併入力(入力緩衝列で代わりに漢語弁音の音読み)"; "Show page buttons in candidate window" = "入力候補陳列の側にページボタンを表示"; "Simplified Chinese" = "簡体中国語"; "Space & ESC Key:" = "ESC と Space:"; diff --git a/Source/Resources/zh-Hans.lproj/Localizable.strings b/Source/Resources/zh-Hans.lproj/Localizable.strings index 2d33f0be..6de43112 100644 --- a/Source/Resources/zh-Hans.lproj/Localizable.strings +++ b/Source/Resources/zh-Hans.lproj/Localizable.strings @@ -132,6 +132,7 @@ "Phonetic Parser:" = "注音排列:"; "Push the cursor in front of the phrase after selection" = "在选字后将游标置于该字词的前方"; "Selection Keys:" = "选字键:"; +"Show Hanyu-Pinyin in the inline composition buffer" = "拼音并击模式(组字区内看到的是汉语拼音)"; "Show page buttons in candidate window" = "在选字窗内显示翻页按钮"; "Simplified Chinese" = "简体中文"; "Space & ESC Key:" = "ESC 与空格键:"; diff --git a/Source/Resources/zh-Hant.lproj/Localizable.strings b/Source/Resources/zh-Hant.lproj/Localizable.strings index 983f74ac..69f289a4 100644 --- a/Source/Resources/zh-Hant.lproj/Localizable.strings +++ b/Source/Resources/zh-Hant.lproj/Localizable.strings @@ -132,6 +132,7 @@ "Phonetic Parser:" = "注音排列:"; "Push the cursor in front of the phrase after selection" = "在選字後將游標置於該字詞的前方"; "Selection Keys:" = "選字鍵:"; +"Show Hanyu-Pinyin in the inline composition buffer" = "拼音並擊模式(組字區內看到的是漢語拼音)"; "Show page buttons in candidate window" = "在選字窗內顯示翻頁按鈕"; "Simplified Chinese" = "簡體中文"; "Space & ESC Key:" = "ESC 與空格鍵:"; diff --git a/Source/UI/PrefUI/suiPrefPaneGeneral.swift b/Source/UI/PrefUI/suiPrefPaneGeneral.swift index 83497d62..db1a3507 100644 --- a/Source/UI/PrefUI/suiPrefPaneGeneral.swift +++ b/Source/UI/PrefUI/suiPrefPaneGeneral.swift @@ -43,6 +43,8 @@ struct suiPrefPaneGeneral: View { forKey: UserDef.kChineseConversionEnabled) @State private var selEnableKanjiConvToJIS = UserDefaults.standard.bool( forKey: UserDef.kShiftJISShinjitaiOutputEnabled) + @State private var selShowHanyuPinyinInCompositionBuffer = UserDefaults.standard.bool( + forKey: UserDef.kShowHanyuPinyinInCompositionBuffer) @State private var selEnableFartSuppressor = UserDefaults.standard.bool(forKey: UserDef.kShouldNotFartInLieuOfBeep) @State private var selEnableAutoUpdateCheck = UserDefaults.standard.bool(forKey: UserDef.kCheckUpdateAutomatically) @State private var selEnableDebugMode = UserDefaults.standard.bool(forKey: UserDef.kIsDebugModeEnabled) @@ -147,6 +149,13 @@ struct suiPrefPaneGeneral: View { selEnableKanjiConvToKangXi = !value } } + Toggle( + LocalizedStringKey("Show Hanyu-Pinyin in the inline composition buffer"), + isOn: $selShowHanyuPinyinInCompositionBuffer + ).onChange(of: selShowHanyuPinyinInCompositionBuffer) { value in + mgrPrefs.showHanyuPinyinInCompositionBuffer = value + selShowHanyuPinyinInCompositionBuffer = value + } Toggle( LocalizedStringKey("Stop farting (when typed phonetic combination is invalid, etc.)"), isOn: $selEnableFartSuppressor