]> git.ipfire.org Git - thirdparty/wireguard-apple.git/commitdiff
Fix handling of 'PersistentKeepalive: every n seconds'
authorRoopesh Chander <roop@roopc.net>
Thu, 31 Jan 2019 12:47:46 +0000 (18:17 +0530)
committerRoopesh Chander <roop@roopc.net>
Thu, 31 Jan 2019 12:52:08 +0000 (18:22 +0530)
Signed-off-by: Roopesh Chander <roop@roopc.net>
WireGuard/WireGuard/Base.lproj/Localizable.strings
WireGuard/WireGuard/UI/TunnelViewModel.swift
WireGuard/WireGuard/UI/iOS/ViewController/TunnelDetailTableViewController.swift
WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift

index 328861f15e6fbe8e634e2a55a4753807d5398a23..decce3afcc6137f033b4cc0cba9ddf690bef5dc1 100644 (file)
@@ -93,7 +93,7 @@
 "tunnelEditPlaceholderTextStronglyRecommended" = "Strongly recommended";
 "tunnelEditPlaceholderTextOff" = "Off";
 
-"tunnelPeerPersistentKeepaliveValue (%d)" = "every %d seconds";
+"tunnelPeerPersistentKeepaliveValue (%@)" = "every %@ seconds";
 "tunnelHandshakeTimestampNow" = "Now";
 "tunnelHandshakeTimestampSystemClockBackward" = "(System clock is backward)";
 "tunnelHandshakeTimestampAgo (%@)" = "%@ ago";
index 5fbe20d028efd82fdfca7aa3db5b1d3e2103d8a9..886703eda30dae4af670b230c8b4b827d7f2c9be 100644 (file)
@@ -252,7 +252,7 @@ class TunnelViewModel {
                 scratchpad[.endpoint] = endpoint.stringRepresentation
             }
             if let persistentKeepAlive = config.persistentKeepAlive {
-                scratchpad[.persistentKeepAlive] = tr(format: "tunnelPeerPersistentKeepaliveValue (%d)", persistentKeepAlive)
+                scratchpad[.persistentKeepAlive] = String(persistentKeepAlive)
             }
             if let rxBytes = config.rxBytes {
                 scratchpad[.rxBytes] = prettyBytes(rxBytes)
index 867eda760a515be4b904c0d05c818b744baa857c..f1639f5fe8dce2cbd8e586b6fbdb1f007689ee1f 100644 (file)
@@ -211,7 +211,11 @@ extension TunnelDetailTableViewController {
         let field = peerData.filterFieldsWithValueOrControl(peerFields: peerFields)[indexPath.row]
         let cell: KeyValueCell = tableView.dequeueReusableCell(for: indexPath)
         cell.key = field.localizedUIString
-        cell.value = peerData[field]
+        if field == .persistentKeepAlive {
+            cell.value = tr(format: "tunnelPeerPersistentKeepaliveValue (%@)", peerData[field])
+        } else {
+            cell.value = peerData[field]
+        }
         return cell
     }
 
index c9cb09a7448d8faa45bbcb22aebeddf130ceaaf8..9e800092e3111c34a3ef4c864c6d124e92dd163d 100644 (file)
@@ -286,7 +286,11 @@ extension TunnelDetailTableViewController: NSTableViewDelegate {
             let cell: KeyValueRow = tableView.dequeueReusableCell()
             let localizedKeyString = modelRow.isTitleRow() ? modelRow.localizedSectionKeyString() : field.localizedUIString
             cell.key = tr(format: "macFieldKey (%@)", localizedKeyString)
-            cell.value = peerData[field]
+            if field == .persistentKeepAlive {
+                cell.value = tr(format: "tunnelPeerPersistentKeepaliveValue (%@)", peerData[field])
+            } else {
+                cell.value = peerData[field]
+            }
             cell.isKeyInBold = modelRow.isTitleRow()
             return cell
         case .spacerRow: