This repository includes automated translation tools to translate all documentation to multiple languages.
Requirements:
pip install deep-translatorUsage:
python3 translate_repo.pyFeatures:
- ✅ Uses Google Translate (free, no API key required)
- ✅ Translates all
.mdfiles indocs/folder +README.md - ✅ Preserves directory structure
- ✅ Progress tracking (saves to
.translation_progress.json) - ✅ Skips already translated files
- ✅ Rate limiting to avoid API throttling
- ✅ Supports 20 languages
Requirements:
# Requires Gson library
# Download from: https://repo1.maven.org/maven2/com/google/code/gson/gson/2.10.1/gson-2.10.1.jarCompile:
javac -cp gson-2.10.1.jar TranslateRepo.javaUsage:
java -cp .:gson-2.10.1.jar TranslateRepoFeatures:
- ✅ Pure Java implementation
- ✅ Uses Google Translate API (free, no key required)
- ✅ Same functionality as Python version
- ✅ Progress tracking with JSON
- ✅ Supports 20 languages
- English (en)
- Chinese Simplified (zh)
- Spanish (es)
- French (fr)
- Portuguese (pt)
- German (de)
- Japanese (ja)
- Korean (ko)
- Russian (ru)
- Italian (it)
- Arabic (ar)
- Hindi (hi)
- Turkish (tr)
- Vietnamese (vi)
- Polish (pl)
- Dutch (nl)
- Indonesian (id)
- Thai (th)
- Swedish (sv)
- Greek (el)
Original:
docs/
├── java/
│ └── basics.md
└── ...
README.md
After translation to English:
docs_en/
├── java/
│ └── basics.en.md
└── ...
README.en.md
- Scans all
.mdfiles indocs/folder andREADME.md - Splits large files into chunks (4000 chars) to respect API limits
- Translates each chunk using Google Translate
- Preserves markdown formatting and code blocks
- Saves to
docs_{lang}/with.{lang}.mdsuffix - Tracks progress to resume if interrupted
# 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 pushThe 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.
- Speed: ~1 file per 5-10 seconds (depending on file size)
- For JavaGuide: 292 files ≈ 2-3 hours total
- Rate limiting: 1 second delay between chunks to avoid throttling
- ✅ Free to use (no API key required)
- ✅ Preserves markdown formatting
- ✅ Handles code blocks correctly
- ✅ Skips existing translations
⚠️ Review translations for accuracy (automated translation may have errors)⚠️ Large repos may take several hours
After running the translation tool:
- Review translated files for accuracy
- Fix any translation errors manually
- Test that links and formatting work correctly
- Create a pull request with your translations
These tools are provided as-is for translating JavaGuide documentation.