Ok, a little stuck on this one, besides just inven...
# multiplatform
b
Ok, a little stuck on this one, besides just inventing a bangbang replacement scheme like the old days. Since String.format() is only available on the Kotlin/jvm, and I can't use a string template unless i construct the string in context. How are you folks handling situation where you have strings with arguments you need to apply later? For example: "hello %1$s" or even a template "hello $value"
i
I think a lot of people use Moko. We ended up building tooling ourselves to better fit our needs but moko otherwise works fine. https://github.com/icerockdev/moko-resources
b
Yeah, its the same here, I am trying not to use it. I'm building a date format library and trying to keep all the extra dependencies out of it. including coroutines and compose.
i
Is the new date tooling not sufficient to plug in whatever additional formatters you need?
b
No, its too simple. I am looking for something like ios and android have where you can specify the short/medium/long and it does it relative to the locale. Also maybe something like DateUtil where it give you more descriptive formatting relative to locale. I plane to release it in case anyone else can use it.
but to do that, i need to not use the resource system in kmp, since it relies on coroutines and loading resources from the fs
👍 1
of course, the easiest thing to do is just delegate down to the platform, but I think it would be helpful to have a kotlin only solution.
and heck, we do this because its fun to build 🙂