From 2bc4dcbb11eb6fcae21d09f4647570d43788bf89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Br=C3=BCckl?= Date: Tue, 20 Jun 2023 10:00:29 +0200 Subject: [PATCH] Choose a suitable string for the update title in singular or plural --- .../com/aurora/store/data/work/UpdateWorker.kt | 14 ++++++++++---- app/src/main/res/values/strings.xml | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/aurora/store/data/work/UpdateWorker.kt b/app/src/main/java/com/aurora/store/data/work/UpdateWorker.kt index 681598659..90c9dbaa3 100644 --- a/app/src/main/java/com/aurora/store/data/work/UpdateWorker.kt +++ b/app/src/main/java/com/aurora/store/data/work/UpdateWorker.kt @@ -166,10 +166,16 @@ class UpdateWorker(private val appContext: Context, workerParams: WorkerParamete return NotificationCompat.Builder(appContext, Constants.NOTIFICATION_CHANNEL_UPDATES) .setSmallIcon(R.drawable.ic_logo) .setContentTitle( - appContext.getString( - R.string.notification_updates_available, - updatesList.size - ) + if (updatesList.size == 1) + appContext.getString( + R.string.notification_updates_available_1, + updatesList.size + ) + else + appContext.getString( + R.string.notification_updates_available, + updatesList.size + ) ) .setContentText( when (updatesList.size) { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 8c108b530..3fa5a2b80 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -357,6 +357,7 @@ Downloading additional files for %1$s Updates notifications %1$d updates available + %1$d update available A new version of %1$s is available %1$s and %2$s %1$s, %2$s and %3$s