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.pyto make it easier to maintain as the configuration becomes more complexupdate-translations: create and update translations files for the languages defined inLANGUAGESbuild-translations: build the guide in the languages defined inLANGUAGESdocs-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-translationsto build a list of languages (will not be called directly)docsanddocs-livesessions to build the language translations defined inRELEASE_LANGUAGESpyproject.tomlwith dev dependencies for translation workflows.pofilesHow to test
nox -s docsand check that the build is cleannox -s docs-testand check that the build is cleannox -s docs-liveand check that it works as expected by visitinghttp://localhost:8000_build/html/esfolder does not exist)nox docs-cleanto delete the build files (check that_build/htmlis empty now)nox -s build-translationslocales/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-translationsand 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 -- esand visithttp://localhost:8000to verify that the title is the Spanish title