julep icon indicating copy to clipboard operation
julep copied to clipboard

Automate README translations

Open itsamziii opened this issue 1 year ago • 5 comments
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.md into multiple languages using a GitHub workflow and Python script, preserving code blocks and HTML tags.

  • Workflow:
    • Adds .github/workflows/translate-readme.yml to automate translation of README.md on push.
    • Uses deep-translator and parmapper for translation and parallel processing.
    • Translates into Chinese, Japanese, and French.
  • Script:
    • scripts/readme_translator.py translates README.md, preserving code blocks and HTML tags.
    • Uses GoogleTranslator from deep-translator for 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 Ellipsis for 020e1024adb96317d29b30e4f27f1eaf4ce3ec0f. It will automatically update as commits are pushed.

itsamziii avatar Oct 09 '24 20:10 itsamziii