alabaster
alabaster copied to clipboard
Sidebar titles not localized
There are no localized titles it the sidebars, eg. "Navigation", "Next", etc. It looks bad, when whole sphinx-doc is localized, but final web page is not and one need to customize the templates...
I don't have much experience localizing templates, but I'd totally accept a pull request that improves this. Thanks for the input!
Just merged #65 which does this for 'Navigation'. The rest probably need the same treatment.
If it's as easy as slapping _() around the words like #65 did, probably wouldn't take long to apply to the rest, but I'm still not sure exactly how the localization system works (where are the translations stored exactly - which words will get localized correctly with no extra work, etc).
Clearing milestone on this, I'm not comfortable just slapping the magic function on various words without knowing whether it'll make things better or worse. (Granted, maybe hard to be worse than "untranslated" - but e.g. exceptions causing one's docs to be unbuildable, would qualify...)
To repeat - if someone else who's had any experience localizing Sphinx templates can just drop some knowledge on me to the tune of "yes, _() is super safe, apply liberally", I'd be happy to go do the grunt work.
_() is an alias to gettext(), which is a part of the Python gettext stdlib. It would try to load translations that matches the input string from message catalogs installed, if no match is found, the original string is then returned.
I believe that this should be safe to use, just that translations are not granted by using this — someone need to translate them in a way or another.
More readings:
- Extension internationalization (
i18n) and localization (l10n) using i18n API — Sphinx Docs - Jinja i18n extension
sphinx-rtd-themewhich has bundled translations in the theme- Relevant discussions on
sphinx-rtd-theme: #343, #405, etc.