diff options
author | Patrick Kennedy <patrickken@gmail.com> | 2020-10-04 19:18:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-04 20:18:45 +0200 |
commit | 449880287bcd87f9059838ec29447c56823104de (patch) | |
tree | 98e0a371413de41c96906affab59c9601ee3e602 /core | |
parent | 0de1cbad2f75e1ea2e7c1e18ae836a4f96d0943f (diff) | |
download | AntennaPod-449880287bcd87f9059838ec29447c56823104de.zip |
Add plural default resource for download_report_content string. (#4492)
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadServiceNotification.java | 6 | ||||
-rw-r--r-- | core/src/main/res/values/strings.xml | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadServiceNotification.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadServiceNotification.java index 64666d25d..975bc3cb3 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadServiceNotification.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadServiceNotification.java @@ -153,7 +153,11 @@ public class DownloadServiceNotification { iconId = R.drawable.ic_notification_sync_error; intent = ClientConfig.downloadServiceCallbacks.getReportNotificationContentIntent(context); id = R.id.notification_download_report; - content = String.format(context.getString(R.string.download_report_content), successfulDownloads, failedDownloads); + content = context.getResources() + .getQuantityString(R.plurals.download_report_content, + successfulDownloads, + successfulDownloads, + failedDownloads); } NotificationCompat.Builder builder = new NotificationCompat.Builder(context, channelId); diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 4cf301530..23c812f17 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -248,7 +248,10 @@ </plurals> <string name="downloads_processing">Processing downloads</string> <string name="download_notification_title">Downloading podcast data</string> - <string name="download_report_content">%1$d downloads succeeded, %2$d failed</string> + <plurals name="download_report_content"> + <item quantity="one">%d download succeeded, %d failed</item> + <item quantity="other">%d downloads succeeded, %d failed</item> + </plurals> <string name="download_log_title_unknown">Unknown Title</string> <string name="download_type_feed">Feed</string> <string name="download_type_media">Media file</string> |