Hi, I have a best practice q about KMM & Local...
# multiplatform
s
Hi, I have a best practice q about KMM & Localization + resource sharing. We can share resources w/this awesome looking API: https://github.com/icerockdev/moko-resources, but my question is: what do ppl think about doing this? I’ve read that some ppl think it’s best to let Android + iOS handle this in their own way. How scalable is it? I believe in keeping UI’s light, and don’t want to maintain 2 sets of resources, BUT, I also don’t want to run into all sorts of issues back on the front end. my use case is a dynamic onboarding screen like this:
Copy code
/**
 * All of the data elements for an Onboarding screen.
 * This data comes from app resources.
 */
data class OnboardingScreen(
    val currentScreen: Int,
    @DrawableRes val headingIcon: Int,
    @StringRes val headingText: Int,
    @StringRes val subHeadingText: Int,
    @StringRes val cardHeading: Int,
    @StringRes val cardSubHeadingOne: Int,
    @StringRes val cardSubHeadingTwo: Int,
    val cardDetails: CardDetailsOption
)
a
so far most of my UI code directly references the strings, and in the cases were usecase or repository code has to get a string to the UI, I pass back
StringResources
, our use cases might be a bit different, but it's been pretty scalable for me so far
s
Ok great, thanks - I ran out of coding time today, but I think I'm just going to go ahead and give it a try tomorrow - it seems like a good way to go overall... I'm fairly new to iOS, so I can't wait to see how it all comes together
i
Since version 0.22.1 of moko-resource, SVG is also supported, so I can wholeheartedly recommend it.
s
Oh nice - ok, thanks….