Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9187 from tk0miya/push_translations_automatically
i18n: Sync translations on repo and transifex.com via GitHub Actions automatically
- Loading branch information
Showing
2 changed files
with
51 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Sync translations on repository and transifex.com | ||
|
||
on: | ||
schedule: | ||
- cron: "0 0 * * SUN" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
push: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: 4.x | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
- name: Install dependencies | ||
run: pip install -U babel jinja2 transifex-client | ||
- name: Extract translations from source code | ||
run: python setup.py extract_messages | ||
- name: Push translations to transifex.com | ||
run: cd sphinx/locale && tx push -s --no-interactive --parallel | ||
env: | ||
TX_TOKEN: ${{ secrets.TX_TOKEN }} | ||
|
||
pull: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: 4.x | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
- name: Install dependencies | ||
run: pip install -U babel jinja2 transifex-client | ||
- name: Extract translations from source code | ||
run: python setup.py extract_messages | ||
- name: Pull translations to transifex.com | ||
run: cd sphinx/locale && tx pull -a -f --no-interactive --parallel | ||
env: | ||
TX_TOKEN: ${{ secrets.TX_TOKEN }} | ||
- name: Compile message catalogs | ||
run: python setup.py compile_catalog | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v3 | ||
with: | ||
commit-message: 'Update message catalogs' | ||
branch: bot/pull-translations | ||
title: Update message catalogs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters