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
This commit is contained in:
Christos
2026-03-26 10:28:11 +02:00
committed by Jobobby04
parent ba9d010f78
commit 88edd18d02
3 changed files with 6 additions and 2 deletions
@@ -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)
@@ -109,4 +109,9 @@
<item quantity="one">An entry was skipped</item>
<item quantity="other">%1$d entries were skipped</item>
</plurals>
<plurals name="notification_update_error">
<item quantity="one">%1$d update failed</item>
<item quantity="other">%1$d updates failed</item>
</plurals>
</resources>
@@ -921,7 +921,6 @@
<string name="notification_chapters_single">Chapter %1$s</string>
<string name="notification_chapters_single_and_more">Chapter %1$s and %2$d more</string>
<string name="notification_chapters_multiple">Chapters %1$s</string>
<string name="notification_update_error">%1$d update(s) failed</string>
<string name="learn_more">Tap to learn more</string>
<string name="notification_cover_update_failed">Failed to update cover</string>
<string name="notification_first_add_to_library">Please add the entry to your library before doing this</string>