Localize library empty string

This commit is contained in:
Syer10
2022-03-12 21:58:26 -05:00
parent 3a3819269d
commit cf127512d5
2 changed files with 3 additions and 1 deletions

View File

@@ -77,6 +77,7 @@
<!-- Library Menu --> <!-- Library Menu -->
<string name="default_category">Default</string> <string name="default_category">Default</string>
<string name="library_empty">Library is empty</string>
<!-- Manga Menu --> <!-- Manga Menu -->
<string name="page_progress">Page %1$d</string> <string name="page_progress">Page %1$d</string>

View File

@@ -15,6 +15,7 @@ import ca.gosyer.data.models.Manga
import ca.gosyer.data.server.interactions.CategoryInteractionHandler import ca.gosyer.data.server.interactions.CategoryInteractionHandler
import ca.gosyer.data.server.interactions.LibraryInteractionHandler import ca.gosyer.data.server.interactions.LibraryInteractionHandler
import ca.gosyer.data.server.interactions.UpdatesInteractionHandler import ca.gosyer.data.server.interactions.UpdatesInteractionHandler
import ca.gosyer.i18n.MR
import ca.gosyer.uicore.vm.ContextWrapper import ca.gosyer.uicore.vm.ContextWrapper
import ca.gosyer.uicore.vm.ViewModel import ca.gosyer.uicore.vm.ViewModel
import kotlinx.coroutines.async import kotlinx.coroutines.async
@@ -94,7 +95,7 @@ class LibraryScreenViewModel @Inject constructor(
categoryHandler.getCategories() categoryHandler.getCategories()
.onEach { categories -> .onEach { categories ->
if (categories.isEmpty()) { if (categories.isEmpty()) {
throw Exception("Library is empty") throw Exception(MR.strings.library_empty.toPlatformString())
} }
library.categories.value = categories.sortedBy { it.order } library.categories.value = categories.sortedBy { it.order }
updateCategories(categories) updateCategories(categories)