Description
Describe the bug
context and bug
The language support seems not working (or partially working) now when used together with Jupyter Book. No matter what language is set in _config.yml
, for example:
sphinx:
config:
language: fr
There will still be many words remaining untranslated (i.e. in English). Based on the following example, it seems that it used to work but not anymore.
Likely diagnosis of problem
There are potentially two problems:
-
.mo
files are not bundled with this theme. For example, in this pre-release there are generated language files intheme/sphinx_book_theme/static/locales/
but they are only.po
and not.mo
.Here's where the compilation happens:
sphinx-book-theme/src/sphinx_book_theme/_compile_translations.py
Lines 62 to 73 in cda3bb5
It isn't clear why this is happening - the only thing I can think of is that the
glob
isn't picking up the.po
files at the end only in the build job for some reason? They are there when I build it locally. -
Some theme wording has likely changed. For example,
Toggle primary sidebar
is (I think) a new phrase that is not in our inventory of language translation phrases. We should find the new phrases that aren't there, and add them via the instructions in that readme.
Reproduce the bug
I forked a Jupyter Book written in French (associated Github repo) and pushed the book to my Github pages (associated Github repo) using exactly the same Github Action.
Screenshot from the original Book pages (last push was on Dec 8, 2021)
Screenshot from the forked Book pages (last push was on Jul 10, 2022)
You can see while some of the words are translated (e.g. Suivant and juil.), many others are not (Last updated, By, ...).
@pnavaro I would like to ping you here since I used your book as a test case. Maybe you also have some ideas about this?
List your environment
Latest version on conda in Dec 8, 2021 vs Jul 10, 2022.