executablebooks / sphinx-book-theme

A clean book theme for scientific explanations and documentation with Sphinx
https://sphinx-book-theme.readthedocs.io
BSD 3-Clause "New" or "Revised" License
431 stars 197 forks source link

FIX: Translation support in GitHub Actions #684

Closed AakashGfude closed 1 year ago

AakashGfude commented 1 year ago

fixes https://github.com/executablebooks/sphinx-book-theme/issues/584

AakashGfude commented 1 year ago

@choldgraf it seems I can only translate to 9 languages from smodin. Do you have a premium account? As it seems other words have translations in more languages.

choldgraf commented 1 year ago

Let's just go with the 9 languages - this is just a start anyway, I think that it will likely require manual updates for many languages anyway since automatic translating is likely to some things slightly incorrectly

AakashGfude commented 1 year ago

ooh okay cool. I reckon we need to find words manually of what we want to update. Some words already found are:- Last updated on and By as mentioned in the issue https://github.com/executablebooks/sphinx-book-theme/issues/584 . So, I will just go with that for now.

choldgraf commented 1 year ago

Yeah that makes sense - we can do the best we can now, and if we miss something we can always improve it in a future PR !

choldgraf commented 1 year ago

By the way, do you know how to handle translation strings when there is a word that isn't supposed to be translated? Eg "edit on GitHub" - we want "GitHub" to be part of the phrase (so that for example German speakers see it at the beginning of the phrase instead of the end), but it isn't translatable. I think there are guidelines for how to handle this but I don't know what they are.

Ah i just remembered this PR might have some recommendations (though it uses gettext directly rather than our middle-layer custom translation stuff)

AakashGfude commented 1 year ago

By the way, Last updated on and By are already here https://github.com/executablebooks/sphinx-book-theme/tree/master/src/sphinx_book_theme/assets/translations/jsons . So, I guess we don't need to add any translations at the moment?

choldgraf commented 1 year ago

Ah nice - so we don't need to change anything for now? If that's the case I think we should just merge this and cut a release candidate

AakashGfude commented 1 year ago

Ah nice - so we don't need to change anything for now?

Seems like it. But I don't know why it was not working in the first place. Because of lack of .mo files?

choldgraf commented 1 year ago

Yes without those files present sphinx Sphinx cannot generate any translations