The epsilon-string module provides a multiplatform way to manage and resolve string resources using Moko Resources and Jetpack Compose.
Use this module when shared code needs to work with both localized resources and plain string values through a single abstraction.
commonMain and use them on Android and iOS.@Composable functions for resolving resources.String literals and StringResource objects.A data class that can hold either a hardcoded string or a Moko StringResource. This is useful for APIs that can return either server-side strings or localizable resource keys.
Basic KmpString example
val title = KmpString(resource = MR.strings.app_name)
val customTitle = KmpString(string = "Welcome!")You can resolve a KmpString into a primitive String using platform-specific extensions:
// In a Composable function
val resolved: String = myKmpString.rememberLocalized()
// In standard code (requires Context)
val resolved: String = myKmpString.localized(context)Add the dependency to your commonMain:
dependencies {
implementation("ag.sportradar.mobile.epsilon:epsilon-string:<version>")
}To use Moko Resources in your project, ensure you have the plugin applied and configured in your build.gradle.kts:
multiplatformResources {
resourcesPackage.set("com.your.package")
resourcesClassName.set("MR")
}