Update grammar info string resource naming, add hasFeatures helper to Vocabulary model, and update grammar count logic in VocabularyViewModel
This commit is contained in:
@@ -57,6 +57,10 @@ data class VocabularyItem(
|
||||
features = switchedFeaturesJson
|
||||
)
|
||||
}
|
||||
|
||||
fun hasFeatures(): Boolean {
|
||||
return !features.isNullOrBlank()
|
||||
}
|
||||
}
|
||||
|
||||
@Serializable
|
||||
|
||||
@@ -90,7 +90,7 @@ fun StatusWidget(
|
||||
if (itemsWithoutGrammarCount > 0) {
|
||||
StatusItem(
|
||||
icon = AppIcons.Error,
|
||||
text = stringResource(R.string.items_without_grammar_infos),
|
||||
text = stringResource(R.string.label_items_without_grammar),
|
||||
count = itemsWithoutGrammarCount,
|
||||
onClick = onNavigateToNoGrammar,
|
||||
color = MaterialTheme.colorScheme.error
|
||||
|
||||
@@ -1327,7 +1327,7 @@ class VocabularyViewModel @Inject constructor(
|
||||
|
||||
val itemsWithoutGrammarCount: StateFlow<Int> = vocabularyItems
|
||||
.map { items ->
|
||||
items.count { it.features.isNullOrEmpty() }
|
||||
items.count { it.hasFeatures() }
|
||||
}
|
||||
.stateIn(
|
||||
scope = viewModelScope,
|
||||
|
||||
@@ -419,7 +419,6 @@
|
||||
<string name="label_all_types">Alle Typen</string>
|
||||
<string name="filter_and_sort">Filtern und Sortieren</string>
|
||||
<string name="language_with_id_d_not_found">Sprache mit ID %1$d nicht gefunden</string>
|
||||
<string name="items_without_grammar_infos">Einträge ohne Grammatikinfos</string>
|
||||
<string name="resolve_missing_language_id">Fehlende Sprach-ID auflösen: %1$d</string>
|
||||
<string name="found_d_items_using_this_missing_language_id">%1$d Einträge mit dieser fehlenden Sprach-ID gefunden.</string>
|
||||
<string name="hide_affected_items">Betroffene Einträge ausblenden</string>
|
||||
|
||||
@@ -415,7 +415,6 @@
|
||||
<string name="label_all_types">Todos os Tipos</string>
|
||||
<string name="filter_and_sort">Filtrar e Ordenar</string>
|
||||
<string name="language_with_id_d_not_found">Idioma com id %1$d não encontrado</string>
|
||||
<string name="items_without_grammar_infos">Itens sem infos de gramática</string>
|
||||
<string name="resolve_missing_language_id">Resolver ID de Idioma Ausente: %1$d</string>
|
||||
<string name="found_d_items_using_this_missing_language_id">Encontrados %1$d itens usando este ID de idioma ausente.</string>
|
||||
<string name="hide_affected_items">Ocultar Itens Afetados</string>
|
||||
|
||||
@@ -210,7 +210,7 @@
|
||||
<string name="item_id">Item ID: %1$d</string>
|
||||
|
||||
<string name="items">%1$d items</string>
|
||||
<string name="items_without_grammar_infos">Items without grammar infos</string>
|
||||
<string name="label_items_without_grammar">Items without grammar infos</string>
|
||||
|
||||
<string name="keep_both">Keep Both</string>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user