Clean localization data files before pulling from Transifex #2153
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
The localization of the UI strings specific to the Arduino IDE application is done via the Transifex localization platform. A scheduled workflow pulls the data from Transifex weekly and submits a pull request for the updates.
Previously, the script used to pull the data did not clean the data files before pulling. This meant that a vestigial file would accumulate in the repository whenever a language was removed from the Transifex project.
Change description
The accumulation is avoided by deleting the data files for the locales managed on Transifex (all locales other than the source English locale) before downloading the data from Transifex.
Other information
Fixes #2152
The workflow is configured to only trigger on a schedule and the requirement of the Transifex credentials makes it inconvenient to run the script locally. So I did a demonstration run of the workflow. I changed the workflow to print a diff in the logs of the effect of running the script instead of submitting a PR as it usually does:
https://github.com/arduino/arduino-ide/actions/runs/5664882697/job/15348851968#step:8:1
Note that 14 files are deleted, all of which are for languages no longer in the Transifex project (likely removed due to #1447):
https://explore.transifex.com/arduino-1/ide2/
Reviewer checklist