-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Automatic update of translations #2585
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
Conversation
Signed-off-by: Jonas Franz <[email protected]>
Adding build step for uploading translations Signed-off-by: Jonas Franz <[email protected]>
Signed-off-by: Jonas Franz <[email protected]>
I have added secret for crowdin_key. locale_en-US.ini is the right name. |
As said on discord, maybe it makes more sense to build a drone plugin for upload and download of translations, this way anybody can prepare a malicious pull request to read the access token because I can only limit the injection to the used image and the events. |
Codecov Report
@@ Coverage Diff @@
## master #2585 +/- ##
=======================================
Coverage 27.33% 27.33%
=======================================
Files 86 86
Lines 17137 17137
=======================================
Hits 4684 4684
Misses 11775 11775
Partials 678 678 Continue to review full report at Codecov.
|
Signed-off-by: Jonas Franz <[email protected]>
I've created a plugin for this PR and updated the .drone.yml to use this plugin. The plugin requires the crowdin key as secret Link to plugin repo: https://github.com/JonasFranzDEV/drone-crowdin |
Working example of the plugin: Drone: https://drone.jonasfranz.software/JonasFranzDEV/Crowdin-Demo/5 |
.drone.yml
Outdated
@@ -207,6 +207,16 @@ pipeline: | |||
event: [ push ] | |||
branch: [ master ] | |||
|
|||
translations: | |||
image: jonasfranz/crowdin | |||
secrets: [ CROWDIN_KEY ] |
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.
Why secret is uppercase while others in this file are lowercase?
Signed-off-by: Jonas Franz <[email protected]>
LGTM you should probably submit this plugin to drone-plugins :) |
@lafriks I created a PR for the plugin: drone/drone-plugin-index#71 |
@@ -207,6 +207,16 @@ pipeline: | |||
event: [ push ] | |||
branch: [ master ] | |||
|
|||
translations: | |||
image: jonasfranz/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.
pull: true below this line
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.
@tboerger Done
As I understand the plugin only uploads specified files to crowdin to make them available for translation.. |
@daviian Yes it should, but actually it only supports uploading files. I could add downloading in future. But I think that it is enough for this PR. |
LGTM |
Make LG-TM work |
Maybe I can start to integrate that together with Franz when this plugin gets transferred to the drone-plugins org |
drone is failed, see https://drone.gitea.io/go-gitea/gitea/910/15 |
We have to add ignore_branch since we are not using branches at crowdin |
@JonasFranzDEV OK. So should I change some settings on crowdin or could you send another PR to fix that? |
PR to fix that #2599 |
A note: currently this plugin doesn't commit the changes to the repository, maybe we have to add another step based on https://github.com/appleboy/drone-git-push to get these changes commited with a message including |
Downloading changes from crowdin and pushing to git would be best scenario! |
@tboerger @lafriks I've added a section in the plugin documentation which describes the git push variant: https://github.com/JonasFranzDEV/drone-crowdin/blob/master/DOCS.md#commit-changes |
This PR adds a build step for master-build. The step uploads
locale_en-US.ini
to crowdin via the provided API.@tboerger This PR needs a new drone secret
crowdin_key
containing the API key of the gitea project. (https://crowdin.com/project/gitea/settings#api)@tboerger Is the english source file called "locale_en-US.ini" at crowdin?
EDIT
I've created a plugin for this PR and updated the .drone.yml to use this plugin. The plugin requires the crowdin key as secret
CROWDIN_KEY
(CC @tboerger).Link to plugin repo: https://github.com/JonasFranzDEV/drone-crowdin
Published on Docker hub: https://hub.docker.com/r/jonasfranz/crowdin/
Working example of the plugin:
Drone: https://drone.jonasfranz.software/JonasFranzDEV/Crowdin-Demo/5
Git: https://git.jonasfranz.software/JonasFranzDEV/Crowdin-Demo
Crowdin: https://crowdin.com/project/gitea-demo/activity_stream