Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
No Bug: Update the localized text for History Migration Error #4018
Browse files Browse the repository at this point in the history
  • Loading branch information
soner-yuksel authored Aug 9, 2021
1 parent e1d902f commit 342209a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
6 changes: 5 additions & 1 deletion BraveShared/BraveStrings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
9 changes: 9 additions & 0 deletions Client/Frontend/Sync/BraveCore/BraveCoreMigrator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 342209a

Please sign in to comment.