diff options
author | ByteHamster <ByteHamster@users.noreply.github.com> | 2024-02-16 23:50:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-16 23:50:12 +0100 |
commit | c7c5ab567b2681a946ec756cdd17bd99128f9f54 (patch) | |
tree | daf0e7bdb423755ddf67eafff388e0316bbed7f5 /ui | |
parent | c07ae17962b0fbb757c42e873d9c06cdac3a52ae (diff) | |
download | AntennaPod-c7c5ab567b2681a946ec756cdd17bd99128f9f54.zip |
Use proper plurals when showing number of episodes (#6922)
Diffstat (limited to 'ui')
-rw-r--r-- | ui/i18n/src/main/res/values/strings.xml | 1 | ||||
-rw-r--r-- | ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/downloads/DownloadStatisticsListAdapter.java | 9 |
2 files changed, 4 insertions, 6 deletions
diff --git a/ui/i18n/src/main/res/values/strings.xml b/ui/i18n/src/main/res/values/strings.xml index be9a9dcbc..060d2b29f 100644 --- a/ui/i18n/src/main/res/values/strings.xml +++ b/ui/i18n/src/main/res/values/strings.xml @@ -123,7 +123,6 @@ <string name="description_label">Description</string> <string name="shownotes_label">Shownotes</string> <string name="shownotes_contentdescription">swipe up to read shownotes</string> - <string name="episodes_suffix">\u0020episodes</string> <string name="close_label">Close</string> <string name="retry_label">Retry</string> <string name="auto_download_label">Include in auto downloads</string> diff --git a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/downloads/DownloadStatisticsListAdapter.java b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/downloads/DownloadStatisticsListAdapter.java index 4839aa891..083a87514 100644 --- a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/downloads/DownloadStatisticsListAdapter.java +++ b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/downloads/DownloadStatisticsListAdapter.java @@ -10,7 +10,6 @@ import de.danoeh.antennapod.ui.statistics.StatisticsListAdapter; import de.danoeh.antennapod.ui.statistics.feed.FeedStatisticsDialogFragment; import java.util.List; -import java.util.Locale; /** * Adapter for the download statistics list. @@ -45,10 +44,10 @@ public class DownloadStatisticsListAdapter extends StatisticsListAdapter { @Override protected void onBindFeedViewHolder(StatisticsHolder holder, StatisticsItem item) { - holder.value.setText(Formatter.formatShortFileSize(context, item.totalDownloadSize) - + " • " - + String.format(Locale.getDefault(), "%d%s", - item.episodesDownloadCount, context.getString(R.string.episodes_suffix))); + int numEpisodes = (int) item.episodesDownloadCount; + String text = Formatter.formatShortFileSize(context, item.totalDownloadSize); + text += " • " + context.getResources().getQuantityString(R.plurals.num_episodes, numEpisodes, numEpisodes); + holder.value.setText(text); holder.itemView.setOnClickListener(v -> { FeedStatisticsDialogFragment yourDialogFragment = FeedStatisticsDialogFragment.newInstance( |