Choose a suitable string for the update title in singular or plural

This commit is contained in:
Ingo Brückl
2023-06-20 10:00:29 +02:00
parent 137fc10ae1
commit 2bc4dcbb11
2 changed files with 11 additions and 4 deletions

View File

@@ -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) {

View File

@@ -357,6 +357,7 @@
<string name="downloading_dep">Downloading additional files for <xliff:g id="app">%1$s</xliff:g></string>
<string name="notification_channel_updates">Updates notifications</string>
<string name="notification_updates_available"><xliff:g id="apps_count">%1$d</xliff:g> updates available</string>
<string name="notification_updates_available_1"><xliff:g id="apps_count">%1$d</xliff:g> update available</string>
<string name="notification_updates_available_desc_1">A new version of <xliff:g id="app_one_name">%1$s</xliff:g> is available</string>
<string name="notification_updates_available_desc_2"><xliff:g id="app_one_name">%1$s</xliff:g> and <xliff:g id="app_two_name">%2$s</xliff:g></string>
<string name="notification_updates_available_desc_3"><xliff:g id="app_one_name">%1$s</xliff:g>, <xliff:g id="app_two_name">%2$s</xliff:g> and <xliff:g id="app_three_name">%3$s</xliff:g></string>