diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml new file mode 100644 index 000000000..2cfaff3f7 --- /dev/null +++ b/.github/workflows/translations.yml @@ -0,0 +1,55 @@ +name: Translation job + +on: + push: + paths: + - 'web/i18n/strings.json' + - 'web/**/*.tsx' + - 'web/**/*.js' + - 'crowdin.yml' + - '.github/workflows/translations.yml' + - 'web/i18next-parser.config.mjs' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + generate-translations: + defaults: + run: + working-directory: ./web + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + if: ${{ github.actor != 'renovate[bot]' && github.actor != 'renovate' }} + run: npm install + + - name: Generate translation files + run: npm run translate + + - name: Crowdin upload sources/download translations + uses: crowdin/github-action@v1 + with: + upload_sources: true + download_translations: false + localization_branch_name: translations + config: crowdin.yml + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} + + - name: Commit changes + uses: EndBug/add-and-commit@v9 + with: + author_name: Owncast + author_email: owncast@owncast.online + message: 'Commit updated translations' + add: 'web/i18n/**' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/crowdin.yml b/crowdin.yml new file mode 100644 index 000000000..9fc313c75 --- /dev/null +++ b/crowdin.yml @@ -0,0 +1,10 @@ +project_id_env: CROWDIN_PROJECT_ID +api_token_env: CROWDIN_PERSONAL_TOKEN +pull_request_title: Translations update +pull_request_labels: + - crowdin + - i18n +commit_message: Updated translations +files: + - source: /web/i18n/strings.json + translation: /web/i18n/%two_letters_code%.json diff --git a/docs/api/index.html b/docs/api/index.html index ac097e9a2..0c5e1af43 100644 --- a/docs/api/index.html +++ b/docs/api/index.html @@ -12,408 +12,408 @@ margin: 0; } -
-