From cf127512d5f1ed83e66951d3d3b8059d07fccf76 Mon Sep 17 00:00:00 2001 From: Syer10 Date: Sat, 12 Mar 2022 21:58:26 -0500 Subject: [PATCH] Localize library empty string --- i18n/src/commonMain/resources/MR/values/base/strings.xml | 1 + .../kotlin/ca/gosyer/ui/library/LibraryScreenViewModel.kt | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/i18n/src/commonMain/resources/MR/values/base/strings.xml b/i18n/src/commonMain/resources/MR/values/base/strings.xml index 1e287000..6c1dd78b 100644 --- a/i18n/src/commonMain/resources/MR/values/base/strings.xml +++ b/i18n/src/commonMain/resources/MR/values/base/strings.xml @@ -77,6 +77,7 @@ Default + Library is empty Page %1$d diff --git a/presentation/src/jvmMain/kotlin/ca/gosyer/ui/library/LibraryScreenViewModel.kt b/presentation/src/jvmMain/kotlin/ca/gosyer/ui/library/LibraryScreenViewModel.kt index 54f8c9d9..e9a90887 100644 --- a/presentation/src/jvmMain/kotlin/ca/gosyer/ui/library/LibraryScreenViewModel.kt +++ b/presentation/src/jvmMain/kotlin/ca/gosyer/ui/library/LibraryScreenViewModel.kt @@ -15,6 +15,7 @@ import ca.gosyer.data.models.Manga import ca.gosyer.data.server.interactions.CategoryInteractionHandler import ca.gosyer.data.server.interactions.LibraryInteractionHandler import ca.gosyer.data.server.interactions.UpdatesInteractionHandler +import ca.gosyer.i18n.MR import ca.gosyer.uicore.vm.ContextWrapper import ca.gosyer.uicore.vm.ViewModel import kotlinx.coroutines.async @@ -94,7 +95,7 @@ class LibraryScreenViewModel @Inject constructor( categoryHandler.getCategories() .onEach { categories -> if (categories.isEmpty()) { - throw Exception("Library is empty") + throw Exception(MR.strings.library_empty.toPlatformString()) } library.categories.value = categories.sortedBy { it.order } updateCategories(categories)