From 824be6c9166f15bbc2a6f235655bfe074c5e51c4 Mon Sep 17 00:00:00 2001 From: Vadim <44135514+vodemn@users.noreply.github.com> Date: Sun, 12 Feb 2023 13:09:55 +0300 Subject: [PATCH] Push new localization strings to Crowdin (#30) * Update crowdin.yml * added github workflows * Update crowdin_push.yml * Update intl_en.arb * Update intl_en.arb --- .github/workflows/crowdin_pull.yml | 33 ++++++++++++++++++++++++++++++ .github/workflows/crowdin_push.yml | 30 +++++++++++++++++++++++++++ crowdin.yml | 7 +++++-- 3 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/crowdin_pull.yml create mode 100644 .github/workflows/crowdin_push.yml diff --git a/.github/workflows/crowdin_pull.yml b/.github/workflows/crowdin_pull.yml new file mode 100644 index 0000000..cc3a650 --- /dev/null +++ b/.github/workflows/crowdin_pull.yml @@ -0,0 +1,33 @@ +name: Crowdin pull +on: + workflow_dispatch: + repository_dispatch: + types: [crowdin-webhook] +concurrency: + group: ${{ github.workflow }} +permissions: + contents: write + pull-requests: write +env: + REPO_TOKEN: ${{ secrets.REPO_TOKEN }} + CROWDIN_PROJECT_ID: 567473 + CROWDIN_TOKEN: ${{ secrets.CROWDIN_TOKEN }} +jobs: + download-translations: + runs-on: ubuntu-latest + steps: + - name: Checkout main branch + uses: actions/checkout@v3 + - name: Download + uses: crowdin/github-action@1.5.0 + with: + crowdin_branch_name: main + upload_sources: false + upload_translations: false + download_translations: true + skip_untranslated_strings: true + export_only_approved: true + push_translations: true + localization_branch_name: main-l10n + create_pull_request: true + pull_request_base_branch_name: main diff --git a/.github/workflows/crowdin_push.yml b/.github/workflows/crowdin_push.yml new file mode 100644 index 0000000..b28e174 --- /dev/null +++ b/.github/workflows/crowdin_push.yml @@ -0,0 +1,30 @@ +name: Crowdin push +on: + push: + branches: + - main + - crowdin +concurrency: + group: ${{ github.workflow }} +permissions: + contents: read +env: + REPO_TOKEN: ${{ secrets.REPO_TOKEN }} + CROWDIN_PROJECT_ID: 567473 + CROWDIN_TOKEN: ${{ secrets.CROWDIN_TOKEN }} +jobs: + upload-files: + runs-on: ubuntu-latest + steps: + - name: Checkout main branch + uses: actions/checkout@v3 + - name: Upload + uses: crowdin/github-action@1.5.0 + with: + crowdin_branch_name: main + upload_sources: true + upload_sources_args: "--delete-obsolete" + upload_translations: true + import_eq_suggestions: true + auto_approve_imported: false + add_crowdin_branch: main diff --git a/crowdin.yml b/crowdin.yml index 043dcad..7d502a6 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -1,7 +1,10 @@ +project_id_env: CROWDIN_PROJECT_ID +api_token_env: CROWDIN_TOKEN base_path: "./lib/l10n" +base_url: "https://api.crowdin.com" preserve_hierarchy: true files: - - source: /intl_en.arb - translation: '%original_path%/intl_%two_letters_code%.arb' + - source: "/intl_en.arb" + translation: "%original_path%/intl_%two_letters_code%.arb" \ No newline at end of file