Is there a way to build and maintain multi language site in jupyter book using only one repo? #220
-
I would like to host multi language versions (Korean, English) of my jupyter book website. Currently, the only way that I can think of is to create a repository for each versions of website. (ex. Jupyter-Book-Kor, Jupyter-Book-Eng) However, this would be inconvenient in maintenance wise since I have to keep track of two different repos where the only difference is the language of the content files and table of contents. I wonder if there is a way to build and maintain multi language versions of jupyter book website in one repo. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 15 replies
-
I'm not sure if it is possible in one repo, and I've tried with jupyter-book. Here is an example from a project I am involved with, to translate to chinese: https://github.com/unkcpz/aiida-l10n-zh_CN |
Beta Was this translation helpful? Give feedback.
-
I'm not sure of the integration between sphinx and executablebooks. But https://github.com/wpilibsuite/frc-docs-translations is a 2-repo system that could probably be combined into one (just a separate github actions workflow). It's documented a fair bit and I'd be happy to answer any questions |
Beta Was this translation helpful? Give feedback.
-
I've just been attempting to set up a multilingual JupyterBook site, and got so far before hitting a problem that I can't seem to resolve. So, I'm going to document what I did here, in case someone else can take it further. The project indicated above using things like
Note that I'm using a different output path, because if you don't you get this error:
To get this to work at all, I needed these settings:
However, the attempt to build the translation files still fails, with this error:
Which seems to be similar to this old Sphinx issue related to image blocks. I can hack Sphinx sidestep this error, but as that was not part of the final fix for that issue, I'm not sure how to proceed. |
Beta Was this translation helpful? Give feedback.
-
@SDSTony Yes, this is what I have been doing for this tutorial website and the corresponding repository. Here are specific steps. I assume the book content is in the
Here are my relevant sphinx:
config:
language: zh_TW # defining the source language
html_search_language: ja # ja is better at parsing zh_TW strings for search box
# i18n related
nb_render_priority:
gettext: {} # see the discussion above
locale_dirs: ['locale/'] # my _config.yml is in docs/, so this points to docs/locale
gettext_compact: false
gettext_additional_targets: ['literal-block']
gettext_location: false # see the discussion above |
Beta Was this translation helpful? Give feedback.
I'm not sure if it is possible in one repo, and I've tried with jupyter-book.
But with a general sphinx site, I believe the recommended way is detailed here: https://www.sphinx-doc.org/en/master/usage/advanced/intl.html, using transifex
Here is an example from a project I am involved with, to translate to chinese: https://github.com/unkcpz/aiida-l10n-zh_CN