TRANSLATION_TOOLS.md
This repository includes automated translation tools to translate all documentation to multiple languages.
translate_repo.py)Requirements:
pip install deep-translator
Usage:
python3 translate_repo.py
Features:
.md files in docs/ folder + README.md.translation_progress.json)TranslateRepo.java)Requirements:
# Requires Gson library
# Download from: https://repo1.maven.org/maven2/com/google/code/gson/gson/2.10.1/gson-2.10.1.jar
Compile:
javac -cp gson-2.10.1.jar TranslateRepo.java
Usage:
java -cp .:gson-2.10.1.jar TranslateRepo
Features:
Original:
docs/
├── java/
│ └── basics.md
└── ...
README.md
After translation to English:
docs_en/
├── java/
│ └── basics.en.md
└── ...
README.en.md
.md files in docs/ folder and README.mddocs_{lang}/ with .{lang}.md suffix# 1. Run translation tool
python3 translate_repo.py
# 2. Select language (e.g., 1 for English)
Enter choice (1-20): 1
# 3. Confirm translation
Translate 292 files to English? (y/n): y
# 4. Wait for completion (progress shown for each file)
[1/292] docs/java/basics/java-basic-questions-01.md
→ docs_en/java/basics/java-basic-questions-01.en.md
Chunk 1/3... ✅
Chunk 2/3... ✅
Chunk 3/3... ✅
✅ Translated (5234 → 6891 chars)
# 5. Review and commit
git add docs_en/ README.en.md
git commit -m "Add English translation"
git push
The tool saves progress to .translation_progress.json:
{
"completed": [
"docs/java/basics/file1.md",
"docs/java/basics/file2.md"
],
"failed": []
}
If interrupted, simply run the tool again - it will skip completed files and resume where it left off.
After running the translation tool:
These tools are provided as-is for translating JavaGuide documentation.