ascii
08/26/2023, 10:08 PMandroidx.compose.ui.text.intl.Locale
over java.util.Locale
/ androidx.core.os.LocaleListCompat
. Best I can figure is that Compose Locale would be useful in multiplatform projects?Stylianos Gakis
08/26/2023, 10:14 PMascii
08/26/2023, 10:34 PMAppCompatDelegate.getApplicationLocales()[0] ?: LocaleListCompat.getDefault()[0] ?: Locale.getDefault()
, because I need it in non-Compose parts of the app too.
intl.Locale feels easy to use, because it's just one call: Locale.current
. It works, but you can't pass it into platform APIs or do anything else with it. It wraps java.util.Locale
in (internal) AndroidLocale
, toJavaLocale()
.
I initially went down this route because I thought current
might mean it's a composable, so it would react to changes or can be "provided", but no. It's just a static getter.Stylianos Gakis
08/26/2023, 10:42 PM