IME // Refactor kanjiConversionIfRequired().
This commit is contained in:
parent
47cd0949a2
commit
ebf59b594c
|
@ -40,7 +40,7 @@ public enum IME {
|
||||||
static var currentInputMode: InputMode = .init(rawValue: mgrPrefs.mostRecentInputMode) ?? .imeModeNULL
|
static var currentInputMode: InputMode = .init(rawValue: mgrPrefs.mostRecentInputMode) ?? .imeModeNULL
|
||||||
|
|
||||||
static func kanjiConversionIfRequired(_ text: String) -> String {
|
static func kanjiConversionIfRequired(_ text: String) -> String {
|
||||||
if currentInputMode == InputMode.imeModeCHT {
|
guard currentInputMode == InputMode.imeModeCHT else { return text }
|
||||||
switch (mgrPrefs.chineseConversionEnabled, mgrPrefs.shiftJISShinjitaiOutputEnabled) {
|
switch (mgrPrefs.chineseConversionEnabled, mgrPrefs.shiftJISShinjitaiOutputEnabled) {
|
||||||
case (false, true): return ChineseConverter.cnvTradToJIS(text)
|
case (false, true): return ChineseConverter.cnvTradToJIS(text)
|
||||||
case (true, false): return ChineseConverter.cnvTradToKangXi(text)
|
case (true, false): return ChineseConverter.cnvTradToKangXi(text)
|
||||||
|
@ -49,8 +49,6 @@ public enum IME {
|
||||||
case (false, false): return text
|
case (false, false): return text
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return text
|
|
||||||
}
|
|
||||||
|
|
||||||
// MARK: - 自 ctlInputMethod 讀取當前輸入法的簡繁體模式
|
// MARK: - 自 ctlInputMethod 讀取當前輸入法的簡繁體模式
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue