diff --git a/android/app/src/main/java/com/fabledsword/inkwell/ui/TagsScreen.kt b/android/app/src/main/java/com/fabledsword/inkwell/ui/TagsScreen.kt index fa99a18..66270f7 100644 --- a/android/app/src/main/java/com/fabledsword/inkwell/ui/TagsScreen.kt +++ b/android/app/src/main/java/com/fabledsword/inkwell/ui/TagsScreen.kt @@ -39,6 +39,7 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip +import androidx.compose.ui.res.pluralStringResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.input.ImeAction import androidx.compose.ui.unit.dp @@ -203,7 +204,7 @@ fun TagsScreen( body = open.tag.count ?.takeIf { it > 0 } - ?.let { stringResource(R.string.tags_delete_body_counted, it) } + ?.let { pluralStringResource(R.plurals.tags_delete_body_counted, it.toInt(), it.toInt()) } ?: stringResource(R.string.tags_delete_body), footnote = stringResource(R.string.tags_delete_from_text), confirm = stringResource(R.string.tags_delete_confirm), @@ -378,8 +379,7 @@ private fun countLabel(count: Long?): String = when { count == null -> "" count <= 0L -> stringResource(R.string.tags_count_none) - count == 1L -> stringResource(R.string.tags_count_one) - else -> stringResource(R.string.tags_count, count.toInt()) + else -> pluralStringResource(R.plurals.tags_count, count.toInt(), count.toInt()) } /** diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index 60f89f0..0f7d5f2 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -137,8 +137,10 @@ Back New tag Create - %1$d notes - 1 note + + %d note + %d notes + No notes yet No tags yet Create one above, or write a #tag in a note and it becomes one. @@ -166,7 +168,10 @@ Delete Delete %1$s? It will be removed from every note that has it, on every device you sync with. The notes themselves are kept. - It is on %1$d notes. It will be removed from all of them, on every device you sync with. The notes themselves are kept. + + It is on %d note. It will be removed from it, on every device you sync with. The note itself is kept. + It is on %d notes. It will be removed from all of them, on every device you sync with. The notes themselves are kept. + Delete