From 30efc58d16b7bdaec6958041e5e0cf5c40866bb6 Mon Sep 17 00:00:00 2001 From: Rune Olsen Date: Fri, 7 Aug 2026 13:44:04 +0200 Subject: [PATCH] Translate Jarvis Run Details; fix String vs LocalizedStringKey bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- oAI/Localizable.xcstrings | 204 +++++++++++++++++++++++++++++ oAI/Views/Screens/JarvisView.swift | 4 +- 2 files changed, 206 insertions(+), 2 deletions(-) diff --git a/oAI/Localizable.xcstrings b/oAI/Localizable.xcstrings index 72939ba..5088a2a 100644 --- a/oAI/Localizable.xcstrings +++ b/oAI/Localizable.xcstrings @@ -21343,6 +21343,210 @@ } } } + }, + "Run Details" : { + "localizations" : { + "da" : { + "stringUnit" : { + "state" : "translated", + "value" : "Kørselsdetaljer" + } + }, + "de" : { + "stringUnit" : { + "state" : "translated", + "value" : "Ausführungsdetails" + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Détails de l'exécution" + } + }, + "nb" : { + "stringUnit" : { + "state" : "translated", + "value" : "Kjøredetaljer" + } + }, + "sv" : { + "stringUnit" : { + "state" : "translated", + "value" : "Körningsdetaljer" + } + } + } + }, + "No output for this run." : { + "localizations" : { + "da" : { + "stringUnit" : { + "state" : "translated", + "value" : "Ingen output for denne kørsel." + } + }, + "de" : { + "stringUnit" : { + "state" : "translated", + "value" : "Keine Ausgabe für diesen Lauf." + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Aucune sortie pour cette exécution." + } + }, + "nb" : { + "stringUnit" : { + "state" : "translated", + "value" : "Ingen output for denne kjøringen." + } + }, + "sv" : { + "stringUnit" : { + "state" : "translated", + "value" : "Ingen output för denna körning." + } + } + } + }, + "Started" : { + "localizations" : { + "da" : { + "stringUnit" : { + "state" : "translated", + "value" : "Startet" + } + }, + "de" : { + "stringUnit" : { + "state" : "translated", + "value" : "Gestartet" + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Démarré" + } + }, + "nb" : { + "stringUnit" : { + "state" : "translated", + "value" : "Startet" + } + }, + "sv" : { + "stringUnit" : { + "state" : "translated", + "value" : "Startad" + } + } + } + }, + "Duration" : { + "localizations" : { + "da" : { + "stringUnit" : { + "state" : "translated", + "value" : "Varighed" + } + }, + "de" : { + "stringUnit" : { + "state" : "translated", + "value" : "Dauer" + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Durée" + } + }, + "nb" : { + "stringUnit" : { + "state" : "translated", + "value" : "Varighet" + } + }, + "sv" : { + "stringUnit" : { + "state" : "translated", + "value" : "Varaktighet" + } + } + } + }, + "Trigger" : { + "localizations" : { + "da" : { + "stringUnit" : { + "state" : "translated", + "value" : "Udløser" + } + }, + "de" : { + "stringUnit" : { + "state" : "translated", + "value" : "Auslöser" + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Déclencheur" + } + }, + "nb" : { + "stringUnit" : { + "state" : "translated", + "value" : "Utløser" + } + }, + "sv" : { + "stringUnit" : { + "state" : "translated", + "value" : "Utlösare" + } + } + } + }, + "Tokens" : { + "localizations" : { + "da" : { + "stringUnit" : { + "state" : "translated", + "value" : "Tokens" + } + }, + "de" : { + "stringUnit" : { + "state" : "translated", + "value" : "Tokens" + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Tokens" + } + }, + "nb" : { + "stringUnit" : { + "state" : "translated", + "value" : "Tokens" + } + }, + "sv" : { + "stringUnit" : { + "state" : "translated", + "value" : "Tokens" + } + } + } } }, "version" : "1.1" diff --git a/oAI/Views/Screens/JarvisView.swift b/oAI/Views/Screens/JarvisView.swift index b2e34a6..b0c9c32 100644 --- a/oAI/Views/Screens/JarvisView.swift +++ b/oAI/Views/Screens/JarvisView.swift @@ -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) -> some View { + private func outputBlock(title: LocalizedStringKey, text: String, color: Color, showCopied: Binding) -> some View { VStack(alignment: .leading, spacing: 6) { HStack(spacing: 6) { Text(title)