Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update doc translation #4000

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from
26 changes: 25 additions & 1 deletion .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:

jobs:
doc:
name: Documentation
name: Doc structure
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -30,3 +30,27 @@ jobs:
run: |
cd docs/
make html SPHINXOPTS="-W"

- name: Check translations build
run: |
cd docs/
make gettext
rm ./_build/locale/changelog.pot
sphinx-intl update -l fr
sphinx-intl build
sphinx-build -b html -D language='fr' -d _build/doctrees . _build/html/fr

- name: Check missing translations
uses: tj-actions/verify-changed-files@v17
id: verify-changed-files
with:
files: |
**/*.po

- name: Check no translation file has changed
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
echo "Translation file(s) changed: ${{ steps.verify-changed-files.outputs.changed_files }}"
git diff
core.setFailed('Please update doc translation y running `make gettext` and `sphinx-intl update -l fr`, then fix or update translation, and commit the changes.')

3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ serve:
deps:
$(docker_compose) run --rm web bash -c "pip-compile -q --strip-extras && pip-compile -q --strip-extras dev-requirements.in && pip-compile -q --strip-extras docs/requirements.in"

doc_translations:
$(docker_compose) run --rm sphinx bash -c "make gettext && rm ./_build/locale/changelog.pot && sphinx-intl update -l fr"

flake8:
$(docker_compose) run --rm web flake8 geotrek

Expand Down
118 changes: 59 additions & 59 deletions docs/changelog.rst

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import datetime
import os

root = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))

extensions = [
'sphinx.ext.todo',
Expand Down Expand Up @@ -115,3 +112,6 @@
'Makina Corpus', 'Geotrek-admin', 'One line description of project.',
'Miscellaneous'),
]

locale_dirs = ['locale'] # path is example but recommended.
gettext_compact = False # optional.
2 changes: 1 addition & 1 deletion docs/contribute/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Check TODO in the source tree:
Pull requests
-------------

Before creating a pull request, ensure you follow thoses rules :
Before creating a pull request, ensure you follow those rules :

* Follow the guidelines of this page
* Self-review your code
Expand Down
2 changes: 1 addition & 1 deletion docs/contribute/translating.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Translation features
Weblate shows all translation by language and by module.
Errors and left to translate can be displayed easily.

Weblate can identify problematic translations as chains between projects, punctuation inconsistancy.
Weblate can identify problematic translations as chains between projects, punctuation inconsistency.

.. figure:: ../images/translating/weblate-check.png
:alt: image
Expand Down
Loading
Loading