Skip to content

Commit

Permalink
implement crowdin (#2033)
Browse files Browse the repository at this point in the history
  • Loading branch information
bramstroker committed Feb 9, 2024
1 parent d05fc8b commit 661926b
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/crowdin-download.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Crowdin download

on:
push:
workflow_dispatch:

permissions: write-all

jobs:
synchronize-with-crowdin:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: crowdin action
uses: crowdin/github-action@v1
with:
upload_sources: false
upload_translations: false
download_translations: true
localization_branch_name: crowdin
create_pull_request: true
pull_request_title: 'Translations'
pull_request_body: 'New Crowdin translations submitted'
pull_request_base_branch_name: 'master'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/crowdin-upload.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Crowdin upload

on:
push:
# paths:
# - custom_components/powercalc/translations/*
branches: [ master, crowdin_action ]

jobs:
synchronize-with-crowdin:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: crowdin action
uses: crowdin/github-action@v1
with:
upload_sources: true
upload_translations: true
download_translations: false
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
11 changes: 11 additions & 0 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"project_id_env": "CROWDIN_PROJECT_ID"
"api_token_env": "CROWDIN_PERSONAL_TOKEN"
"base_path": "."
"base_url": "https://api.crowdin.com"
"preserve_hierarchy": true
files: [
{
"source": "/custom_components/powercalc/translations/en.json",
"translation": "/custom_components/powercalc/translations/%locale%.json",
}
]

0 comments on commit 661926b

Please sign in to comment.