Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Update AZKKC version and support new text replacer API #411

Merged
merged 1 commit into from
Feb 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AzooKeyCore/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
14 changes: 13 additions & 1 deletion Keyboard/Display/InputManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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")
)
}
Expand Down Expand Up @@ -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)
Expand Down
Loading