From 97355672cd0956ef9c3c4da558a5de20fa01ed9f Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Mon, 16 Aug 2021 11:30:53 +0200 Subject: [PATCH] [translations] ./manage rename shell functions to integrate weblate Functions implemented to run *Weblate* workflows should use prefix 'weblate.': - babel.setup.translations.worktree --> weblate.translations.worktree Create git worktree ${TRANSLATIONS_WORKTREE} and checkout branch 'translations' from Weblate's counterpart (weblate) of the SearXNG (origin):: remote weblate https://weblate.bubu1.eu/git/searxng/searxng/ - babel.weblate.to.translations --> weblate.to.translations Update 'translations' branch of SearXNG (origin) with last additions from Weblate. - babel.translations.to.master --> weblate.translations.commit Update 'translations' branch of SearXNG (origin) with last additions from Weblate. Copy the changes to the master branch, compile translations and create a commit in the local branch (master) - babel.master.to.translations --> weblate.push.translations Push *translation changes* from SearXNG (origin) to Weblate's counterpart (weblate). Signed-off-by: Markus Heiser --- .github/workflows/integration.yml | 2 +- .github/workflows/translations-update.yml | 2 +- Makefile | 2 +- docs/dev/translation.rst | 4 ++-- docs/dev/translation.svg | 6 ++--- manage | 27 +++++++++++++++-------- 6 files changed, 26 insertions(+), 17 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 886df3b2f..84ce51a04 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -127,7 +127,7 @@ jobs: id: update run: | git restore utils/brand.env - make V=1 babel.master.to.translations + make V=1 weblate.push.translations dockers: name: Docker diff --git a/.github/workflows/translations-update.yml b/.github/workflows/translations-update.yml index 2db9c3d78..c3120ce1e 100644 --- a/.github/workflows/translations-update.yml +++ b/.github/workflows/translations-update.yml @@ -36,7 +36,7 @@ jobs: git config --global user.name "searxng-bot" - name: Merge and push transation updates run: | - make V=1 babel.translations.to.master + make V=1 weblate.translations.commit - name: Create Pull Request id: cpr uses: peter-evans/create-pull-request@v3 diff --git a/Makefile b/Makefile index cee1e4b97..88edef5cf 100644 --- a/Makefile +++ b/Makefile @@ -77,7 +77,7 @@ test.shell: # wrap ./manage script MANAGE += buildenv -MANAGE += babel.translations.to.master babel.master.to.translations +MANAGE += weblate.translations.commit weblate.push.translations MANAGE += data.all data.languages data.useragents data.osm_keys_tags MANAGE += docs.html docs.live docs.gh-pages docs.prebuild docs.clean MANAGE += docker.build docker.push docker.buildx diff --git a/docs/dev/translation.rst b/docs/dev/translation.rst index c0e3c3851..922c29c54 100644 --- a/docs/dev/translation.rst +++ b/docs/dev/translation.rst @@ -49,12 +49,12 @@ only the SearXNG's PR workflow to be in sync with Weblate -Sync from *origin* to *weblate*: ``make babel.master.to.translations`` +Sync from *origin* to *weblate*: using ``make weblate.push.translations`` For each commit on the ``master`` branch of SearXNG *origin* the GitHub job :origin:`babel / Update translations branch <.github/workflows/integration.yml>` checks for updated translations. -Sync from *weblate* to *origin*: ``make babel.translations.to.master`` +Sync from *weblate* to *origin*: using ``make weblate.translations.commit`` Every Friday, the GitHub workflow :origin:`babel / create PR for additons from weblate <.github/workflows/translations-update.yml>` creates a PR with the updated translation files: diff --git a/docs/dev/translation.svg b/docs/dev/translation.svg index a4f26b86b..70400cca7 100644 --- a/docs/dev/translation.svg +++ b/docs/dev/translation.svg @@ -1,4 +1,4 @@ -master branchmaster branchtranslations_update branchtranslations_update branchtranslations branchtranslations branchweblate clone ofSearXNG repositoryweblate clone ofSearXNG repositoryweblatepending changesweblatepending changesfor each commit on master.github/workflows/integration.ymlmake babel.master.to.translationswlc lockwlc pullwlc commitgit merge weblate/translationspybabel extractextract messages, store messages.pot on translations branchpybabel update (messages.po)git add searx/translationsgit commitgit pushwlc unlockevery Friday.github/workflows/translations-update.ymlmake babel.translations.to.masterwlc lockwlc pullwlc commitgit merge weblate/translationspybabel compilecp searx/translationsgit addgit commitwlc unlockcreate or update pull request"Update translations"developper's reviewmerge pull request