Is it possible to use `Locale.getAvailableLocales(...
# compose
j
Is it possible to use
Locale.getAvailableLocales()
in CMP scope? When using Locale.current you get platform variant not seems to expose these kind of APIs. If not, is there any libraries to do this, I couldve missed?
d
Locale.getAvailableLocales()
is available only on desktopMain and androidMain sourceSet's. But you can create your own expect / actual implementation for all platforms. On iOS sourceSet you can use avaliableLocaleIdentifiers for implementation
1
j
Thanks! 👌
Also one issue I think here, is that the list in iOS and Android/Jvm will differ right. In my case want to use it to get dynamic list of spoken languages in the world. It will be used for end user to select which languages they speak 🙂 Not related to any Locale things in the end. But was thinking that API would be possible to use for this use case.