*Has anyone figured out a good way to keep strings...
# compose
z
Has anyone figured out a good way to keep strings organized (
composeResources
) across many languages?
My workflow usually involves adding it to the base language, then translating & adding it to all the others. This is fine, it just takes a lot of time, and if I forget to do it for some language - its very likely that I wont notice unless I have a script to catch it. Ive looked into... • 3:rd party services; same as good ol' Android strings where you upload & download all the folders. • Skipping composeResources for other solutions that keep all strings in one file. • Task that adds the strings to all the files automatically, with some additional tag that Id use to know that the string is pending translation.
👀 1
c
I struggle with this too. With Android Studio and Android's string resources, this was very easy. AS has lint warnings, you can navigate from a resource in one language to the other, there's the translation editor. None of these work with composeResources. I don't know if it is just me, but in my project, Cmd+Click on a
Res.string.foo
doesn't even take me to the strings.xml file. It takes me to some compiled code instead.
t
I do have exactly same problem currently. Would be nice if someone could implement a plugin to do this. In the mean time what works for me is to just copy all string resources to a android module. Do the checks and if you change something copy back the changes to the compose resources. But of course not very convenient solution.
t
I use Crowdin for this, for closed source projects it is a paid service
z
Im sure all of this will work 10_000% better soon, just by way of the KMP integration improving.. But in the meantime Im strongly considering creating a plugin for it. Nothing official, but it would parse all strings and pick up missing ones. For my case Id like it to append new entries wherever theyre missing so that I can find & translate them. If theres interest Ill share the code for it here.
c
I actually think this is a bug or it is something about how my project is structured. Because the same happened in Fleet (well - before they announced new plans for it); and at least Cmd+Click was supposed to work in Fleet. In the KotlinConf talk about Compose for iOS today, I also saw Seb Cmd+Click on a Res.drawable.foo (this is with the new KMP tooling inside AS/IJ) and it opened the correct drawable.
z
Im on Windows so Im not expecting any miracles (the new plugin is not supported on Windows yet), but definitely nice QOL to be able to click directly into the string/etc declaration from code.
I guess we live in interesting times, Claude (AI) managed to one-shot the entire thing and the task produces output like this for each language. ?? [zh] 980/984 strings Missing 4 strings: - app_name - exercise_sort_alphabtically - exercise_sort_frequency - exercise_sort_recency