diff --git a/.github/workflows/crowdin_export.yml b/.github/workflows/crowdin_export.yml index 5d3ac9f242..2ed34be851 100644 --- a/.github/workflows/crowdin_export.yml +++ b/.github/workflows/crowdin_export.yml @@ -1,7 +1,7 @@ # # GitHub Action to export latest changes to en.json to https://lang.purrbot.site # -name: "Crowdin Import GH Action" +name: "Crowdin Export GH Action" on: push: # Trigger on push towards the en.json file. @@ -16,15 +16,17 @@ jobs: steps: - name: "Update Code" uses: actions/Checkout@v2 + - name: "Export Crowdin Translations" - uses: crowdin/github-action@v1.0.20 + uses: crowdin/github-action@1.0.21 with: - upload_sources: true # Upload sources + crowdin_branch_name: 'master' - download_translations: false # Don't download translations from Crowdin - skip_untranslated_files: true # Only download fully translated files - translation: "src/main/resources/lang/%locale%.%file_extension%" + upload_sources: true + + upload_translations: false + download_translations: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_ID }} - CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_TOKEN }} + CROWDIN_ID: ${{ secrets.CROWDIN_ID }} + CROWDIN_TOKEN: ${{ secrets.CROWDIN_TOKEN }} diff --git a/.github/workflows/crowdin_import.yml b/.github/workflows/crowdin_import.yml index 8d21984d9c..93ea270392 100644 --- a/.github/workflows/crowdin_import.yml +++ b/.github/workflows/crowdin_import.yml @@ -7,6 +7,11 @@ name: "Crowdin Import GH Action" on: schedule: - cron: "0/10 * * * *" # Check every 10 minutes for updates. + +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CROWDIN_ID: ${{ secrets.CROWDIN_ID }} + CROWDIN_TOKEN: ${{ secrets.CROWDIN_TOKEN }} jobs: import: @@ -14,17 +19,20 @@ jobs: steps: - name: "Update Code" uses: actions/Checkout@v2 - - name: "Import Crowdin Translations" - uses: crowdin/github-action@v1.0.20 + + - name: Download French translations + uses: crowdin/github-action@1.0.21 with: + download_language: 'fr' + crowdin_branch_name: 'master' + upload_sources: false # Don't upload sources download_translations: true # Download translations from Crowdin skip_untranslated_files: true # Only download fully translated files - translation: "src/main/resources/lang/%locale%.%file_extension%" push_translations: true # Push translations to branch - commit_message: "Updated %language%" + commit_message: "Updated French" localization_branch_name: "translations" # Git branch for translations create_pull_request: true @@ -33,7 +41,28 @@ jobs: New Translations were made for the bot. If you want to help making them, read about it on our [Documentation](https://docs.purrbot.site/contribute/translate/) pull_request_labels: "Type: Translation" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_ID }} - CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_TOKEN }} + + + - name: Download German, Switzerland translations + uses: crowdin/github-action@1.0.21 + with: + download_language: 'de-CH' + crowdin_branch_name: 'master' + + upload_sources: false # Don't upload sources + + download_translations: true # Download translations from Crowdin + skip_untranslated_files: true # Only download fully translated files + + push_translations: true # Push translations to branch + commit_message: "Updated German, Switzerland" + localization_branch_name: "translations" # Git branch for translations + + create_pull_request: true + pull_request_title: "New Crowdin Translations" + pull_request_body: |- + New Translations were made for the bot. + If you want to help making them, read about it on our [Documentation](https://docs.purrbot.site/contribute/translate/) + pull_request_labels: "Type: Translation" + + diff --git a/crowdin.yml b/crowdin.yml index 0aada56fea..04cfa0fe45 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -1,5 +1,8 @@ -commit_message: "Update %language%" -append_commit_message: false +project_id_env: CROWDIN_ID +api_token_env: CROWDIN_TOKEN + +preserve_hierarchy: true + files: - source: src/main/resources/lang/en.json - translation: /src/main/resources/lang/%locale%.%file_extension% + translation: src/main/resources/lang/%locale%.%file_extension%