This PR is a followup to #1264 and #1277. Using the Run on Save extension, we can essentially close the loop with regards to quickly and easily adding new translations. Run on Save allows us to execute an arbitrary script upon saving a matching set of files. I have it set up to match .arb files and perform the following steps.
Activate arb_utils package (should be a no-op if already installed)
Run arb_utils generate-meta (ensures that all keys have the metadata key, which is not added automatically by i18n-ally)
Run arb_utils sort (self-explanatory)
Run flutter gen-l10n
If there are errors with any of these steps (like the recent issue with activating arb_utils) it should not affect the developer. If needed, the logs can be found in the Output window.
As before, these new entries in settings.json only affect developers using VS Code and only those with the Run on Save extension installed.
P.S. Can you verify that these commands run successfully on Mac as well?
Screenshots / Recordings
Here is a full demo of the end-to-end workflow. You can see how easy things are now! :blush:
Pull Request Description
This PR is a followup to #1264 and #1277. Using the Run on Save extension, we can essentially close the loop with regards to quickly and easily adding new translations. Run on Save allows us to execute an arbitrary script upon saving a matching set of files. I have it set up to match
.arb
files and perform the following steps.arb_utils
package (should be a no-op if already installed)arb_utils generate-meta
(ensures that all keys have the metadata key, which is not added automatically byi18n-ally
)arb_utils sort
(self-explanatory)flutter gen-l10n
If there are errors with any of these steps (like the recent issue with activating
arb_utils
) it should not affect the developer. If needed, the logs can be found in the Output window.As before, these new entries in
settings.json
only affect developers using VS Code and only those with the Run on Save extension installed.P.S. Can you verify that these commands run successfully on Mac as well?
Screenshots / Recordings
Here is a full demo of the end-to-end workflow. You can see how easy things are now! :blush:
https://github.com/thunder-app/thunder/assets/7417301/fe051c12-ca0a-4ef3-a175-3fcc4641a35e