-
-
Notifications
You must be signed in to change notification settings - Fork 279
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
feat(ci): unused translations auto cleanup #13444
Conversation
3187f48
to
a0138aa
Compare
name: "[Check] remove unused messages and create PR" | ||
|
||
on: | ||
workflow_dispatch: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@karliatto would you please take over this PR and incorporate into as a nightly check similarly to what you are doing now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to add another action? You're also not using some naming convention for the file. We can add it to the same action but just add a trigger that checks if the action was scheduled to run to only do this instead of updating it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's originally part of [test] misc
which runs nightly, but I didn't set that up to automatically create PRs, since it could potentially create duplicate PRs if the first one is not merged right away.
Also I have another idea - maybe this could happen as a part of Crowdin sync?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, doing this every time you sync crowdin seems a bit better to me. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what is the final idea? will it be run with the Crowding sync or with this workflow as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add it to the Crowdin sync. It should run before the upload to Crowdin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The upload also deletes from Crowdin? I'm just thinking whether it would be dangerous if someone ran it without checking the unused strings prior
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a key does not exist in messages.ts
, Crowdin sync deletes it from Crowdin and the translation JSONs. Can there be false positives from the script removing unused messages? If so, it has to be run separately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most likely not, except for the possibility of dynamic strings that are not marked as such.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a checkbox as an input to confirm removing to make it safer
5d8d546
to
8312818
Compare
8312818
to
42d3835
Compare
Description
Adds a
--cleanup
option to thetranslations:list-unused
script, which automatically removes the unused messages from the file.The script also includes a
--pr
option, which will create a new branch with this change and submit a PR.This can be run from a new workflow in GitHub actions. The workflow is triggered manually to prevent too many PRs being created.