From 999c900f7fb8d6428efa6a8639c9d8711b807957 Mon Sep 17 00:00:00 2001 From: Helium314 Date: Fri, 28 Feb 2025 21:42:09 +0100 Subject: [PATCH] clearly show when a subtype is custom in languages & layouts --- .../keyboard/settings/screens/LanguageScreen.kt | 9 ++++++--- app/src/main/res/values/strings.xml | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/helium314/keyboard/settings/screens/LanguageScreen.kt b/app/src/main/java/helium314/keyboard/settings/screens/LanguageScreen.kt index effb2377f..4a8c87c1c 100644 --- a/app/src/main/java/helium314/keyboard/settings/screens/LanguageScreen.kt +++ b/app/src/main/java/helium314/keyboard/settings/screens/LanguageScreen.kt @@ -89,9 +89,12 @@ fun LanguageScreen( var showNoDictDialog by remember { mutableStateOf(false) } Column(modifier = Modifier.weight(1f)) { Text(item.displayName(ctx), style = MaterialTheme.typography.bodyLarge) - val description = item.getExtraValueOf(ExtraValue.SECONDARY_LOCALES)?.split(Separators.KV) - ?.joinToString(", ") { it.constructLocale().localizedDisplayName(ctx) } - if (description != null) // todo: description should clarify when it's a default subtype that can't be changed / will be cloned + val description = if (SubtypeSettings.isAdditionalSubtype(item)) { + val secondaryLocales = item.getExtraValueOf(ExtraValue.SECONDARY_LOCALES)?.split(Separators.KV) + ?.joinToString(", ") { it.constructLocale().localizedDisplayName(ctx) } + stringResource(R.string.custom_subtype) + (secondaryLocales?.let { "\n$it" } ?: "") + } else null + if (description != null) Text( text = description, style = MaterialTheme.typography.bodyMedium, diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 02e35140c..391365aa8 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1005,4 +1005,6 @@ New dictionary: Really delete %s? Invalid name + + Custom subtype