]> git.ipfire.org Git - thirdparty/wireguard-apple.git/commitdiff
Importing: Give a clearer error message on importing an invalid config
authorRoopesh Chander <roop@roopc.net>
Fri, 22 Feb 2019 07:33:03 +0000 (13:03 +0530)
committerRoopesh Chander <roop@roopc.net>
Fri, 22 Feb 2019 07:33:53 +0000 (13:03 +0530)
Signed-off-by: Roopesh Chander <roop@roopc.net>
WireGuard/WireGuard/Base.lproj/Localizable.strings
WireGuard/WireGuard/UI/TunnelImporter.swift

index 29fd7cba11d5bb2c53499a64ebe1526f6a435158..15ef50b1417b348db80f79e8606f2579060ad19a 100644 (file)
@@ -26,8 +26,8 @@
 "alertImportedFromZipTitle (%d)" = "Created %d tunnels";
 "alertImportedFromZipMessage (%1$d of %2$d)" = "Created %1$d of %2$d tunnels from zip archive";
 
-"alertUnableToImportTitle" = "Unable to import tunnel";
-"alertUnableToImportMessage" = "An error occured when importing the tunnel configuration.";
+"alertBadConfigImportTitle" = "Unable to import tunnel";
+"alertBadConfigImportMessage (%@)" = "The file ‘%@’ does not contain a valid WireGuard configuration";
 
 // Tunnel detail and edit UI
 
index 0bf76e56111f03929f6b30d0670222b6c51a70dc..2c88219d1705d6a5fa47f8c26416f82876ccf73b 100644 (file)
@@ -41,7 +41,7 @@ class TunnelImporter {
                     }
                 }
             } else {
-                errorPresenterType.showErrorAlert(title: tr("alertUnableToImportTitle"), message: tr("alertUnableToImportMessage"),
+                errorPresenterType.showErrorAlert(title: tr("alertBadConfigImportTitle"), message: tr(format: "alertBadConfigImportMessage (%@)", fileName),
                                               from: sourceVC, onPresented: completionHandler)
             }
         }