is there a way to define localized strings in an X...
# multiplatform
d
is there a way to define localized strings in an XML file in the CommonMain
resources
folder, and access the strings (just within the CommonMain, as it’s for a shared KMPViewModel) similarly to how it happens in Android?
m
did you try moko resources? https://github.com/icerockdev/moko-resources It is a great library and supports localisation
1
d
+1 Moko resources, we are using this successfully
d
It seems Moko focuses on making CommonMain resources available to the Android and iOS platform specific code, by merging them into the platform-specific localization systems. I am just interested in using resources in CommonMain. I was wondering if KMP had by default for CommonMain a similar
res
mechanism of the Android framework. But I guess I am asking too much.
d
We achieved this in CommonMain by doing some platform component injection into the common space during App Startup. ...never the prettiest approach, but it works.