Add support for internationalization to the guide #298
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds support for internationalization to the Package Guide as described in issue #287.
See the translation guide in PR #304 for a description of the workflow.
What was done
noxfile.py
to make it easier to maintain as the configuration becomes more complexupdate-translations
: create and update translations files for the languages defined inLANGUAGES
build-translations
: build the guide in the languages defined inLANGUAGES
docs-live-lang
: a convenience session to launch docs-live using a specific language buildbuild-translations-test
: a convenience session to run docs-test using a specific language buildbuild-languages
: a session used bybuild-translations
to build a list of languages (will not be called directly)docs
anddocs-live
sessions to build the language translations defined inRELEASE_LANGUAGES
pyproject.toml
with dev dependencies for translation workflows.po
filesHow to test
nox -s docs
and check that the build is cleannox -s docs-test
and check that the build is cleannox -s docs-live
and check that it works as expected by visitinghttp://localhost:8000
_build/html/es
folder does not exist)nox docs-clean
to delete the build files (check that_build/html
is empty now)nox -s build-translations
locales/es/LC_MESSAGES/
and that this folder now has translation files (.po)locales/es/LC_MESSAGES/index.po
(the file that corresponds to the contents of the guide landing page). Replace the empty string in line 45 with"La guía de paquetes de Python de pyOpenSci"
. You just translated the title of the guide.nox -s build-translations
and verify it has no warnings or errorsnox -s build-translations-test
(apply the parameters from docs-test to build-translations) and verify it has no warnings or errorsnox -s docs-live-lang -- es
and visithttp://localhost:8000
to verify that the title is the Spanish title