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 14 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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@v3
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.
6 changes: 3 additions & 3 deletions 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 Expand Up @@ -103,12 +103,12 @@ Release

On master branch:

* Update files *VERSION*, *docs/conf.py* and *docs/changelog.rst* to remove ``+dev`` suffix and increment version (please use semver rules)
* Update files *VERSION* and *docs/changelog.rst* to remove ``+dev`` suffix and increment version (please use semver rules)
* Run ``dch -r -D RELEASED``, update version in the same way and save
* Commit with message 'Release x.y.z' and push to ``master``
* Create new release on Github, with tag X.Y.Z, click on "Generate release notes"
* Wait for release to be published through CI
* Update files *VERSION*, *docs/conf.py* and *docs/changelog.rst* to add ``+dev`` suffix
* Update files *VERSION* and *docs/changelog.rst* to add ``+dev`` suffix
* Run ``dch -v <version>+dev --no-force-save-on-release`` and save
* Commit with message 'Back to development' and push to ```master``

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