Skip to content
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

Add crowdin translation-upload (feedback) action #2999

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ferdnyc
Copy link
Contributor

@ferdnyc ferdnyc commented Jul 2, 2023

Update 2

I'm beginning to suspect (though they never actually say it anywhere, that I can find) that the "Always import new translations..." option is an Enterprise-only feature. So, I take it back (again)... it probably is necessary to do things this way, after all.

Update

Turns out this may not be necessary at all, as there may be a simpler solution.

According to Crowdin's docs, their GitHub integration should now have a checkbox for "Always import new translations from the repository". It's turned off by default, but turning it on might set all this up for us.

@parg, @TuxPaper, worth a look?
cc: @lislei

image

 ↑ (It's down here at the bottom)

Original summary

This PR grew out of discussion in #973, regarding feeding translations back to Crowdin when they're updated locally. The code here is an attempt to make that work. It is untested, because it cannot be tested until some prerequisites are met.

This PR will not work and SHOULD NOT BE MERGED unless the repository is first configured with the necessary Crowdin credentials so that the action has access to upload into the Crowdin project.

Obtaining that access requires someone with admin access to both the Crowdin and Github sides of the project to do the following:

  1. Go to https://crowdin.com/project/biglybt/settings#api and obtain the crowdin Project ID (API v2)
  2. Go to https://crowdin.com/settings#api-key and generate a personal token to upload to the project
  3. Go to https://github.com/BiglySoftware/BiglyBT/settings/secrets/actions and create two secrets:
    • CROWDIN_PROJECT_ID should store the project ID
    • CROWDIN_PERSONAL_TOKEN should store the generated token

Only after that is done, will it be possible to TEST this PR. Because it currently contains the setting dryrun_action: true, it still won't do anything that would affect the Crowdin project.

If things look sane, then we can remove that line and test it for real.

cc: @parg @TuxPaper

@ferdnyc
Copy link
Contributor Author

ferdnyc commented Jul 2, 2023

Oh, right: Because Github sensibly won't run newly-created actions from PRs, this will have to be merged before any testing can be done. So, I guess, once the secrets are created, it would probably make sense to merge this with the dryrun_action: true line still in it. That'll let us see if things look right, at which point a subsequent commit/PR can remove the dryrun line.

@ferdnyc
Copy link
Contributor Author

ferdnyc commented Jul 2, 2023

I added workflow_dispatch to the action as a trigger method, so that it will be possible for project admins to manually run the workflow from the Actions tab of the repo. That'll probably be useful at least for testing, because it's configured to only automatically run when a commit changes files in the core/src/com/biglybt/internat/ directory. (So, very infrequently.)

@ferdnyc
Copy link
Contributor Author

ferdnyc commented Jul 2, 2023

That failure looks transient, it died in the wiki tests on Windows for some reason.

@ferdnyc
Copy link
Contributor Author

ferdnyc commented Jul 13, 2023

I'll force-push the branch so the CI restarts, see what that failure was all about.

(Edit: As suspected, it was just random transient breakage.)

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.

None yet

1 participant