diff --git a/.github/workflows/crowdin-download.yaml b/.github/workflows/crowdin-download.yaml new file mode 100644 index 0000000..687af0d --- /dev/null +++ b/.github/workflows/crowdin-download.yaml @@ -0,0 +1,29 @@ +--- +name: Crowdin Download +on: + schedule: + - cron: '0 20 * * *' # Run the workflow every day at 20:00 UTC +permissions: + contents: write + pull-requests: write +jobs: + crowdin-download: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Synchronize with Crowdin + uses: crowdin/github-action@v2 + with: + upload_sources: false + upload_translations: false + download_translations: true + localization_branch_name: crowdin_translations + create_pull_request: true + pull_request_title: "[CROWDIN] - New translations" + pull_request_body: New Crowdin pull request with translations + pull_request_base_branch_name: main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/crowdin-upload.yaml b/.github/workflows/crowdin-upload.yaml new file mode 100644 index 0000000..66c1a17 --- /dev/null +++ b/.github/workflows/crowdin-upload.yaml @@ -0,0 +1,23 @@ +name: Crowdin Upload + +on: + push: + paths: [ 'src/locales/**' ] + branches: [ feature/crowdin ] + +jobs: + crowdin-upload: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Crowdin push + uses: crowdin/github-action@v2 + with: + upload_sources: true + upload_translations: true + download_translations: false + env: + CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} \ No newline at end of file diff --git a/crowdin.yml b/crowdin.yml new file mode 100644 index 0000000..3d725e6 --- /dev/null +++ b/crowdin.yml @@ -0,0 +1,14 @@ +"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": "src/locales/en.json", + "translation": "src/locales/%locale%.json", + } +] \ No newline at end of file diff --git a/src/locales/en.json b/src/locales/en.json index 309d4f0..85a9f13 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -19,4 +19,4 @@ }, "see_all": "See all", "paths": "Paths" -} \ No newline at end of file +}