From bb353bf54139c164f9c611b5700fe5bd8351d8b6 Mon Sep 17 00:00:00 2001 From: VIKAS PAWAR <155407261+vikasp07@users.noreply.github.com> Date: Fri, 19 Sep 2025 14:42:03 +0530 Subject: [PATCH 1/2] Update DatabaseErrorDialog.kt BUG-(#19092) show localized fallback for DIALOG_LOAD_FAILED (#19092) Replace the cryptic, technical diagnostic shown to users when DIALOG_LOAD_FAILED is triggered with a fallback message This is a minimal UX-only change that keeps other dialog flows unchanged. #19092 --- .../com/ichi2/anki/dialogs/DatabaseErrorDialog.kt | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/dialogs/DatabaseErrorDialog.kt b/AnkiDroid/src/main/java/com/ichi2/anki/dialogs/DatabaseErrorDialog.kt index 88395b62e9d8..3881dc677f61 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/dialogs/DatabaseErrorDialog.kt +++ b/AnkiDroid/src/main/java/com/ichi2/anki/dialogs/DatabaseErrorDialog.kt @@ -549,16 +549,8 @@ class DatabaseErrorDialog : AsyncDialogFragment() { private val message: String? get() = when (requireDialogType()) { - DIALOG_LOAD_FAILED -> - if (databaseCorruptFlag) { - // The sqlite database has been corrupted (DatabaseErrorHandler.onCorrupt() was called) - // Show a specific message appropriate for the situation - res().getString(R.string.corrupt_db_message, res().getString(R.string.repair_deck)) - } else { - // Generic message shown when a libanki task failed - res().getString(R.string.access_collection_failed_message, res().getString(R.string.link_help)) - } - DIALOG_DB_ERROR -> res().getString(R.string.answering_error_message) + DIALOG_LOAD_FAILED -> res().getString(R.string.load_failed_fallback_message) // show a short localized fallback message in + DIALOG_DB_ERROR -> res().getString(R.string.answering_error_message) DIALOG_DISK_FULL -> res().getString(R.string.storage_full_message) DIALOG_REPAIR_COLLECTION -> res().getString(R.string.repair_deck_dialog, BackupManager.BROKEN_COLLECTIONS_SUFFIX) DIALOG_RESTORE_BACKUP -> res().getString(R.string.backup_restore_no_backups) From f2395d8e1d2a306d3c589c02e32c95246cb717b8 Mon Sep 17 00:00:00 2001 From: VIKAS PAWAR <155407261+vikasp07@users.noreply.github.com> Date: Fri, 19 Sep 2025 14:51:49 +0530 Subject: [PATCH 2/2] Update 03-dialogs.xml solving_issue(#19092) Show localized fallback for DIALOG_LOAD_FAILED (#19092) --- AnkiDroid/src/main/res/values/03-dialogs.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AnkiDroid/src/main/res/values/03-dialogs.xml b/AnkiDroid/src/main/res/values/03-dialogs.xml index cf71998757d6..b492a618d288 100644 --- a/AnkiDroid/src/main/res/values/03-dialogs.xml +++ b/AnkiDroid/src/main/res/values/03-dialogs.xml @@ -36,7 +36,8 @@ %d card reset %d cards reset - + + An error occurred. Tap OK to continue. Database error Writing to the collection failed. The database could be corrupt or there may not to be enough empty space on disk.\n\nIf this happens more often, try checking the database, repairing the collection or restoring it from a backup. Touch “options” for that.\n\Or it could be an AnkiDroid bug as well; please report the error so that we can check this. Report error