mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-23 11:11:51 +01:00
Using langauge name for default categories in settings
This commit is contained in:
parent
a119f9e794
commit
1039601bc1
@ -27,8 +27,10 @@ interface Category : Serializable {
|
||||
this.name = name
|
||||
}
|
||||
|
||||
fun createDefault(): Category = create("Default").apply {
|
||||
id = 0 }
|
||||
fun createDefault(context: Context): Category = create(context.getString(R.string.default_columns))
|
||||
.apply {
|
||||
id =
|
||||
0 }
|
||||
}
|
||||
|
||||
}
|
@ -200,7 +200,7 @@ class LibraryPresenter(
|
||||
db.getTotalChapterManga().executeAsBlocking().associate { it.id!! to counter++ }
|
||||
}
|
||||
val catListing by lazy {
|
||||
val default = Category.createDefault()
|
||||
val default = Category.createDefault(context)
|
||||
val defOrder = preferences.defaultMangaOrder().getOrDefault()
|
||||
if (defOrder.firstOrNull()?.isLetter() == true) default.mangaSort = defOrder.first()
|
||||
else default.mangaOrder = defOrder.split("/").mapNotNull { it.toLongOrNull() }
|
||||
@ -284,7 +284,8 @@ class LibraryPresenter(
|
||||
*/
|
||||
private fun getLibraryObservable(): Observable<Library> {
|
||||
return Observable.combineLatest(getCategoriesObservable(), getLibraryMangasObservable()) { dbCategories, libraryManga ->
|
||||
val categories = if (libraryManga.containsKey(0)) arrayListOf(Category.createDefault()) + dbCategories
|
||||
val categories = if (libraryManga.containsKey(0)) arrayListOf(Category.createDefault
|
||||
(context)) + dbCategories
|
||||
else dbCategories
|
||||
|
||||
this.categories = categories
|
||||
|
@ -132,7 +132,7 @@ class SettingsLibraryController : SettingsController() {
|
||||
key = Keys.defaultCategory
|
||||
titleRes = R.string.default_category
|
||||
|
||||
val categories = listOf(Category.createDefault()) + dbCategories
|
||||
val categories = listOf(Category.createDefault(context)) + dbCategories
|
||||
entries = listOf(context.getString(R.string.default_category_summary)) +
|
||||
categories.map { it.name }.toTypedArray()
|
||||
entryValues = listOf(-1) + categories.mapNotNull { it.id }.toList()
|
||||
|
Loading…
Reference in New Issue
Block a user