From 342209a40c8c33b4a9c2ec377c966e36b76c6e3e Mon Sep 17 00:00:00 2001 From: Soner YUKSEL Date: Mon, 9 Aug 2021 11:57:21 -0400 Subject: [PATCH] No Bug: Update the localized text for History Migration Error #4018 --- BraveShared/BraveStrings.swift | 6 +++++- .../Sync/BrowserViewController+CoreMigration.swift | 2 +- Client/Frontend/Sync/BraveCore/BraveCoreMigrator.swift | 9 +++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/BraveShared/BraveStrings.swift b/BraveShared/BraveStrings.swift index 095acf88dfd..b870401d49f 100644 --- a/BraveShared/BraveStrings.swift +++ b/BraveShared/BraveStrings.swift @@ -2190,9 +2190,13 @@ extension Strings { value: "Failed to migrate bookmarks. Please try again later.", comment: "Message for popup when the bookmark migration fails") /// History Migration localization text + public static let historyMigrationErrorTitle = + NSLocalizedString("sync.historyMigrationErrorTitle", tableName: "BraveShared", bundle: .braveShared, + value: "Migration (almost) complete", + comment: "The title for popup when the history migration fails") public static let historyMigrationErrorMessage = NSLocalizedString("sync.historyMigrationErrorMessage", tableName: "BraveShared", bundle: .braveShared, - value: "Failed to migrate history. Please try again later.", + value: "Most history migrated. However, a few pages weren’t due to missing page info.", comment: "Message for popup when the history migration fails") public static let syncConfigurationInformationText = NSLocalizedString("sync.syncConfigurationInformationText", tableName: "BraveShared", bundle: .braveShared, diff --git a/Client/Frontend/Browser/BrowserViewController/Sync/BrowserViewController+CoreMigration.swift b/Client/Frontend/Browser/BrowserViewController/Sync/BrowserViewController+CoreMigration.swift index 7918a8fa600..4f2a501be25 100644 --- a/Client/Frontend/Browser/BrowserViewController/Sync/BrowserViewController+CoreMigration.swift +++ b/Client/Frontend/Browser/BrowserViewController/Sync/BrowserViewController+CoreMigration.swift @@ -22,7 +22,7 @@ extension BrowserViewController { self.migrateToSyncObjects { error in if let error = error { DispatchQueue.main.async { - let alert = UIAlertController(title: Strings.Sync.v2MigrationErrorTitle, + let alert = UIAlertController(title: error.failureReason, message: error.localizedDescription, preferredStyle: .alert) alert.addAction(UIAlertAction(title: Strings.OKString, style: .default, handler: nil)) diff --git a/Client/Frontend/Sync/BraveCore/BraveCoreMigrator.swift b/Client/Frontend/Sync/BraveCore/BraveCoreMigrator.swift index 678340a56fd..4bbbac434ae 100644 --- a/Client/Frontend/Sync/BraveCore/BraveCoreMigrator.swift +++ b/Client/Frontend/Sync/BraveCore/BraveCoreMigrator.swift @@ -29,6 +29,15 @@ class BraveCoreMigrator { case failedBookmarksMigration case failedHistoryMigration + public var failureReason: String? { + switch self { + case .failedBookmarksMigration: + return Strings.Sync.v2MigrationErrorTitle + case .failedHistoryMigration: + return Strings.Sync.historyMigrationErrorTitle + } + } + public var errorDescription: String? { switch self { case .failedBookmarksMigration: