-
Notifications
You must be signed in to change notification settings - Fork 200
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Language support is broken - .mo files not bundled with this theme's wheel #584
Comments
Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗 |
Linked to #538 perharps ? |
Further digging this today made me realize that it is because of the missing A quick workaround is
But here I wonder if we could address this in the next few releases since it is so important for all international JB users. It seems to me that |
Thanks a lot for this workaround!
|
The
|
I’m not sure why it is not working on your side.
I had no time to reproduce this error.
My first guess is, you did not start the script from the right directory.
Please navigate (with cd on the command prompt) to the directory sphinx_book_theme\ and afterwards try to execute the script again (.\_compile_translations.py).
Regards
Adrian
Von: Gouvernathor ***@***.***>
Gesendet: Donnerstag, 24. November 2022 22:05
An: executablebooks/sphinx-book-theme ***@***.***>
Cc: Busin Adrian (busi) ***@***.***>; Mention ***@***.***>
Betreff: Re: [executablebooks/sphinx-book-theme] Bugged language support? (Issue #584)
@iasbusi<https://github.com/iasbusi> your 5. doesn't work on my end.
C:\Windows\system32>cd C:\Program Files\Python39\Lib\site-packages\sphinx_book_theme
C:\Program Files\Python39\Lib\site-packages\sphinx_book_theme>py ./_compile_translations.py
[SBT]: Compiling translations
C:\Program Files\Python39\Lib\site-packages\sphinx_book_theme\assets\translations\..\..\theme\sphinx_book_theme\static\locales\ar\LC_MESSAGES\booktheme.po
Traceback (most recent call last):
File "C:\Program Files\Python39\Lib\site-packages\sphinx_book_theme\_compile_translations.py", line 78, in <module>
convert_json()
File "C:\Program Files\Python39\Lib\site-packages\sphinx_book_theme\_compile_translations.py", line 66, in convert_json
subprocess.check_call(
File "C:\Program Files\Python39\lib\subprocess.py", line 368, in check_call
retcode = call(*popenargs, **kwargs)
File "C:\Program Files\Python39\lib\subprocess.py", line 349, in call
with Popen(*popenargs, **kwargs) as p:
File "C:\Program Files\Python39\lib\subprocess.py", line 951, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Program Files\Python39\lib\subprocess.py", line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] Le fichier spécifié est introuvable
C:\Program Files\Python39\Lib\site-packages\sphinx_book_theme>
The last line means "the specified file is not found".
NB : I'm not using sphinx in the context of a notebook, so apologies if it's the reason, but I doubt it.
—
Reply to this email directly, view it on GitHub<#584 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAR4UETNP6SX4N6YX2BHFU3WJ7J7PANCNFSM53EWBZNQ>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
|
I updated the top comment from @whyjz to describe what I think are two potential problems that we need to resolve (see "Diagnosis of problem" section). Would love help from anybody that knows how to fix this! cc @AakashGfude in case he has cycles to look into this, I'd appreciate it! |
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: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.
The text was updated successfully, but these errors were encountered: