pydata-sphinx-theme
pydata-sphinx-theme copied to clipboard
Translations for page elements
I'm pretty sure the next/previous page translations don't work here, because the internal sphinx catalog (https://github.com/sphinx-doc/sphinx/tree/3.x/sphinx/locale) does not contain translations for them (the _ filter is a shorthand for using this)
https://github.com/pandas-dev/pydata-sphinx-theme/blob/7163801b25d3e2f15a06fa403bac4fbd00818198/pydata_sphinx_theme/layout.html#L7-L10
FYI I noticed this whilst adding a custom translation catalog to sphinx-book-theme: https://github.com/executablebooks/sphinx-book-theme/commit/d2a8b44271bc20baa49d5ea1a94aea18a25b2e3d 😄
We could think about adding something similar here
note there are individual translations for "next" "previous" and "page", so as a minimum you could just use those i.e. "{{ _('next')}} {{ _('page')}}", but obviously this does not guarantee the correct translation
I see the project has no PO or MO files. If I were to provide Spanish and French translations, would they be merged?
Does this mean that Sphinx would be able to translate these files?
I'd be +1 on this, though we should also document the files in the docs so others know how to edit them etc
My understanding is that at minimum MO files must be committed in the theme, e.g. https://github.com/sphinx-doc/sphinx/tree/4.x/sphinx/locale contains strings for files in the basic theme. Same for sphinx_rtd_theme and others. Committing the PO file makes it much easier to update the MO file.
Why is there a _templates directory? Py-Babel will not look in directories with an underscore: https://github.com/python-babel/babel/blob/5afe2b2f11dcdd6090c00231d342c2e9cd1bdaab/babel/messages/extract.py#L140-L143
I don't think the theme should be using _templates...
Mostly because that's the folder name that Sphinx uses in sphinx-quickstart. :-/
Hmm, well I think it's fine for a theme to use any name. I remove the _ in #399.
I'm a bit confused why some templates are in pydata-sphinx-theme and others are in _templates, TBH.
I'm personally fine with it - we were just following convention I think.
I think the idea is that the HTML templates in the main folder are larger structural pieces, and _templates contains smaller "components" (maybe components is a better folder name) that are inserted into the bigger templates. But this folder was created after we had already created some "components" in the larger folder, which is why this might be confusing.