Keep the language picker's selection marked
Bumps floret-kit to ad440e8, whose AppLanguage.currentTag(supported) maps the platform's normalised locale tag back onto the shipped one.
This commit is contained in:
@@ -23,6 +23,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
[bkrz](https://weblate.dev.jeanlucmakiola.de/user/bkrz/) for getting it
|
||||
started; help finishing it is very welcome.
|
||||
|
||||
### Fixed
|
||||
- **The language picker forgot which language was picked.** Android hands the
|
||||
applied language back with its script filled in — Simplified Chinese goes in
|
||||
as `zh-CN` and comes out as `zh-Hans-CN` — so after a restart no entry in
|
||||
Settings → Language showed as selected, and the row above it named the
|
||||
language the long way round. Only languages that imply a script were
|
||||
affected.
|
||||
|
||||
## [2.19.0] — 2026-08-10
|
||||
|
||||
### Added
|
||||
|
||||
@@ -302,13 +302,14 @@ private fun ReportProblemRow(position: Position) {
|
||||
@Composable
|
||||
private fun LanguageRow(position: Position) {
|
||||
val context = LocalContext.current
|
||||
val supported = remember { AppLanguage.supportedTags(context, R.xml.locales_config) }
|
||||
// Setting a locale recreates the activity; mirror the choice locally so the
|
||||
// row updates instantly even before the recreation lands.
|
||||
var current by remember { mutableStateOf(AppLanguage.currentTag()) }
|
||||
var current by remember { mutableStateOf(AppLanguage.currentTag(supported)) }
|
||||
var showDialog by remember { mutableStateOf(false) }
|
||||
|
||||
// null = follow the system; the rest are BCP-47 tags from locales_config.xml.
|
||||
val options = remember { listOf<String?>(null) + AppLanguage.supportedTags(context, R.xml.locales_config) }
|
||||
val options = remember(supported) { listOf<String?>(null) + supported }
|
||||
|
||||
GroupedRow(
|
||||
title = stringResource(R.string.settings_language),
|
||||
|
||||
Submodule floret-kit updated: 05c79f2afc...ad440e8cac
Reference in New Issue
Block a user