diff --git a/.github/workflows/scheduled-upload-crowdin.yml b/.github/workflows/scheduled-upload-crowdin.yml deleted file mode 100644 index a793d6b6f7..0000000000 --- a/.github/workflows/scheduled-upload-crowdin.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: scheduled-upload-crowdin - -on: - schedule: - - cron: '0 0 * * *' - -jobs: - CrowdinUpload: - runs-on: macos-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - ref: develop - - name: Setup Ruby - uses: ruby/setup-ruby@v1 - with: - working-directory: src - bundler-cache: true - - name: Upload Localizations to Crowdin via Fastlane - env: - CROWDIN_KEY: ${{ secrets.CROWDIN_API }} - run: cd src && bundle exec fastlane ios crowdin_upload diff --git a/.github/workflows/synchronize-crowdin.yml b/.github/workflows/synchronize-crowdin.yml new file mode 100644 index 0000000000..642b28f6c8 --- /dev/null +++ b/.github/workflows/synchronize-crowdin.yml @@ -0,0 +1,32 @@ +name: synchronize-crowdin + +on: + schedule: + - cron: '0 0 * * *' + workflow_dispatch: + push: + branches: + - "CATTY-639" + +jobs: + SynchronizeCrowdin: + if: github.repository == 'Catrobat/Catty' + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Synchronize Crowdin Translations + uses: crowdin/github-action@v2 + with: + upload_sources: true + upload_translations: false + download_translations: true + config: 'src/crowdin.yml' + create_pull_request: true + pull_request_title: 'New Crowdin Translations' + pull_request_body: 'New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)' + pull_request_labels: 'translations' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_ID }} + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_TOKEN }} \ No newline at end of file diff --git a/src/crowdin.yml b/src/crowdin.yml new file mode 100644 index 0000000000..96f472ca05 --- /dev/null +++ b/src/crowdin.yml @@ -0,0 +1,14 @@ +"project_id_env": "CROWDIN_PROJECT_ID" +"api_token_env": "CROWDIN_PERSONAL_TOKEN" +"base_path": "Catty/Resources/Localization" + +"preserve_hierarchy": true + +"files": [ + { + "source": "en.lproj/Localizable.strings", + "dest": "catty/Localizable.strings", + "translation": "%osx_code%/%original_file_name%", + "update_option": "update_as_unapproved" + } +] \ No newline at end of file