From e92246049756511abbe065b0f1e7b1552ad5502a Mon Sep 17 00:00:00 2001 From: Graeme Arthur Date: Mon, 16 Oct 2023 13:56:54 +0200 Subject: [PATCH] Fix location formatting --- PacketTunnelProvider/UserText.swift | 8 +++++++- PacketTunnelProvider/en.lproj/Localizable.strings | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/PacketTunnelProvider/UserText.swift b/PacketTunnelProvider/UserText.swift index aa236db2e1..820a4a6ebf 100644 --- a/PacketTunnelProvider/UserText.swift +++ b/PacketTunnelProvider/UserText.swift @@ -28,7 +28,13 @@ final class UserText { static let networkProtectionConnectionSuccessNotificationBody = NSLocalizedString("network.protection.success.notification.body", value: "Network Protection is On. Your location and online activity are protected.", comment: "The body of the notification shown when Network Protection reconnects successfully") - static func networkProtectionConnectionSuccessNotificationBody(serverLocation: String) -> String { NSLocalizedString("network.protection.success.notification.subtitle.including.serverLocation", value: "Routing device traffic through \(serverLocation).", comment: "The body of the notification shown when Network Protection connects successfully with the city + state/country as formatted parameter") + static func networkProtectionConnectionSuccessNotificationBody(serverLocation: String) -> String { + let localized = NSLocalizedString( + "network.protection.success.notification.subtitle.including.serverLocation", + value: "Routing device traffic through %@.", + comment: "The body of the notification shown when Network Protection connects successfully with the city + state/country as formatted parameter" + ) + return String(format: localized, serverLocation) } static let networkProtectionConnectionInterruptedNotificationBody = NSLocalizedString("network.protection.interrupted.notification.body", value: "Network Protection was interrupted. Attempting to reconnect now...", comment: "The body of the notification shown when Network Protection's connection is interrupted") diff --git a/PacketTunnelProvider/en.lproj/Localizable.strings b/PacketTunnelProvider/en.lproj/Localizable.strings index 378141dfd9..1a6d5fe4de 100644 --- a/PacketTunnelProvider/en.lproj/Localizable.strings +++ b/PacketTunnelProvider/en.lproj/Localizable.strings @@ -11,5 +11,5 @@ "network.protection.success.notification.body" = "Network Protection is On. Your location and online activity are protected."; /* The body of the notification shown when Network Protection connects successfully with the city + state/country as formatted parameter */ -"network.protection.success.notification.subtitle.including.serverLocation" = "Routing device traffic through \(serverLocation)."; +"network.protection.success.notification.subtitle.including.serverLocation" = "Routing device traffic through %@.";