From a3911fe9ff07bb77495426e26e32c3df5d0bed2f Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Fri, 24 Jul 2026 05:36:44 +0200 Subject: [PATCH] fix(apple): localize TLS connection problems --- .../Sources/OpenClawKit/GatewayConnectionProblem.swift | 9 ++++++--- .../Tests/OpenClawKitTests/GatewayErrorsTests.swift | 7 +++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/apps/shared/OpenClawKit/Sources/OpenClawKit/GatewayConnectionProblem.swift b/apps/shared/OpenClawKit/Sources/OpenClawKit/GatewayConnectionProblem.swift index b7b9de42868e..fb3a21866cf3 100644 --- a/apps/shared/OpenClawKit/Sources/OpenClawKit/GatewayConnectionProblem.swift +++ b/apps/shared/OpenClawKit/Sources/OpenClawKit/GatewayConnectionProblem.swift @@ -764,8 +764,10 @@ extension GatewayConnectionProblemMapper { title: "Gateway certificate unavailable", message: "OpenClaw could not securely save the TLS certificate pin for \(failure.host).", actionLabel: "Retry", - messagePresentation: .verbatim( - "OpenClaw could not securely save the TLS certificate pin for \(failure.host)."), + titlePresentation: .localized("Gateway certificate unavailable"), + messagePresentation: .localizedFormat( + "OpenClaw could not securely save the TLS certificate pin for %@.", + [failure.host]), actionLabelPresentation: .localized("Retry"), actionCommand: nil, docsURL: URL(string: "https://docs.openclaw.ai/gateway/troubleshooting"), @@ -779,7 +781,8 @@ extension GatewayConnectionProblemMapper { title: "Gateway certificate is not trusted", message: "The TLS challenge came from a different host or port than the requested Gateway.", actionLabel: "Check certificate", - messagePresentation: .verbatim( + titlePresentation: .localized("Gateway certificate is not trusted"), + messagePresentation: .localized( "The TLS challenge came from a different host or port than the requested Gateway."), actionLabelPresentation: .localized("Check certificate"), actionCommand: nil, diff --git a/apps/shared/OpenClawKit/Tests/OpenClawKitTests/GatewayErrorsTests.swift b/apps/shared/OpenClawKit/Tests/OpenClawKitTests/GatewayErrorsTests.swift index 89dc3d8ba871..d224cdde94e4 100644 --- a/apps/shared/OpenClawKit/Tests/OpenClawKitTests/GatewayErrorsTests.swift +++ b/apps/shared/OpenClawKit/Tests/OpenClawKitTests/GatewayErrorsTests.swift @@ -317,6 +317,10 @@ struct GatewayErrorsTests { #expect(problem?.retryable == true) #expect(problem?.pauseReconnect == false) #expect(problem?.actionLabel == "Retry") + #expect(problem?.titlePresentation == .localized("Gateway certificate unavailable")) + #expect(problem?.messagePresentation == .localizedFormat( + "OpenClaw could not securely save the TLS certificate pin for %@.", + ["gateway.example.com"])) } @Test func `TLS authority mismatch pauses reconnect`() { @@ -337,6 +341,9 @@ struct GatewayErrorsTests { #expect(problem?.retryable == false) #expect(problem?.pauseReconnect == true) #expect(problem?.actionLabel == "Check certificate") + #expect(problem?.titlePresentation == .localized("Gateway certificate is not trusted")) + #expect(problem?.messagePresentation == .localized( + "The TLS challenge came from a different host or port than the requested Gateway.")) } @Test func `untrusted TLS mismatch cannot be recovered in app`() {