clearly show when a subtype is custom in languages & layouts

This commit is contained in:
Helium314 2025-02-28 21:42:09 +01:00
parent 27e2a6f584
commit 999c900f7f
2 changed files with 8 additions and 3 deletions

View file

@ -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,

View file

@ -1005,4 +1005,6 @@ New dictionary:
<string name="delete_confirmation">Really delete %s?</string>
<!-- Message when chosen name is invalid (empty or already taken) -->
<string name="name_invalid">Invalid name</string>
<!-- Description indicating a subtype in Locales & Layouts has customizations -->
<string name="custom_subtype">Custom subtype</string>
</resources>