#141 Update Translation via CI

Open
opened 1 month ago by 6543 · 2 comments
6543 commented 1 month ago

Update locale files via Drone CI (Cron Jobs)

  • Store Crowdin API key to CI
  • Script wich creat PR if it notice changes
  • Let CI pass PR without testing because -> locales only
Update locale files via Drone CI (Cron Jobs) * Store Crowdin API key to CI * Script wich creat PR if it notice changes * Let CI pass PR without testing because -> locales only
6543 self-assigned this 1 month ago
6543 added the
Translation
label 1 month ago
6543 added the
CI
label 1 month ago
6543 commented 1 month ago
Poster

Gitea example:

---
kind: pipeline
name: translations

platform:
  os: linux
  arch: amd64

workspace:
  base: /go
  path: src/code.gitea.io/gitea

trigger:
  branch:
    - master
  event:
    - push

steps:
  - name: download
    pull: always
    image: jonasfranz/crowdin
    settings:
      download: true
      export_dir: options/locale/
      ignore_branch: true
      project_identifier: gitea
    environment:
      CROWDIN_KEY:
        from_secret: crowdin_key

  - name: update
    pull: default
    image: alpine:3.10
    commands:
      - mv ./options/locale/locale_en-US.ini ./options/
      - "sed -i -e 's/=\"/=/g' -e 's/\"$$//g' ./options/locale/*.ini"
      - "sed -i -e 's/\\\\\\\\\"/\"/g' ./options/locale/*.ini"
      - mv ./options/locale_en-US.ini ./options/locale/

  - name: push
    pull: always
    image: appleboy/drone-git-push
    settings:
      author_email: "teabot@gitea.io"
      author_name: GiteaBot
      commit: true
      commit_message: "[skip ci] Updated translations via Crowdin"
      remote: "git@github.com:go-gitea/gitea.git"
    environment:
      GIT_PUSH_SSH_KEY:
        from_secret: git_push_ssh_key

  - name: upload_translations
    pull: always
    image: jonasfranz/crowdin
    settings:
      files:
        locale_en-US.ini: options/locale/locale_en-US.ini
      ignore_branch: true
      project_identifier: gitea
    environment:
      CROWDIN_KEY:
        from_secret: crowdin_key

---
Gitea example: ```yaml --- kind: pipeline name: translations platform: os: linux arch: amd64 workspace: base: /go path: src/code.gitea.io/gitea trigger: branch: - master event: - push steps: - name: download pull: always image: jonasfranz/crowdin settings: download: true export_dir: options/locale/ ignore_branch: true project_identifier: gitea environment: CROWDIN_KEY: from_secret: crowdin_key - name: update pull: default image: alpine:3.10 commands: - mv ./options/locale/locale_en-US.ini ./options/ - "sed -i -e 's/=\"/=/g' -e 's/\"$$//g' ./options/locale/*.ini" - "sed -i -e 's/\\\\\\\\\"/\"/g' ./options/locale/*.ini" - mv ./options/locale_en-US.ini ./options/locale/ - name: push pull: always image: appleboy/drone-git-push settings: author_email: "teabot@gitea.io" author_name: GiteaBot commit: true commit_message: "[skip ci] Updated translations via Crowdin" remote: "git@github.com:go-gitea/gitea.git" environment: GIT_PUSH_SSH_KEY: from_secret: git_push_ssh_key - name: upload_translations pull: always image: jonasfranz/crowdin settings: files: locale_en-US.ini: options/locale/locale_en-US.ini ignore_branch: true project_identifier: gitea environment: CROWDIN_KEY: from_secret: crowdin_key --- ```
6543 changed title from Update Translation va CI to Update Translation via CI 1 month ago
6543 commented 2 weeks ago
Poster
draft: https://gitea.com/6543/GitNex/src/branch/ci_manage-crowdin
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
Cancel
Save
There is no content yet.