From e977694888eae0794b3bed45f0e584c89faa4dd7 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Mon, 1 Aug 2022 12:47:41 +0800 Subject: [PATCH] PrefUI // +keepReadingUponCompositionError. - Crediting Lukhnos Liu for this change. Also remove intonations on error in order to let it work well with Tekkon. --- 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/suiPrefPaneExperience.swift | 8 ++++++++ 6 files changed, 13 insertions(+) diff --git a/Source/Resources/Base.lproj/Localizable.strings b/Source/Resources/Base.lproj/Localizable.strings index 9b57b255..3d21a518 100644 --- a/Source/Resources/Base.lproj/Localizable.strings +++ b/Source/Resources/Base.lproj/Localizable.strings @@ -85,6 +85,7 @@ // SwiftUI Preferences "(Shift+)Space:" = "(Shift+)Space:"; +"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"; "Always use fixed listing order in candidate window" = "Always use fixed listing order in candidate window"; diff --git a/Source/Resources/en.lproj/Localizable.strings b/Source/Resources/en.lproj/Localizable.strings index 9b57b255..3d21a518 100644 --- a/Source/Resources/en.lproj/Localizable.strings +++ b/Source/Resources/en.lproj/Localizable.strings @@ -85,6 +85,7 @@ // SwiftUI Preferences "(Shift+)Space:" = "(Shift+)Space:"; +"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"; "Always use fixed listing order in candidate window" = "Always use fixed listing order in candidate window"; diff --git a/Source/Resources/ja.lproj/Localizable.strings b/Source/Resources/ja.lproj/Localizable.strings index cfab4637..1f01eb48 100644 --- a/Source/Resources/ja.lproj/Localizable.strings +++ b/Source/Resources/ja.lproj/Localizable.strings @@ -85,6 +85,7 @@ // SwiftUI Preferences "(Shift+)Space:" = "(Shift+)Space:"; +"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 キーを連想語彙候補の確認のために使う"; "Always use fixed listing order in candidate window" = "候補文字を固定順番で陳列する"; diff --git a/Source/Resources/zh-Hans.lproj/Localizable.strings b/Source/Resources/zh-Hans.lproj/Localizable.strings index 2b2136d2..c7a18167 100644 --- a/Source/Resources/zh-Hans.lproj/Localizable.strings +++ b/Source/Resources/zh-Hans.lproj/Localizable.strings @@ -85,6 +85,7 @@ // SwiftUI Preferences "(Shift+)Space:" = "(Shift+)空格键:"; +"Allow backspace-editing miscomposed readings" = "允许对无效的读音使用 BackSpace 编辑"; "Allow boosting / excluding a candidate of single kanji" = "将可以就地升权/排除的候选字词的最短词长设为单个汉字"; "Allow using Enter key to confirm associated candidate selection" = "允许使用 Enter 确认当前选中的联想词"; "Always use fixed listing order in candidate window" = "以固定顺序来陈列选字窗内的候选字"; diff --git a/Source/Resources/zh-Hant.lproj/Localizable.strings b/Source/Resources/zh-Hant.lproj/Localizable.strings index e6f05920..9f20e73e 100644 --- a/Source/Resources/zh-Hant.lproj/Localizable.strings +++ b/Source/Resources/zh-Hant.lproj/Localizable.strings @@ -85,6 +85,7 @@ // SwiftUI Preferences "(Shift+)Space:" = "(Shift+)空格鍵:"; +"Allow backspace-editing miscomposed readings" = "允許對無效的讀音使用 BackSpace 編輯"; "Allow boosting / excluding a candidate of single kanji" = "將可以就地升權/排除的候選字詞的最短詞長設為單個漢字"; "Allow using Enter key to confirm associated candidate selection" = "允許使用 Enter 確認當前選中的聯想詞"; "Always use fixed listing order in candidate window" = "以固定順序來陳列選字窗內的候選字"; diff --git a/Source/UI/PrefUI/suiPrefPaneExperience.swift b/Source/UI/PrefUI/suiPrefPaneExperience.swift index 3271a587..2ba38fed 100644 --- a/Source/UI/PrefUI/suiPrefPaneExperience.swift +++ b/Source/UI/PrefUI/suiPrefPaneExperience.swift @@ -50,6 +50,8 @@ struct suiPrefPaneExperience: View { forKey: UserDef.kAutoCorrectReadingCombination) @State private var selAlsoConfirmAssociatedCandidatesByEnter = UserDefaults.standard.bool( forKey: UserDef.kAlsoConfirmAssociatedCandidatesByEnter) + @State private var selKeepReadingUponCompositionError = UserDefaults.standard.bool( + forKey: UserDef.kKeepReadingUponCompositionError) private let contentWidth: Double = { switch mgrPrefs.appleLanguages[0] { case "ja": @@ -188,6 +190,12 @@ struct suiPrefPaneExperience: View { ).onChange(of: selAlsoConfirmAssociatedCandidatesByEnter) { value in mgrPrefs.alsoConfirmAssociatedCandidatesByEnter = value } + Toggle( + LocalizedStringKey("Allow backspace-editing miscomposed readings"), + isOn: $selKeepReadingUponCompositionError + ).onChange(of: selKeepReadingUponCompositionError) { value in + mgrPrefs.keepReadingUponCompositionError = value + } } } }