Use plurals for next unread chapters

This commit is contained in:
Jays2Kings 2022-05-01 15:56:50 -04:00
parent 480ff00eec
commit d28c70d3ff
4 changed files with 16 additions and 12 deletions

View file

@ -987,6 +987,10 @@ class MangaDetailsController :
R.string.migrate_,
presenter.manga.seriesType(view!!.context)
)
menu.findItem(R.id.download_next).title =
view?.resources?.getQuantityString(R.plurals.next_unread_chapters, 1, 1)
menu.findItem(R.id.download_next_5).title =
view?.resources?.getQuantityString(R.plurals.next_unread_chapters, 5, 5)
val searchItem = menu.findItem(R.id.action_search)
val searchView = searchItem.actionView as SearchView

View file

@ -103,12 +103,12 @@ class SettingsDownloadController : SettingsController() {
intListPreference(activity) {
bindTo(preferences.autoDownloadAfterReading())
titleRes = R.string.auto_download_after_reading
entriesRes = arrayOf(
R.string.never,
R.string.next_unread_chapter,
R.string.next_2_unread,
R.string.next_3_unread,
R.string.next_5_unread,
entries = listOf(
context.getString(R.string.never),
context.resources.getQuantityString(R.plurals.next_unread_chapters, 1, 1),
context.resources.getQuantityString(R.plurals.next_unread_chapters, 2, 2),
context.resources.getQuantityString(R.plurals.next_unread_chapters, 3, 3),
context.resources.getQuantityString(R.plurals.next_unread_chapters, 5, 5),
)
entryValues = listOf(0, 1, 2, 3, 5)
}

View file

@ -17,10 +17,10 @@
<menu>
<item
android:id="@+id/download_next"
android:title="@string/next_unread_chapter" />
android:title="@string/unread" />
<item
android:id="@+id/download_next_5"
android:title="@string/next_5_unread" />
android:title="@string/unread" />
<item
android:id="@+id/download_custom"
android:title="@string/custom_range" />

View file

@ -524,10 +524,10 @@
<string name="select_starting_chapter">Select starting chapter</string>
<string name="select_ending_chapter">Select ending chapter</string>
<string name="search_chapters">Search chapters</string>
<string name="next_unread_chapter">Next unread chapter</string>
<string name="next_2_unread">Next 2 unread</string>
<string name="next_3_unread">Next 3 unread</string>
<string name="next_5_unread">Next 5 unread</string>
<plurals name="next_unread_chapters">
<item quantity="one">Next unread chapter</item>
<item quantity="other">Next %d unread</item>
</plurals>
<string name="custom_range">Custom range</string>
<string name="all_chapters">All chapters</string>
<string name="all_unread_chapters">All unread chapters</string>