From effedafabe722a0032f8d1c0b744b7a98be4e26c Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sun, 9 May 2021 16:54:51 +0900 Subject: [PATCH 1/2] i18n: Push translations via GitHub Actions automatically --- .github/workflows/transifex.yml | 25 +++++++++++++++++++++++++ utils/release-checklist | 3 +-- 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/transifex.yml diff --git a/.github/workflows/transifex.yml b/.github/workflows/transifex.yml new file mode 100644 index 00000000000..7fe54ff9a77 --- /dev/null +++ b/.github/workflows/transifex.yml @@ -0,0 +1,25 @@ +name: Push translations to transifex.com + +on: + schedule: + - cron: "0 0 * * SUN" + workflow_dispatch: + +jobs: + build: + 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 }} diff --git a/utils/release-checklist b/utils/release-checklist index 477ddcbbef9..e8b44727eb5 100644 --- a/utils/release-checklist +++ b/utils/release-checklist @@ -30,8 +30,6 @@ for first beta releases * open "https://github.com/sphinx-doc/sphinx/actions?query=branch:master" and all tests has passed * Run ``git fetch; git status`` and check nothing changed -* Run ``python setup.py extract_messages`` -* Run ``(cd sphinx/locale; tx push -s)`` * ``python utils/bump_version.py X.Y.0b1`` * Check diff by ``git diff`` * ``git commit -am 'Bump to X.Y.0 beta1'`` @@ -83,6 +81,7 @@ for major releases * open "https://github.com/sphinx-doc/sphinx/actions?query=branch:X.x" and all tests has passed * Run ``git fetch; git status`` and check nothing changed +* Run ``python setup.py extract_messages`` * Run ``(cd sphinx/locale; tx pull -a -f)`` * Run ``python setup.py compile_catalog`` * Run ``git add sphinx`` From 08c65d4de277d27fa3acc7068784a661bf6c68b3 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sun, 9 May 2021 18:06:24 +0900 Subject: [PATCH 2/2] i18n: Pull translations via GitHub Actions automatically --- .github/workflows/transifex.yml | 30 ++++++++++++++++++++++++++++-- utils/release-checklist | 3 --- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/.github/workflows/transifex.yml b/.github/workflows/transifex.yml index 7fe54ff9a77..3efae8ff262 100644 --- a/.github/workflows/transifex.yml +++ b/.github/workflows/transifex.yml @@ -1,4 +1,4 @@ -name: Push translations to transifex.com +name: Sync translations on repository and transifex.com on: schedule: @@ -6,7 +6,7 @@ on: workflow_dispatch: jobs: - build: + push: runs-on: ubuntu-latest steps: @@ -23,3 +23,29 @@ jobs: 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 diff --git a/utils/release-checklist b/utils/release-checklist index e8b44727eb5..920c1ce8f4d 100644 --- a/utils/release-checklist +++ b/utils/release-checklist @@ -81,9 +81,6 @@ for major releases * open "https://github.com/sphinx-doc/sphinx/actions?query=branch:X.x" and all tests has passed * Run ``git fetch; git status`` and check nothing changed -* Run ``python setup.py extract_messages`` -* Run ``(cd sphinx/locale; tx pull -a -f)`` -* Run ``python setup.py compile_catalog`` * Run ``git add sphinx`` * Run ``git commit -am 'Update message catalogs'`` * ``python utils/bump_version.py X.Y.0``