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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple languages (i18n) #22

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

multiple languages (i18n) #22

wants to merge 5 commits into from

Conversation

bernheder
Copy link
Collaborator

No description provided.

@bernheder bernheder marked this pull request as draft December 8, 2022 14:19
@github-actions github-actions bot temporarily deployed to commit December 8, 2022 14:19 Inactive
@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2022

@github-actions github-actions bot temporarily deployed to commit December 8, 2022 14:20 Inactive
@github-actions github-actions bot temporarily deployed to pull request December 8, 2022 14:20 Inactive
@bernheder
Copy link
Collaborator Author

This is a draft for Internationalization.

This is currently a 4 step process:

  1. First, run sphinx-build -b gettext . _build/gettext from the 'docs/' directory. This tells sphinx to parse your files and automatically find a bunch of strings-to-be-translated and give them a unique msgid.

  2. Next, we tell sphinx to prepare some X (in this case 'de') destination-language '.po' files from our above-generated '.pot' files. sphinx-intl update -p _build/gettext -l de

  3. These language-specific '.po' files are where we actually do the translating.

  4. Build html for language (in this case 'de') make -e SPHINXOPTS="-D language='de'" BUILDDIR="_build/html/de" html

Open issues:

  1. Translation of ipynb files is not trivial, sphinx-intl expects the cells as json.
    A possible workaround would be to convert the .ipynb file to .md, rename the .md file (must not have the same name as the .ipynb file) and then run the gettext command.

  2. Add a language picker to the index file.

@bernheder bernheder linked an issue Dec 8, 2022 that may be closed by this pull request
@grst grst changed the title multiple languages multiple languages (i18n) Apr 28, 2023
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@flying-sheep
Copy link
Member

Translation of ipynb files is not trivial, sphinx-intl expects the cells as json.

What do you mean? Aren’t the cells json?

I’m very much not a fan of making things complicated by adding support for some magic Markdown dialect. Let’s stick to standard .ipynb files.

@flying-sheep flying-sheep removed their request for review June 24, 2024 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

support for different languages (internationalization)
2 participants