Skip to content

[Fix-8233] Add Google Translate button to Python API docs#175

Open
KaiSong-UK wants to merge 1 commit into
apache:mainfrom
KaiSong-UK:fix-8233-google-translate
Open

[Fix-8233] Add Google Translate button to Python API docs#175
KaiSong-UK wants to merge 1 commit into
apache:mainfrom
KaiSong-UK:fix-8233-google-translate

Conversation

@KaiSong-UK
Copy link
Copy Markdown

Closes apache/dolphinscheduler#8233

Description

Add Google Translate widget to the Python API documentation (Sphinx RTD theme).

Currently the Python API docs only have English version. This PR adds a Google Translate dropdown button at the bottom-left corner of the documentation pages, allowing users to translate English docs into their preferred language via machine translation.

Changes

  • Added \docs/source/_templates/layout.html\ that extends the RTD theme's \layout.html\ and injects the Google Translate widget via the \extrabody\ block
  • The widget uses \google.translate.TranslateElement\ with \InlineLayout.SIMPLE\

Reference implementation: https://www.commonwl.org/user_guide/

@zhongjiajie
Copy link
Copy Markdown
Member

Hi @KaiSong-UK thanks for your contribute, could you take a gif or screenshot and let me know what is the final ui looks like?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature][python] Add google translate buttom to python doc

2 participants