JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
15.26k stars 1.11k forks source link

String resource mapping web 1.6.10-rc03 #4837

Open mallumoSK opened 1 month ago

mallumoSK commented 1 month ago

Hi i have little problem with string resources mapping on web target. Previous version reads strings directly from "strings.xml" but now is from "strings.commonMain.cvr" That is ok + good idea But: In ours project are translations edited -> generated -> stored in runtime. Problems are in string reader. Every resource (generated by compose plugin) contains reference to translations by org.jetbrains.compose.resources.ResourceItem constructor contains parameters:

    internal val offset: Long,
    internal val size: Long,

I understand why ... because of speed, but when are resources generated again (on the server) strings have different size and fallowing offset too.

Compiling whole project over and over again is not good idea, currently i rewrite parser without offsets, but pernament version inside library will helps

terrakok commented 1 month ago

Hi @mallumoSK ! Thank you for the feedback, I understand your case but I guess we won't change it it the near future. I may suggest you a workaround: to wrap your string resources to the independent library module and to make resource's acessors public. You can build and publish the library after strings changes directly on the server.