Files
OSGKeyboard/OSGKeyboard/Utilities/ASRLocaleLabels.swift
T
Rocky df1c5ff32c feat: migrate on-device Qwen3 ASR to CoreML for background Flow dictation
Replace MLX GPU inference with CoreML bundles so transcription continues
while the host app is backgrounded. Adds model download and warm-up,
vendored Qwen3Speech, and updates onboarding, settings, and copy for the
~1.6 GB CoreML package (iOS 18+).
2026-06-23 00:46:58 +08:00

33 lines
1012 B
Swift

// ASRLocaleLabels.swift
// OSGKeyboard · Main App
//
// Human-readable labels for ASR locale picker rows. Honors the in-app
// UI language override instead of caching strings at load time.
import Foundation
import OSGKeyboardShared
enum ASRLocaleLabels {
private static let bundledKeys: [String: String] = [
"auto": "locale.auto",
"zh-Hans": "locale.zh-Hans",
"zh-Hant": "locale.zh-Hant",
"en-US": "locale.en-US",
"ja-JP": "locale.ja-JP",
"ko-KR": "locale.ko-KR",
]
static func displayName(for localeId: String, language: AppUILanguage) -> String {
if let key = bundledKeys[localeId] {
return AppUILanguage.localizedString(
key,
tableName: nil,
bundle: .main,
language: language
)
}
let uiLocale = Locale(identifier: language.resolvedLanguageCode())
return uiLocale.localizedString(forIdentifier: localeId) ?? localeId
}
}