alabaster icon indicating copy to clipboard operation
alabaster copied to clipboard

Sidebar titles not localized

Open slavkoja opened this issue 9 years ago • 4 comments

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...

slavkoja avatar Feb 09 '16 17:02 slavkoja

I don't have much experience localizing templates, but I'd totally accept a pull request that improves this. Thanks for the input!

bitprophet avatar Feb 17 '16 22:02 bitprophet

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).

bitprophet avatar May 05 '16 23:05 bitprophet

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.

bitprophet avatar Jul 25 '16 22:07 bitprophet

_() 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:

blueset avatar Jan 18 '20 10:01 blueset