Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 FIX: Fix translation for prev/next #384

Merged
merged 1 commit into from
Aug 22, 2021

Conversation

choldgraf
Copy link
Member

@choldgraf choldgraf commented Aug 22, 2021

This uses lowercase previous and next entries, which is the reason that Sphinx wasn't translating them before. Also reverts back to the _( translation text since that's the Sphinx standard.

It also sets previous/next to lowercase so they take up less visual attention, per @pfelber's comments

may address #359 if others confirm

@choldgraf
Copy link
Member Author

Merging this in so that others can give this a shot

@choldgraf choldgraf changed the title Fix translation for prev/next 馃悰 FIX: Fix translation for prev/next Aug 22, 2021
@choldgraf choldgraf merged commit a9f7415 into executablebooks:master Aug 22, 2021
@choldgraf choldgraf deleted the prevnext-translate branch August 22, 2021 21:49
@chrisjsewell
Copy link
Member

Also reverts back to the _( translation text since that's the Sphinx standard.

if this works then that is absolutely fine, but I would note that this is not sphinx鈥檚 standard for extensions, it is the internal standard for their own documentation and I think not really meant for external use. This is because it is not possible for extensions to extend the available translations (happy to be corrected though)

@choldgraf
Copy link
Member Author

@chrisjsewell yeah I was trying to figure this out as well. Here I took some inspiration from @jpmckinney who was adding i18n support to the pydata theme in https://github.com/pydata/pydata-sphinx-theme/pull/399/files

In that PR he's just using the _( (which I learned is not actually a Sphinx short-hand, it's a jinja shorthand

@chrisjsewell
Copy link
Member

@choldgraf so basically this is the full explanation:

@choldgraf
Copy link
Member Author

right - maybe this only works because we are just re-using translations for words that are already in the Sphinx catalog ("page" and "next" and "previous")? Either way this is a helpful write-up, I've added it to #382 !

@chrisjsewell
Copy link
Member

maybe this only works because we are just re-using translations for words that are already in the Sphinx catalog ("page" and "next" and "previous")?

yep thats exactly the case; anything you can find in one of their translation files you could use with _(, e.g. https://github.com/sphinx-doc/sphinx/blob/f127a2ff5d6d86918a5d3ac975e8ab8a24c407d1/sphinx/locale/en_FR/LC_MESSAGES/sphinx.po

But obviously it is better if we are consistent in using our own translation files (and thus the translate function)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants