Skip to content

Conversation

@micahmo
Copy link
Member

@micahmo micahmo commented Apr 10, 2024

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.

  • 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! 😊

run-on-save.mp4

Copy link
Member

@hjiangsu hjiangsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Tested it on Mac and it seems to be running well

@hjiangsu hjiangsu merged commit 958639b into thunder-app:develop Apr 11, 2024
@micahmo micahmo deleted the feature/run-on-save branch April 11, 2024 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants