PrefUI // Add a UI toggle for phrase replacement mode.

This commit is contained in:
ShikiSuen 2022-11-26 08:30:29 +08:00
parent cdc8a3a113
commit e313bda323
6 changed files with 37 additions and 0 deletions

View File

@ -19,6 +19,9 @@ struct VwrPrefPaneDevZone: View {
forKey: UserDef.kHandleDefaultCandidateFontsByLangIdentifier.rawValue)
@State private var selShiftKeyAccommodationBehavior: Int = UserDefaults.standard.integer(
forKey: UserDef.kShiftKeyAccommodationBehavior.rawValue)
@State private var selPhraseReplacementEnabled: Bool = UserDefaults.standard.bool(
forKey: UserDef.kPhraseReplacementEnabled.rawValue
)
private let contentMaxHeight: Double = 440
private let contentWidth: Double = {
@ -97,6 +100,25 @@ struct VwrPrefPaneDevZone: View {
)
)
.preferenceDescription().fixedSize(horizontal: false, vertical: true)
HStack {
Toggle(
LocalizedStringKey("Enable phrase replacement table"),
isOn: $selPhraseReplacementEnabled.onChange {
PrefMgr.shared.phraseReplacementEnabled = selPhraseReplacementEnabled
}
)
Spacer()
Button(LocalizedStringKey("Edit…")) {
LMMgr.openPhraseFile(fromURL: LMMgr.userReplacementsDataURL(IMEApp.currentInputMode))
LMMgr.openPhraseFile(fromURL: LMMgr.userReplacementsDataURL(IMEApp.currentInputMode.reversed))
}
}
Text(
LocalizedStringKey(
"This will batch-replace specified candidates."
)
)
.preferenceDescription().fixedSize(horizontal: false, vertical: true)
}
}
}

View File

@ -179,9 +179,11 @@
"Disable Shift key accomodation in all cases" = "Disable Shift key accomodation in all cases";
"Disassemble the previous reading, dropping its intonation" = "Disassemble the previous reading, dropping its intonation";
"Disassembling process does not work with non-phonetic reading keys." = "Disassembling process does not work with non-phonetic reading keys.";
"Edit…" = "Edit…";
"Emulating select-candidate-per-character mode" = "Emulating select-candidate-per-character mode";
"Enable cassette mode, suppressing phonabet input" = "Enable cassette mode, suppressing phonabet input";
"Enable CNS11643 Support (2022-10-04)" = "Enable CNS11643 Support (2022-10-04)";
"Enable phrase replacement table" = "Enable phrase replacement table";
"Enable Space key for calling candidate window" = "Enable Space key for calling candidate window";
"Enable symbol input support (incl. certain emoji symbols)" = "Enable symbol input support (incl. certain emoji symbols)";
"Enforce conversion in both input modes" = "Enforce conversion in both input modes";
@ -243,6 +245,7 @@
"Stop farting (when typed phonetic combination is invalid, etc.)" = "Stop farting (when typed phonetic combination is invalid, etc.)";
"This conversion only affects the cassette module, converting typed contents to either Simplified Chinese or Traditional Chinese in accordance to this setting and your current input mode." = "This conversion only affects the cassette module, converting typed contents to either Simplified Chinese or Traditional Chinese in accordance to this setting and your current input mode.";
"This only works with Tadokoro candidate window." = "This only works with Tadokoro candidate window.";
"This will batch-replace specified candidates." = "This will batch-replace specified candidates.";
"Traditional Chinese" = "Traditional Chinese";
"Trim unfinished readings / strokes on commit" = "Trim unfinished readings / strokes on commit";
"Type them into inline composition buffer" = "Type them into inline composition buffer";

View File

@ -179,9 +179,11 @@
"Disable Shift key accomodation in all cases" = "Disable Shift key accomodation in all cases";
"Disassemble the previous reading, dropping its intonation" = "Disassemble the previous reading, dropping its intonation";
"Disassembling process does not work with non-phonetic reading keys." = "Disassembling process does not work with non-phonetic reading keys.";
"Edit…" = "Edit…";
"Emulating select-candidate-per-character mode" = "Emulating select-candidate-per-character mode";
"Enable cassette mode, suppressing phonabet input" = "Enable cassette mode, suppressing phonabet input";
"Enable CNS11643 Support (2022-10-04)" = "Enable CNS11643 Support (2022-10-04)";
"Enable phrase replacement table" = "Enable phrase replacement table";
"Enable Space key for calling candidate window" = "Enable Space key for calling candidate window";
"Enable symbol input support (incl. certain emoji symbols)" = "Enable symbol input support (incl. certain emoji symbols)";
"Enforce conversion in both input modes" = "Enforce conversion in both input modes";
@ -243,6 +245,7 @@
"Stop farting (when typed phonetic combination is invalid, etc.)" = "Stop farting (when typed phonetic combination is invalid, etc.)";
"This conversion only affects the cassette module, converting typed contents to either Simplified Chinese or Traditional Chinese in accordance to this setting and your current input mode." = "This conversion only affects the cassette module, converting typed contents to either Simplified Chinese or Traditional Chinese in accordance to this setting and your current input mode.";
"This only works with Tadokoro candidate window." = "This only works with Tadokoro candidate window.";
"This will batch-replace specified candidates." = "This will batch-replace specified candidates.";
"Traditional Chinese" = "Traditional Chinese";
"Trim unfinished readings / strokes on commit" = "Trim unfinished readings / strokes on commit";
"Type them into inline composition buffer" = "Type them into inline composition buffer";

View File

@ -179,9 +179,11 @@
"Disable Shift key accomodation in all cases" = "いずれの客体アプリにも Shift キーの互換性措置を禁ず";
"Disassemble the previous reading, dropping its intonation" = "カーソルの後部の音読みを解き、その音調を除く";
"Disassembling process does not work with non-phonetic reading keys." = "実の意味の音読みだけを解くことができる。";
"Edit…" = "編集…";
"Emulating select-candidate-per-character mode" = "漢字1つづつ全候補選択入力モード";
"Enable cassette mode, suppressing phonabet input" = "カセットモードを起用(注音入力はこのモードで使えぬ)";
"Enable CNS11643 Support (2022-10-04)" = "全字庫モード // 入力可能な漢字数を倍増す (2022-10-04)";
"Enable phrase replacement table" = "言葉置換表を起用";
"Enable Space key for calling candidate window" = "Space キーで入力候補を呼び出す";
"Enable symbol input support (incl. certain emoji symbols)" = "僅かなる絵文字も含む符号入力サポートを起用";
"Enforce conversion in both input modes" = "カセットモードによる漢字出力の簡体繁体転換を常に行う";
@ -243,6 +245,7 @@
"Stop farting (when typed phonetic combination is invalid, etc.)" = "マナーモード // 外すと入力間違った時に変な声が出る";
"This conversion only affects the cassette module, converting typed contents to either Simplified Chinese or Traditional Chinese in accordance to this setting and your current input mode." = "この転換はカセットモードだけに使える転換であり、転換結果はこの設定と入力モード次第である。";
"This only works with Tadokoro candidate window." = "これは田所候補陳列ウィンドウだけに効ける機能である。";
"This will batch-replace specified candidates." = "指定された候補そのものを置き換える";
"Traditional Chinese" = "繁体中国語";
"Trim unfinished readings / strokes on commit" = "送り出す緩衝列内容から未完成な音読み/筆組みを除く";
"Type them into inline composition buffer" = "入力緩衝列にローマ字入力";

View File

@ -179,9 +179,11 @@
"Disable Shift key accomodation in all cases" = "对任何客体应用均停用 Shift 键相容性措施";
"Disassemble the previous reading, dropping its intonation" = "析构游标正后方的字音,且剔除其声调";
"Disassembling process does not work with non-phonetic reading keys." = "析构行为仅针对组字器内「身为汉字读音」的读音索引单元有效。";
"Edit…" = "编辑…";
"Emulating select-candidate-per-character mode" = "模拟 90 年代前期注音逐字选字输入风格";
"Enable cassette mode, suppressing phonabet input" = "启用磁带模式,会停用注音输入";
"Enable CNS11643 Support (2022-10-04)" = "启用 CNS11643 全字库支援 (2022-10-04)";
"Enable phrase replacement table" = "启用语汇置换表";
"Enable Space key for calling candidate window" = "敲空格键以呼出候选字窗";
"Enable symbol input support (incl. certain emoji symbols)" = "启用包括少许绘文字在内的符号输入支援";
"Enforce conversion in both input modes" = "依当前简繁模式强制转换";
@ -243,6 +245,7 @@
"Stop farting (when typed phonetic combination is invalid, etc.)" = "廉耻模式 // 取消勾选的话,敲错字时会有异音";
"This conversion only affects the cassette module, converting typed contents to either Simplified Chinese or Traditional Chinese in accordance to this setting and your current input mode." = "该转换仅对磁带模式有影响,会将键入的内容根据该选项与当前的简繁体模式来转换。";
"This only works with Tadokoro candidate window." = "该方法仅对田所选字窗起作用。";
"This will batch-replace specified candidates." = "这将会对指定的候选字词进行整词取代。";
"Traditional Chinese" = "繁体中文";
"Trim unfinished readings / strokes on commit" = "在递交时清理未完成拼写的读音或字根";
"Type them into inline composition buffer" = "直接键入内文组字区";

View File

@ -179,9 +179,11 @@
"Disable Shift key accomodation in all cases" = "對任何客體應用均停用 Shift 鍵相容性措施";
"Disassemble the previous reading, dropping its intonation" = "析構游標正後方的字音,且剔除其聲調";
"Disassembling process does not work with non-phonetic reading keys." = "析構行為僅針對組字器內「身為漢字讀音」的讀音索引單元有效。";
"Edit…" = "編輯…";
"Emulating select-candidate-per-character mode" = "模擬 90 年代前期注音逐字選字輸入風格";
"Enable cassette mode, suppressing phonabet input" = "啟用磁帶模式,會停用注音輸入";
"Enable CNS11643 Support (2022-10-04)" = "啟用 CNS11643 全字庫支援 (2022-10-04)";
"Enable phrase replacement table" = "啟用語彙置換表";
"Enable Space key for calling candidate window" = "敲空格鍵以呼出候選字窗";
"Enable symbol input support (incl. certain emoji symbols)" = "啟用包括少許繪文字在內的符號輸入支援";
"Enforce conversion in both input modes" = "依當前簡繁模式強制轉換";
@ -243,6 +245,7 @@
"Stop farting (when typed phonetic combination is invalid, etc.)" = "廉恥模式 // 取消勾選的話,敲錯字時會有異音";
"This conversion only affects the cassette module, converting typed contents to either Simplified Chinese or Traditional Chinese in accordance to this setting and your current input mode." = "該轉換僅對磁帶模式有影響,會將鍵入的內容根據該選項與當前的簡繁體模式來轉換。";
"This only works with Tadokoro candidate window." = "該方法僅對田所選字窗起作用。";
"This will batch-replace specified candidates." = "這將會對指定的候選字詞進行整詞取代。";
"Traditional Chinese" = "繁體中文";
"Trim unfinished readings / strokes on commit" = "在遞交時清理未完成拼寫的讀音或字根";
"Type them into inline composition buffer" = "直接鍵入內文組字區";