diff --git a/.github/workflows/crowdin.yml b/.github/workflows/crowdin.yml index ee341fb2..dc95b1c4 100644 --- a/.github/workflows/crowdin.yml +++ b/.github/workflows/crowdin.yml @@ -4,35 +4,37 @@ on: push: branches: [ main ] paths: - - 'manager/app/src/main/res/**' + - 'manager/app/src/main/res/values/strings.xml' + - 'manager/app/src/main/res/values-*/strings.xml' + schedule: + - cron: '0 0 * * *' + workflow_dispatch: jobs: synchronize-with-crowdin: runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 - - name: crowdin action - uses: crowdin/github-action@master - with: - upload_sources: true - upload_translations: true - download_translations: true - localization_branch_name: "Crowdin" - crowdin_branch_name: "main" - 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_base_branch_name: 'main' - skip_untranslated_files: true - env: - # A classic GitHub Personal Access Token with the 'repo' scope selected (the user should have write access to the repository). - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + - name: Crowdin Action + uses: crowdin/github-action@v2 + with: + upload_sources: true + upload_translations: true + auto_approve_imported: true + download_translations: true + skip_untranslated_files: false + skip_untranslated_strings: true - # A numeric ID, found at https://crowdin.com/project//tools/api - CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} + create_pull_request: true + localization_branch_name: "Crowdin" + pull_request_labels: 'enhancement, translation' + pull_request_title: 'opt: sync translation from Crowdin' - # Visit https://crowdin.com/settings#api-key to create this token - CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} \ No newline at end of file + config: 'crowdin.yml' + crowdin_branch_name: "main" + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} + CROWDIN_API_TOKEN: ${{ secrets.CROWDIN_API_TOKEN }} \ No newline at end of file diff --git a/crowdin.yml b/crowdin.yml index 230fc92c..ce0c41ad 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -1,3 +1,6 @@ +project_id_env: CROWDIN_PROJECT_ID +api_token_env: CROWDIN_API_TOKEN +preserve_hierarchy: 1 files: - source: /manager/app/src/main/res/values/strings.xml translation: /manager/app/src/main/res/values-%two_letters_code%/strings.xml