Skip to content

Commit

Permalink
NetP: Fix server location formatting (#2099)
Browse files Browse the repository at this point in the history
  • Loading branch information
graeme authored Oct 17, 2023
1 parent 6261549 commit 8f6107d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion PacketTunnelProvider/UserText.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion PacketTunnelProvider/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -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 %@.";

0 comments on commit 8f6107d

Please sign in to comment.