formatjs workflow for re-extraction of messages #3491
Unanswered
alexsivris
asked this question in
Q&A
Replies: 1 comment 3 replies
-
I'm not sure I understand your flow. Why do you run extraction for |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello! The issue I’m having with my workflow is that if I continue adding default messages in the app I have to re-do all of the translations with every subsequent extractions. Specifically, I need to carefully override the translations from the previously extracted and translated json file to the newly extracted json file that contains the new IDs.
Here's the workflow I am following:
yarn extract 'src/**/*.ts*' --ignore='**/*.d.ts' --out-file temp/i18n/extracted/en.json --id-interpolation-pattern '[sha512:contenthash:base64:6]'
As an output, I get the file en.json with default messages and descriptions as expectedyarn extract 'src/**/*.ts*' --ignore='**/*.d.ts' --out-file temp/i18n/extracted/el.json --id-interpolation-pattern '[sha512:contenthash:base64:6]'
yarn compile temp/i18n/en.json --ast --out-file src/constants/i18n/en.json
and for "el" respectivelyyarn compile build/i18n/el.json --ast --out-file src/constants/i18n/el.json
. The final json files that contain only the IDs and strings are generated and can be used.Initially, I expected that formatjs extraction results in generated json files for all locales (el and en) as opposed to only one, taking previous translations into consideration so they don't have to be done again.
Am I missing something critical or is this how the workflow is meant to be?
Edit: the issue seems to be similar this this #1554, but seems like there's no clear solution. Still would be very interested to learn how you deal with this situation.
Beta Was this translation helpful? Give feedback.
All reactions