Extracting messages into components folder #2786
-
Hi, I'm running into an issue where I would like to extract my components messages individually. We have a component library repo where we would like each component to own its translations files. It would present itself as the following structure:
Each component is then exported into its own package and when using them into another project we can use The problem is that using I didn't find a solution in the doc neither in the discussions. Is there a way to do it easily ? Here is what I'm thinking of doing: finding all directories which have a lang subdir: executing a script to run |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
yes I'd actually recommend you doing that. The CLI is meant to slot into more sophisticated workflow (e.g we use |
Beta Was this translation helpful? Give feedback.
-
I'm also using formatjs to handle translation within a component library and am applying the technique above. However, many of our components import shared utility functions that make use of |
Beta Was this translation helpful? Give feedback.
yes I'd actually recommend you doing that. The CLI is meant to slot into more sophisticated workflow (e.g we use
bazel
so having simple parsing a folder into a file works and more complexity actually hurts)