Skip to content

Commit

Permalink
Documentation en francais (#55)
Browse files Browse the repository at this point in the history
<!-- Please ensure the PR fulfills the following requirements! -->
<!-- If this is your first PR, make sure to add your details to the
AUTHORS.rst! -->
### Pull Request Checklist:
- [x] This PR addresses an already opened issue (for bug fixes /
features)
  - This PR addresses comments raised in #53 
- [x] (If applicable) Documentation has been added / updated (for bug
fixes / features).
- [ ] (If applicable) Tests have been added.
- [x] CHANGES.rst has been updated (with summary of main changes).
- [x] Link to issue (:issue:`number`) and pull request (:pull:`number`)
has been added.

### What kind of change does this PR introduce?

* Add localization files and Makefile commands

### Does this PR introduce a breaking change?

Yes. Documentation structure has been changed: Now offers "en" and "fr"
as options.

### Other information:
  • Loading branch information
TC-FF authored Dec 11, 2023
2 parents ac60ff8 + 47e36a3 commit aba59ff
Show file tree
Hide file tree
Showing 16 changed files with 1,421 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ instance/

# Sphinx documentation
docs/_build/
docs/apidoc/modules.rst
docs/apidoc/xhydro*.rst

# PyBuilder
target/
Expand Down
1 change: 1 addition & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ build:
jobs:
pre_build:
- sphinx-apidoc -o docs/apidoc --private --module-first xhydro
- sphinx-build -M gettext docs docs/_build

conda:
environment: environment-dev.yml
Expand Down
9 changes: 9 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
Changelog
=========


v0.4.0 (unreleased)
-------------------
Contributors to this version: Trevor James Smith (:user:`Zeitsperre`).

New features and enhancements
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* Added French language support to the documentation. (:issue:`53`, :pull:`55`).

v0.3.0 (2023-12-01)
-------------------
Contributors to this version: Gabriel Rondeau-Genesse (:user:`RondeauG`), Trevor James Smith (:user:`Zeitsperre`).
Expand Down
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ endef
export PRINT_HELP_PYSCRIPT

BROWSER := python -c "$$BROWSER_PYSCRIPT"
LOCALES := docs/locales

help:
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
Expand Down Expand Up @@ -78,13 +79,21 @@ coverage: ## check code coverage quickly with the default Python
autodoc: clean-docs ## create sphinx-apidoc files:
sphinx-apidoc -o docs/apidoc --private --module-first xhydro

initialize-translations: clean-docs ## initialize translations, ignoring autodoc-generated files
${MAKE} -C docs gettext
sphinx-intl update -p docs/_build/gettext -d docs/locales -l fr

linkcheck: autodoc ## run checks over all external links found throughout the documentation
$(MAKE) -C docs linkcheck

docs: autodoc ## generate Sphinx HTML documentation, including API docs
$(MAKE) -C docs html
$(MAKE) -C docs html BUILDDIR="_build/html/en"
ifneq ("$(wildcard $(LOCALES))","")
${MAKE} -C docs gettext
$(MAKE) -C docs html BUILDDIR="_build/html/fr" SPHINXOPTS="-D language='fr'"
endif
ifndef READTHEDOCS
$(BROWSER) docs/_build/html/index.html
$(BROWSER) docs/_build/html/en/html/index.html
endif

servedocs: docs ## compile the docs watching for changes
Expand Down
4 changes: 4 additions & 0 deletions docs/conf.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@
# Usually you set "language" from the command line for these cases.
language = "en"

# Set the locales
locale_dirs = ["locales"]
gettext_compact = False

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
Expand Down
64 changes: 64 additions & 0 deletions docs/locales/fr/LC_MESSAGES/authors.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2023, Thomas-Charles Fortier Filion
# This file is distributed under the same license as the xHydro package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2023.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: xHydro 0.3.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-12-08 12:18-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: fr\n"
"Language-Team: fr <LL@li.org>\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.12.1\n"

#: ../../../AUTHORS.rst:3
msgid "Credits"
msgstr ""

#: ../../../AUTHORS.rst:6
msgid "Development Lead"
msgstr ""

#: ../../../AUTHORS.rst:8
msgid ""
"Thomas-Charles Fortier Filion <tcff_hydro@outlook.com> `@TC-FF "
"<https://github.com/TC-FF>`_"
msgstr ""

#: ../../../AUTHORS.rst:11
msgid "Co-Developers"
msgstr ""

#: ../../../AUTHORS.rst:13
msgid ""
"Trevor James Smith <smith.trevorj@ouranos.ca> `@Zeitsperre "
"<https://github.com/Zeitsperre>`_"
msgstr ""

#: ../../../AUTHORS.rst:14
msgid ""
"Gabriel Rondeau-Genesse <rondeau-genesse.gabriel@ouranos.ca> `@RondeauG "
"<https://github.com/RondeauG>`_"
msgstr ""

#: ../../../AUTHORS.rst:15
msgid ""
"Sébastien Langlois `@sebastienlanglois "
"<https://github.com/sebastienlanglois>`_"
msgstr ""

#: ../../../AUTHORS.rst:18
msgid "Contributors"
msgstr ""

#: ../../../AUTHORS.rst:20
msgid "None yet. Why not be the first?"
msgstr ""
Loading

0 comments on commit aba59ff

Please sign in to comment.