Workflow clarification #3321
-
Hi!
How much I loved this when I got it working :D Now, we also have a design system on another repo (https://github.com/uidu-org/guidu), and some of these components include some strings we want to translate.
Now the question: what should we do with this json files? Should we commit this or compile them as well on a github action to distribute only the translated messages? But I don't understand when this should be done, and if it conflicts with the main application locale compilation script Hope I was clear enough! (I know I wasn't, sorry, it's unclear to me) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
If I understand your question correctly, you should distribute lang files along with packages, so the consuming application can bundle them together. The compilation of those lang files can happen during bundling, or during child package distribution, as long as during bootstrapping the correct messages are passed in. With regards to the command, I think you can run |
Beta Was this translation helpful? Give feedback.
-
Thank you very much @longlho! lang/en.json "6xsuuc": {
"defaultMessage": "Sort A {icon} Z"
}, lang/it.json "6xsuuc": {
"defaultMessage": "Ordina A {icon} Z"
}, etc. Not the already compiled ones, am I right? |
Beta Was this translation helpful? Give feedback.
If I understand your question correctly, you should distribute lang files along with packages, so the consuming application can bundle them together. The compilation of those lang files can happen during bundling, or during child package distribution, as long as during bootstrapping the correct messages are passed in.
With regards to the command, I think you can run
formatjs compile "node_modules/**/lang/en.json" "./lang/en.json" --ast --out-file lang/en.json
and repeat for all of your supported locales.