7f059dbd45
Migrate keyboard dictation to continuous Flow sessions with auto-start, tap-to-toggle recording, 60s countdown, five-step onboarding, and App Group IPC. Add docs/ GitHub Pages site with en/zh privacy policy for App Store compliance.
27 lines
936 B
Swift
27 lines
936 B
Swift
// EngineServiceLabel.swift
|
|
// OSGKeyboard · Shared
|
|
//
|
|
// Human-readable summary of the active engine / AI provider for UI hints.
|
|
|
|
import Foundation
|
|
|
|
public enum EngineServiceLabel {
|
|
public static func summary(
|
|
engineMode: String,
|
|
providerId: String,
|
|
model: String
|
|
) -> String {
|
|
let isChinese = Locale.preferredLanguages.first?.hasPrefix("zh") == true
|
|
let prefix = isChinese ? "当前:" : "Active: "
|
|
if engineMode == "local" {
|
|
return isChinese
|
|
? "\(prefix)本地引擎 · Apple SpeechAnalyzer"
|
|
: "\(prefix)On-device · Apple SpeechAnalyzer"
|
|
}
|
|
let provider = LLMProvider.provider(id: providerId)
|
|
let trimmedModel = model.trimmingCharacters(in: .whitespacesAndNewlines)
|
|
if trimmedModel.isEmpty { return "\(prefix)\(provider.name)" }
|
|
return "\(prefix)\(provider.name) · \(trimmedModel)"
|
|
}
|
|
}
|