From b01d09dfb505ce47b32f826692bc34eb9cb4400e Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Fri, 22 Feb 2019 13:03:03 +0530 Subject: Importing: Give a clearer error message on importing an invalid config Signed-off-by: Roopesh Chander --- WireGuard/WireGuard/Base.lproj/Localizable.strings | 4 ++-- WireGuard/WireGuard/UI/TunnelImporter.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/WireGuard/WireGuard/Base.lproj/Localizable.strings b/WireGuard/WireGuard/Base.lproj/Localizable.strings index 29fd7cb..15ef50b 100644 --- a/WireGuard/WireGuard/Base.lproj/Localizable.strings +++ b/WireGuard/WireGuard/Base.lproj/Localizable.strings @@ -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 diff --git a/WireGuard/WireGuard/UI/TunnelImporter.swift b/WireGuard/WireGuard/UI/TunnelImporter.swift index 0bf76e5..2c88219 100644 --- a/WireGuard/WireGuard/UI/TunnelImporter.swift +++ b/WireGuard/WireGuard/UI/TunnelImporter.swift @@ -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) } } -- cgit v1.2.3-59-g8ed1b