Stylianos Gakis01/17/2023, 9:18 AM
in compose right? I can see Locale is there, which only gives you a way to fetch the locale, not to update it, and looking at the implementation it doesn’t seem to use the
aka the Per-App Language Preferences API. Oh and also it doesn’t give a java.util.Locale so there’s that. Am I missing something here? How do you folks typically fetch the proper locale in your composables aside from just passing it down the chain all the way through?
ephemient01/17/2023, 9:31 AM
Albert Chang01/17/2023, 9:32 AM
Stylianos Gakis01/17/2023, 9:41 AM
instead of LocalContext… right? Not in addition to it I assume. Also with that said, I assume both of these do not interact with the per-app language APIs, do they? Like if I use those APIs to manage my locale, do you know if that will update the locales inside LocalConfiguration?
requires API 24 or newer though 😵 Is this fixable in some way, with
or something like that? If not I guess I need to make my own LocalLocale and make sure I am also subscribing to
myself to react to such config changes.
works fine but is deprecated over
which is >API24 only. Anyway, gonna use the deprecated one then.
Albert Chang01/17/2023, 10:15 AM
And I believe per-app language API should also update the configuration.
Stylianos Gakis01/17/2023, 10:19 AM
This seems to cover all Android versions and I will just double check that it follows the per-app language APIs too.
val locale = ConfigurationCompat.getLocales(LocalConfiguration.current)