Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 901ab877 authored by Alexandre Flament's avatar Alexandre Flament
Browse files

[translations] web integration

* make babel.translations.to.master: pull weblate updates
* make babel.master.to.translations: push .pot and .po files to weblate
parent 80372d87
Loading
Loading
Loading
Loading
+20 −20
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ jobs:
        COMMIT_MESSAGE: build from commit ${{ github.sha }}

  babel:
    name: Babel
    name: Update translations branch
    runs-on: ubuntu-20.04
    if: ${{ github.repository_owner == 'searxng' && github.ref == 'refs/heads/master' }}
    needs:
@@ -102,32 +102,32 @@ jobs:
    - name: Checkout
      uses: actions/checkout@v2
      with:
        persist-credentials: false
        fetch-depth: '0'
        token: ${{ secrets.WEBLATE_GITHUB_TOKEN }}
    - name: Set up Python
      uses: actions/setup-python@v2
      with:
        python-version: '3.9'
        architecture: 'x64'
    - name: Cache Python dependencies
      id: cache-python
      uses: actions/cache@v2
      with:
        path: ./local
        key: python-ubuntu-20.04-3.9-${{ hashFiles('requirements*.txt', 'setup.py') }}
    - name: weblate & git setup
      env:
        WEBLATE_CONFIG: ${{ secrets.WEBLATE_CONFIG }}
      run: |
        mkdir -p ~/.config
        echo "${WEBLATE_CONFIG}" > ~/.config/weblate
        git config --global user.email "searxng-bot@users.noreply.github.com"
        git config --global user.name "searxng-bot"
    - name: Update transations
      id: update
      continue-on-error: true
      run: make V=1 ci.babel.update
    - name: Open pull request
      if: steps.update.outcome == 'success'
      uses: peter-evans/create-pull-request@v3
      with:
        commit-message: Update translations (pot, po)
        committer: searx-bot <noreply@github.com>
        author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
        signoff: false
        branch: update_translations_pot
        delete-branch: true
        draft: false
        title: 'Update translations (pot, po)'
        body: |
          Update messages.pot and messages.po files
        labels: |
          translation
      run: |
        git restore utils/brand.env
        make V=1 babel.master.to.translations

  dockers:
    name: Docker
+56 −0
Original line number Diff line number Diff line
name: "Update translations"
on:
  schedule:
    - cron: "05 07 * * 5"
  workflow_dispatch:

jobs:
  babel:
    name: "translations: update master branch"
    runs-on: ubuntu-20.04
    if: ${{ github.repository_owner == 'searxng' && github.ref == 'refs/heads/master' }}
    steps:
    - name: Checkout
      uses: actions/checkout@v2
      with:
        fetch-depth: '0'
        token: ${{ secrets.WEBLATE_GITHUB_TOKEN }}
    - name: Set up Python
      uses: actions/setup-python@v2
      with:
        python-version: '3.9'
        architecture: 'x64'
    - name: Cache Python dependencies
      id: cache-python
      uses: actions/cache@v2
      with:
        path: ./local
        key: python-ubuntu-20.04-3.9-${{ hashFiles('requirements*.txt', 'setup.py') }}
    - name: weblate & git setup
      env:
        WEBLATE_CONFIG: ${{ secrets.WEBLATE_CONFIG }}
      run: |
        mkdir -p ~/.config
        echo "${WEBLATE_CONFIG}" > ~/.config/weblate
        git config --global user.email "searxng-bot@users.noreply.github.com"
        git config --global user.name "searxng-bot"
    - name: Merge and push transation updates
      run: |
        make V=1 babel.translations.to.master
    - name: Create Pull Request
      id: cpr
      uses: peter-evans/create-pull-request@v3
      with:
        token: ${{ secrets.WEBLATE_GITHUB_TOKEN }}
        commit-message: Update translations
        committer: searxng-bot <searxng-bot@users.noreply.github.com>
        author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
        signoff: false
        branch: translations_update
        delete-branch: true
        draft: false
        title: 'Update translations'
        body: |
          Update translations
        labels: |
          translation

.weblate

0 → 100644
+3 −0
Original line number Diff line number Diff line
[weblate]
url = https://weblate.bubu1.eu/api/
translation = searxng/searxng
+1 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ test.shell:
# wrap ./manage script

MANAGE += buildenv
MANAGE += ci.babel.update babel.extract babel.update babel.compile
MANAGE += babel.translations.to.master babel.master.to.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
+2 −0
Original line number Diff line number Diff line
@@ -32,6 +32,8 @@ Privacy-respecting, hackable `metasearch engine`_
.. |commits| image:: https://img.shields.io/github/commit-activity/y/searxng/searxng?color=yellow&label=commits
   :target: https://github.com/searxng/searxng/commits/master

.. |weblate| image:: https://weblate.bubu1.eu/widgets/searxng/-/searxng/svg-badge.svg
   :target: https://weblate.bubu1.eu/projects/searxng/

If you are looking for running instances, ready to use, then visit searx.space_.

Loading