Skip to content

Clean localization data files before pulling from Transifex #2153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 26, 2023

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Jul 26, 2023

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

  • PR addresses a single concern.
  • The PR has no duplicates (please search among the Pull Requests before creating one)
  • PR title and description are properly filled.
  • Docs have been added / updated (for bug fixes / features)

@per1234 per1234 added topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project labels Jul 26, 2023
@per1234 per1234 requested a review from kittaakos July 26, 2023 05:09
@per1234 per1234 self-assigned this Jul 26, 2023
Copy link
Contributor

@kittaakos kittaakos left a comment

Choose a reason for hiding this comment

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

Thank you, Per!


I proposed a change as I am about to remove the shelljs dependency from the scripts. I would use vanilla Node.js unless some functionality is not available. Since you have already set up the infra to verify the correctness of this change, it would be simple to try the translation files cleanup with Node.

If you want to merge, please proceed and I will handle any conflicts at #2144 later.

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.

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.
@per1234 per1234 force-pushed the clean-localization-data branch from a861cca to d3c9614 Compare July 26, 2023 07:41
@kittaakos
Copy link
Contributor

Thank you for the updates! It's looking great 🤩

@per1234 per1234 merged commit 144df89 into arduino:main Jul 26, 2023
@per1234 per1234 deleted the clean-localization-data branch July 26, 2023 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Redundant localization data files
2 participants