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.
Addresses #111
Hello, folks!
This PR adds a language switcher and some logic to deal with multiple languages on the zarr website.
Currently, as part of the Scientific Python grant, we have the site 100% translated into Portuguese (Brazilian) and Spanish. Other languages may follow soon - having the infrastructure set up will hopefully help us recruit new translators 😄
You can see a live preview of this PR here: https://axequalsb.github.io (this is a throaway github account, nevermind the URL - i just needed to deploy this somewhere at the top level because of the minimal-mistakes theme).
About the implementation: It may seem convoluted and, frankly, I'm not a javascript developer so there is certainly room for improvement. My hope was to get this all done in jinja, but unfortunately I couldn't figure out how due to some limitations of the minimal-mistakes jekyll theme. Most of the plugins for jekyll work on the assumption that you are building a blog, and this can cause issues for the format we were expecting on the site (see, for example mmistakes/minimal-mistakes#4618)
For now, only the top navbar and left sidebar are shown translated, because this is a proof of concept and these were the sections of the website that were more problematic. For the others, all pages under
content/<language-code>
will be synced automatically with Crowdin following the process our team has created (more details here: https://scientific-python-translations.github.io/docs/)@goanpeca has been working on the automation process for the sync between crowdin and the websites and can help answer any questions you might have.
This PR is a proof of concept and we are happy to adapt to any specific format or needs you might have here. Feedback is appreciated ❤️
Thanks!