Added plural forms for download related strings (#6930)

Co-authored-by: Tobi <TobiGr@users.noreply.github.com>
This commit is contained in:
Agnieszka C 2021-08-29 13:28:01 +02:00 committed by GitHub
parent 023a2c1d9c
commit 43e91ae4ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
69 changed files with 27 additions and 194 deletions

View file

@ -49,6 +49,8 @@ import us.shandian.giga.get.DownloadMission;
import us.shandian.giga.get.MissionRecoveryInfo;
import org.schabi.newpipe.streams.io.StoredDirectoryHelper;
import org.schabi.newpipe.streams.io.StoredFileHelper;
import org.schabi.newpipe.util.Localization;
import us.shandian.giga.postprocessing.Postprocessing;
import us.shandian.giga.service.DownloadManager.NetworkState;
@ -467,7 +469,8 @@ public class DownloadManagerService extends Service {
.setContentIntent(makePendingIntent(ACTION_OPEN_DOWNLOADS_FINISHED));
}
if (downloadDoneCount < 1) {
downloadDoneCount++;
if (downloadDoneCount == 1) {
downloadDoneList.append(name);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
@ -476,9 +479,9 @@ public class DownloadManagerService extends Service {
downloadDoneNotification.setContentTitle(null);
}
downloadDoneNotification.setContentText(getString(R.string.download_finished));
downloadDoneNotification.setContentText(Localization.downloadCount(this, downloadDoneCount));
downloadDoneNotification.setStyle(new NotificationCompat.BigTextStyle()
.setBigContentTitle(getString(R.string.download_finished))
.setBigContentTitle(Localization.downloadCount(this, downloadDoneCount))
.bigText(name)
);
} else {
@ -486,12 +489,11 @@ public class DownloadManagerService extends Service {
downloadDoneList.append(name);
downloadDoneNotification.setStyle(new NotificationCompat.BigTextStyle().bigText(downloadDoneList));
downloadDoneNotification.setContentTitle(getString(R.string.download_finished_more, String.valueOf(downloadDoneCount + 1)));
downloadDoneNotification.setContentTitle(Localization.downloadCount(this, downloadDoneCount));
downloadDoneNotification.setContentText(downloadDoneList);
}
mNotificationManager.notify(DOWNLOADS_NOTIFICATION_ID, downloadDoneNotification.build());
downloadDoneCount++;
}
public void notifyFailedDownload(DownloadMission mission) {