mirror of
https://github.com/awizemann/scarf.git
synced 2026-05-10 10:36:35 +00:00
b40182f2da
Burns down the follow-ups tracked in scarf/docs/I18N.md so that future
translation passes (Phase 2+) don't see English leak through ternary UI
copy, enum rawValue displays, or fixed-format strings.
- Ternary status copy: Text(cond ? "A" : "B") → cond ? Text("A") : Text("B")
(each branch routes through LocalizedStringKey). Covers Health, Chat
(voice/TTS/recording/ACP status), Profiles, MCPServer test result,
SignalSetup, QuickCommands header.
- Enum .rawValue displays: LogFile, LogComponent, DashboardTab, Skills.Tab,
InsightsPeriod, ToolKind, AuthType each expose a
displayName: LocalizedStringResource. LogEntry.LogLevel stays verbatim
(technical jargon — DEBUG/INFO/ERROR/… are industry-standard).
- displayName passthroughs: HermesToolPlatform, ServerRegistry.Entry,
MCPServerPreset wrapped with Text(verbatim:) at call sites (brand names
and user data, not UI chrome). MCPTransport.displayName promoted to
LocalizedStringResource.
- Composite format strings: ModelPickerSheet "ctx" suffix, InsightsView
"tokens" suffix and MCPServerTestResultView "%.1fs · %d tools" rewritten
as Text("\(arg) suffix") LocalizedStringKey. Percent display uses
.formatted(.percent) after /100.
- Day-of-week chart now sources from Calendar.current.shortWeekdaySymbols,
re-indexed for the existing Mon=0 data model.
- ConnectionStatusPill's label + tooltip return Text (not String) so the
.help(Text) / direct-render paths localize correctly.
- Catalog re-synced: 545 → 575 keys (+30 from new ternary branches and
enum displayName values).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
55 lines
1.3 KiB
Swift
55 lines
1.3 KiB
Swift
import Foundation
|
|
|
|
enum MCPTransport: String, Sendable, Equatable, CaseIterable, Identifiable {
|
|
case stdio
|
|
case http
|
|
|
|
var id: String { rawValue }
|
|
|
|
var displayName: LocalizedStringResource {
|
|
switch self {
|
|
case .stdio: return "Local (stdio)"
|
|
case .http: return "Remote (HTTP)"
|
|
}
|
|
}
|
|
}
|
|
|
|
struct HermesMCPServer: Identifiable, Sendable, Equatable {
|
|
let name: String
|
|
let transport: MCPTransport
|
|
let command: String?
|
|
let args: [String]
|
|
let url: String?
|
|
let auth: String?
|
|
let env: [String: String]
|
|
let headers: [String: String]
|
|
let timeout: Int?
|
|
let connectTimeout: Int?
|
|
let enabled: Bool
|
|
let toolsInclude: [String]
|
|
let toolsExclude: [String]
|
|
let resourcesEnabled: Bool
|
|
let promptsEnabled: Bool
|
|
let hasOAuthToken: Bool
|
|
|
|
var id: String { name }
|
|
|
|
var summary: String {
|
|
switch transport {
|
|
case .stdio:
|
|
let argString = args.isEmpty ? "" : " " + args.joined(separator: " ")
|
|
return (command ?? "") + argString
|
|
case .http:
|
|
return url ?? ""
|
|
}
|
|
}
|
|
}
|
|
|
|
struct MCPTestResult: Sendable, Equatable {
|
|
let serverName: String
|
|
let succeeded: Bool
|
|
let output: String
|
|
let tools: [String]
|
|
let elapsed: TimeInterval
|
|
}
|