diff --git a/Source/Modules/LMMgr.swift b/Source/Modules/LMMgr.swift index b947f367..65acef33 100644 --- a/Source/Modules/LMMgr.swift +++ b/Source/Modules/LMMgr.swift @@ -792,6 +792,33 @@ extension LMMgr: PhraseEditorDelegate { public func tagOverrides(in strProcessed: inout String, mode: Shared.InputMode) { let outputStack: NSMutableString = .init() + switch mode { + case .imeModeCHT: + if !Self.lmCHT.isCoreLMLoaded { + Notifier.notify( + message: NSLocalizedString("Loading CHT Core Dict...", comment: "") + ) + Self.loadCoreLanguageModelFile( + filenameSansExtension: "data-cht", langModel: &Self.lmCHT + ) + Notifier.notify( + message: NSLocalizedString("Core Dict loading complete.", comment: "") + ) + } + case .imeModeCHS: + if !Self.lmCHS.isCoreLMLoaded { + Notifier.notify( + message: NSLocalizedString("Loading CHS Core Dict...", comment: "") + ) + Self.loadCoreLanguageModelFile( + filenameSansExtension: "data-chs", langModel: &Self.lmCHS + ) + Notifier.notify( + message: NSLocalizedString("Core Dict loading complete.", comment: "") + ) + } + case .imeModeNULL: return + } for currentLine in strProcessed.split(separator: "\n") { let arr = currentLine.split(separator: " ") guard arr.count >= 2 else { continue }