Skip to content

Commit

Permalink
fix navigation translations (#418)
Browse files Browse the repository at this point in the history
* fix navigation translations

* translate mkdocs navigation content on Transifex

* fix script

* fix nav tx

* run

* translate site_description

* update requirements + fallback + fix workflow

* Update mkdocs.yml translation

* fix path

* fix dead links

* isinstance

Co-authored-by: Ivan Ivanov <suricactus@users.noreply.github.com>

* explicitely define event names

* harmonize variables naming (+ fix error detection)

* more descriptive var names

* simplify workflow condition

* fix missing var rename

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Lucie Nicolier <50236352+lucienicolier@users.noreply.github.com>
Co-authored-by: Ivan Ivanov <suricactus@users.noreply.github.com>
  • Loading branch information
4 people authored Feb 24, 2024
1 parent 0d9b454 commit 6fb78f5
Show file tree
Hide file tree
Showing 10 changed files with 511 additions and 85 deletions.
60 changes: 38 additions & 22 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,57 @@
name: gh-pages

on:
pull_request:
branches:
- master
push:
branches:
- master
schedule:
- cron: '30 1 * * *'
workflow_dispatch:

permissions:
contents: write

jobs:
translations:
runs-on: ubuntu-latest
if: (github.event_name == 'schedule' && github.repository == 'opengisch/QField-docs') || (github.event_name != 'schedule')
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'

- name: Install Python requirements
run: pip install -r requirements.txt
run: |
pip install -r requirements.txt
pip install -r requirements-dev.txt
# - name: Install Python requirements insiders
# run: pip install -r requirements-insiders.txt
# env:
# MKDOCS_INSIDERS_TOKEN: ${{ secrets.MKDOCS_INSIDERS_TOKEN }}
- name: Install Python requirements insiders
run: pip install -r requirements-insiders.txt
env:
MKDOCS_INSIDERS_TOKEN: ${{ secrets.MKDOCS_INSIDERS_TOKEN }}

- name: Install Transifex client
run: |
curl -OL https://github.com/transifex/cli/releases/download/v1.3.1/tx-linux-amd64.tar.gz
curl -OL https://github.com/transifex/cli/releases/download/v1.6.10/tx-linux-amd64.tar.gz
tar -xvzf tx-linux-amd64.tar.gz
- name: Extract translatable content from mkdocs.yml config
run: ./utils/mkdocs_tx.py create_source

- name: Configure Transifex
run: |
python ./utils/transifex_utils.py
run: ./utils/transifex_utils.py
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}

- name: Push source files to Transifex
run: |
./tx push
if: contains(fromJSON('["push", "workflow_dispatch", "schedule"]'), github.event_name)
run: ./tx push
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}

Expand All @@ -58,21 +62,33 @@ jobs:
cmd: yq '.plugins[] | .i18n.languages | select( . != null ) | map(.locale) | join(",")' mkdocs.yml

- name: Pull translations from Transifex
if: contains(fromJSON('["push", "workflow_dispatch", "schedule"]'), github.event_name) || ${{ github.event_name == 'pull_request' && github.repository == 'opengisch/QField-docs' }}
run: |
./tx pull -t -l ${{ steps.get_langs.outputs.result }}
./tx status
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}

- name: Translate Mkdocs config
if: contains(fromJSON('["push", "workflow_dispatch", "schedule"]'), github.event_name) || ${{ github.event_name == 'pull_request' && github.repository == 'opengisch/QField-docs' }}
run: |
./utils/mkdocs_tx.py -s en update_config
./utils/mkdocs_tx_commit.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build documentation
run: mkdocs build
env:
DEFAULT_LANGUAGE_ONLY: false

- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
- uses: actions/upload-artifact@v4
if: ${{ github.event_name == 'pull_request' }}
with:
branch: gh-pages
clean: true
folder: site
ssh-key: ${{ secrets.DEPLOY_TO_GH_PAGES_PRIVATE_KEY }}
name: docs
path: site
if-no-files-found: error

- name: Deploy to GitHub Pages
if: contains(fromJSON('["push", "workflow_dispatch", "schedule"]'), github.event_name)
run: mkdocs gh-deploy --force
2 changes: 1 addition & 1 deletion documentation/get-started/support.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ create your own custom app.
## Community Support

You can ask your questions on
[gis.stackexchange](http://gis.stackexchange.com/questions/tagged/qfield?sort=newest)
[gis.stackexchange](http://gis.stackexchange.com/questions/tagged/qfield?sort=newest) <!-- markdown-link-check-disable-line -->

You can use the [user discussions platform](https://github.com/opengisch/qfield/discussions)
2 changes: 1 addition & 1 deletion documentation/reference/qfieldcloud/specs.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ FATAL: no pg_hba.conf entry for host "185.203.114.168", user "qfc", database "my
WARNING:QGIS_MSGLOG:1 unavailable layer(s) found:
```

To do so, you need to edit the `pg_hba.conf` file where your PostgreSQL server is hosted. For more information, refer to recommendations on [StackOverflow questions](https://stackoverflow.com/search?q=FATAL+no+pg_hba.conf+entry+for+host).
To do so, you need to edit the `pg_hba.conf` file where your PostgreSQL server is hosted. For more information, refer to recommendations on [StackOverflow questions](https://stackoverflow.com/search?q=FATAL+no+pg_hba.conf+entry+for+host). <!-- markdown-link-check-disable-line -->
Loading

0 comments on commit 6fb78f5

Please sign in to comment.