diff --git a/AzooKeyCore/Package.swift b/AzooKeyCore/Package.swift index 0ae8831f..a0e0489b 100644 --- a/AzooKeyCore/Package.swift +++ b/AzooKeyCore/Package.swift @@ -46,7 +46,7 @@ let package = Package( // MARK: `_: .upToNextMinor(Version)` or `exact: Version` or `revision: Version`. // MARK: For develop branch, you can use `revision:` specification. // MARK: For main branch, you must use `upToNextMinor` specification. - .package(url: "https://github.com/ensan-hcl/AzooKeyKanaKanjiConverter", .upToNextMinor(from: "0.4.0")) + .package(url: "https://github.com/ensan-hcl/AzooKeyKanaKanjiConverter", .upToNextMinor(from: "0.5.0")) ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. diff --git a/Keyboard/Display/InputManager.swift b/Keyboard/Display/InputManager.swift index f6981e38..a639377e 100644 --- a/Keyboard/Display/InputManager.swift +++ b/Keyboard/Display/InputManager.swift @@ -121,6 +121,7 @@ import KeyboardExtensionUtils dictionaryResourceURL: Self.dictionaryResourceURL, memoryDirectoryURL: Self.memoryDirectoryURL, sharedContainerURL: Self.sharedContainerURL, + textReplacer: self.textReplacer, metadata: .init(appVersionString: SharedStore.currentAppVersion?.description ?? "Unknown") ) } @@ -191,7 +192,18 @@ import KeyboardExtensionUtils /// かな漢字変換を受け持つ変換器。 private var kanaKanjiConverter = KanaKanjiConverter() /// 置換機 - private var textReplacer = TextReplacer() + private var textReplacer = TextReplacer(emojiDataProvider: { + // 読み込むファイルはバージョンごとに変更する必要がある + if #available(iOS 17.4, *) { + Bundle.main.bundleURL.appendingPathComponent("emoji_all_E15.1.txt.gen", isDirectory: false) + } else if #available(iOS 16.4, *) { + Bundle.main.bundleURL.appendingPathComponent("emoji_all_E15.0.txt.gen", isDirectory: false) + } else if #available(iOS 15.4, *) { + Bundle.main.bundleURL.appendingPathComponent("emoji_all_E14.0.txt.gen", isDirectory: false) + } else { + Bundle.main.bundleURL.appendingPathComponent("emoji_all_E13.1.txt.gen", isDirectory: false) + } + }) func sendToDicdataStore(_ data: DicdataStore.Notification) { self.kanaKanjiConverter.sendToDicdataStore(data)