Translate Jarvis Run Details; fix String vs LocalizedStringKey bug

detailRow's label and outputBlock's title were typed String instead
of LocalizedStringKey, so Text(label)/Text(title) inside them could
never localize regardless of catalog content — the exact anti-pattern
CLAUDE.md's i18n rules warn against for helper functions. Fixed the
types, then translated the 6 genuinely-new strings (Run Details, No
output for this run., Started, Duration, Trigger, Tokens) into
nb/sv/da/de/fr. A few others (Cost, Error, Output, Copied!) were
already covered from being reused elsewhere in the catalog.
This commit is contained in:
2026-08-07 13:44:04 +02:00
parent 1925c9c657
commit 30efc58d16
2 changed files with 206 additions and 2 deletions
+2 -2
View File
@@ -787,7 +787,7 @@ struct JarvisRunDetailSheet: View {
.onExitCommand { dismiss() }
}
private func detailRow(_ label: String, _ value: String) -> some View {
private func detailRow(_ label: LocalizedStringKey, _ value: String) -> some View {
HStack {
Text(label)
.font(.system(size: 13))
@@ -800,7 +800,7 @@ struct JarvisRunDetailSheet: View {
}
@ViewBuilder
private func outputBlock(title: String, text: String, color: Color, showCopied: Binding<Bool>) -> some View {
private func outputBlock(title: LocalizedStringKey, text: String, color: Color, showCopied: Binding<Bool>) -> some View {
VStack(alignment: .leading, spacing: 6) {
HStack(spacing: 6) {
Text(title)