julep
julep copied to clipboard
Automate README translations
trafficstars
Draft PR for #600
Some known issues that are to be fixed yet (this is just a draft PR)
- The workflow takes too long for translations, approx. ~10 mins, may batch translating content be helpful?
- Code blocks are exempted from translations due to unexpected translations of syntax
- Hyperlinks for TOC currently aren't being translated
Currently the translator uses Google AJAX Api for translations so the translations may not be "good". Best approach would perhaps be utilizing machine translation instead.
[!IMPORTANT] Automates translation of
README.mdinto multiple languages using a GitHub workflow and Python script, preserving code blocks and HTML tags.
- Workflow:
- Adds
.github/workflows/translate-readme.ymlto automate translation ofREADME.mdon push.- Uses
deep-translatorandparmapperfor translation and parallel processing.- Translates into Chinese, Japanese, and French.
- Script:
scripts/readme_translator.pytranslatesREADME.md, preserving code blocks and HTML tags.- Uses
GoogleTranslatorfromdeep-translatorfor language translation.- Saves translated files as
README-CN.md,README-JA.md,README-FR.md.- Known Issues:
- Translation process is slow (~10 mins), potential for batching.
- Code blocks and TOC links are not translated.
This description was created by
for 020e1024adb96317d29b30e4f27f1eaf4ce3ec0f. It will automatically update as commits are pushed.