I tried to use string formatted from the shared co...
# moko
a
I tried to use string formatted from the shared code but it seems to not work, although its works fine on the platform side.
Here is my string resource:
Copy code
<string name="login_succeed">Login succeed! \'%s\'</string>
And here is the used way to get the formatted string:
Copy code
MR.strings.login_succeed.format(arg).toString()
I noticed that when I use the above code on the Android side it gives me another form of
toString()
that accept the context as parameter, can I use the same function in the shared code?
a
you can't get localized text in shared code - android require context to get String. only in compose multiplatform you can get localized string inside @Composable
a
I see, thanks