From 88edd18d02e37395ed3fdc317d63fe29c928ef20 Mon Sep 17 00:00:00 2001 From: Christos <42313770+sudo-ezekiel@users.noreply.github.com> Date: Thu, 26 Mar 2026 10:28:11 +0200 Subject: [PATCH] Use plural forms for update error notification (#3090) * Use plural forms for update error notification Replace the hardcoded 'X update(s) failed' string with Android plural resources so the notification correctly shows '1 update failed' vs '2 updates failed', enabling proper localization. Fixes #3051 * Address review: rename plural key and remove comment Rename plural key to notification_update_errors to avoid potential conflicts with existing translated string keys. Remove leftover comment from strings.xml. * Revert key rename per review --- .../kanade/tachiyomi/data/library/LibraryUpdateNotifier.kt | 2 +- i18n/src/commonMain/moko-resources/base/plurals.xml | 5 +++++ i18n/src/commonMain/moko-resources/base/strings.xml | 1 - 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateNotifier.kt b/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateNotifier.kt index 582974c16..9ef1fd7d7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateNotifier.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateNotifier.kt @@ -155,7 +155,7 @@ class LibraryUpdateNotifier( Notifications.ID_LIBRARY_ERROR, Notifications.CHANNEL_LIBRARY_ERROR, ) { - setContentTitle(context.stringResource(MR.strings.notification_update_error, failed)) + setContentTitle(context.pluralStringResource(MR.plurals.notification_update_error, failed, failed)) setContentText(context.stringResource(MR.strings.action_show_errors)) setSmallIcon(R.drawable.ic_tachi) diff --git a/i18n/src/commonMain/moko-resources/base/plurals.xml b/i18n/src/commonMain/moko-resources/base/plurals.xml index c257f6764..1f1cb182f 100644 --- a/i18n/src/commonMain/moko-resources/base/plurals.xml +++ b/i18n/src/commonMain/moko-resources/base/plurals.xml @@ -109,4 +109,9 @@ An entry was skipped %1$d entries were skipped + + + %1$d update failed + %1$d updates failed + diff --git a/i18n/src/commonMain/moko-resources/base/strings.xml b/i18n/src/commonMain/moko-resources/base/strings.xml index 9f9e75728..ea15b5d12 100755 --- a/i18n/src/commonMain/moko-resources/base/strings.xml +++ b/i18n/src/commonMain/moko-resources/base/strings.xml @@ -921,7 +921,6 @@ Chapter %1$s Chapter %1$s and %2$d more Chapters %1$s - %1$d update(s) failed Tap to learn more Failed to update cover Please add the entry to your library before doing this