Add plural default resource for download_report_content string. (#4492)

This commit is contained in:
Patrick Kennedy 2020-10-04 19:18:45 +01:00 committed by GitHub
parent 0de1cbad2f
commit 449880287b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

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

View File

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