pyOpenSci / python-package-guide

scientific Python package recommendations & guidance curated by pyOpenSci
https://www.pyopensci.org/python-package-guide/
Other
70 stars 43 forks source link

Start spanish translation #309

Closed flpm closed 2 days ago

flpm commented 2 days ago

This PR adds the beginning of the Spanish translation, it is related to #298 and #304.

What was done

How to test

Build the Spanish translation using this command:

nox -s docs-live -- -D language=es

Browse to http://localhost:8000 to browse it.

Note: Once PR #298 is merged, it will add the new nox sessions and building a translation will be easier:

nox -s docs-live-lang -- es
lwasser commented 2 days ago

@flpm i'm going to merge this as well. i have this working locally and want to see how it builds! i am looking at the pydata_sphinx_theme to understand how we ensure the spanish version is published.

In your experience is it published via a drop down that a user can select OR is it something that the browser recognizes and alerts the user of an alternative language?

flpm commented 2 days ago

It's all handled by sphinx in the build, so when building for Spanish the Spanish locale of the theme will be used.

Right now nox builds translation in folders inside the English guide. So you would go to /es/index.html instead of index.html for the Spanish.

When the docs-test session is run, only translations for languages listed in the RELEASE_LANGUAGES list in the noxfile.py will be built, so when the GitHub action run to publish it will not publish a translation until you officially release it.

lwasser commented 2 days ago

ok - that makes sense. I see that RELEASE_LANGUAGES is empty. so we can work on it for a while and then release it when we have the entire thing translated. thank you for helping me understand! i did see in my browser when i was looking at the spanish version i could jump back to the english version. this is really wonderful!!