Update Translation via CI #141

Closed
opened 2020-06-03 17:00:15 +00:00 by 6543 · 2 comments
Member

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 added the
⚙️ CI
🌐 Translation
labels 2020-06-03 17:00:15 +00:00
6543 self-assigned this 2020-06-03 17:00:55 +00:00
Author
Member

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 --- ```
Author
Member
draft: https://gitea.com/6543/GitNex/src/branch/ci_manage-crowdin
6543 removed their assignment 2021-10-07 20:32:19 +00:00
6543 referenced this issue from a commit 2022-07-29 12:08:45 +00:00
6543 closed this issue 2022-07-29 12:08:45 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: gitnex/GitNex#141
No description provided.