Note that I’ve simplified many things. You shouldn’t just use the first locale in the locale list, and locale matching is much more complicated than this. Also you probably want to cache the map for current locale as locale matching is rather expensive.
@Albert Chang Should I be able to monitor the changes in the language environment in other ways and then recomposition?
I don’t think it is necessary for each string to know when the locale is changed. My understanding is that only need to update the composable tree after the locale changes?
1 year ago
@Chachako Just use
as it is monitored by the runtime. It's a waste to recompose the whole tree when you can only recompose part of it. The whole point of compose compiler plugin is to enable compose runtime to only recompose what needs to be recomposed. And anyway you need to notify the runtime when locale changes.