Add automated translation tools - Addresses #1494#2742
Add automated translation tools - Addresses #1494#2742Snailclimb merged 1 commit intoSnailclimb:mainfrom
Conversation
Provides automated translation tools to translate JavaGuide documentation to multiple languages, addressing the 5-year-old request in issue Snailclimb#1494. Features: - Python and Java implementations (876 lines total) - Supports 20 languages including English, Spanish, French, etc. - Batch translates all markdown files in docs/ folder + README.md - Preserves directory structure (docs/ -> docs_en/) - File naming: file.md -> file.en.md - Progress tracking with JSON (.translation_progress.json) - Skips already translated files - Rate limiting to avoid API throttling - Free Google Translate API (no key required) - Handles large files with smart chunking (4000 chars) - Preserves markdown formatting and code blocks Files added: - translate_repo.py (318 lines) - Python implementation - TranslateRepo.java (386 lines) - Java implementation - TRANSLATION_TOOLS.md (172 lines) - Comprehensive documentation Usage: Python: python3 translate_repo.py Java: javac -cp gson.jar TranslateRepo.java && java -cp .:gson.jar TranslateRepo Output structure: docs/ -> docs_en/ (for English) README.md -> README.en.md Performance: ~1 file per 5-10 seconds JavaGuide (292 files) ≈ 2-3 hours This enables the community to easily create translations for any of the 20 supported languages, making JavaGuide accessible to developers worldwide. Addresses Snailclimb#1494
|
@Snailclimb Please check this translate script. Thanks. |
|
@Snailclimb Can you please check this translate script and let me know this is helpful or not? If not helpful, I will close this PR, please let me know your opinion, Thanks. |
感谢您,挺不错的。不过,我暂时没有想法将其转换为多语言,很多内容还是更新完善中。不过,我可以将其先合并进来。 |
|
OK, thanks. I'd really appreciate if you merge it. Thanks again. @Snailclimb |
1 similar comment
|
OK, thanks. I'd really appreciate if you merge it. Thanks again. @Snailclimb |
Can you please merge this PR so that I can take a look at next issue or update? Thanks. |
|
@Snailclimb Please merge this PR. |
Summary
Provides automated translation tools to translate JavaGuide documentation to multiple languages, addressing the 5-year-old request in issue #1494 for English and other language versions.
Changes
✅ 3 files added (876 lines total)
Files:
translate_repo.py(318 lines) - Python implementationTranslateRepo.java(386 lines) - Java implementationTRANSLATION_TOOLS.md(172 lines) - Comprehensive documentationFeatures
Core Functionality:
.mdfiles indocs/folder +README.mddocs/→docs_en/file.md→file.en.mdSmart Features:
.translation_progress.jsonUsage
Python Version:
Java Version:
Output Structure
Before:
After (English translation):
Performance
Supported Languages (20)
Benefits
Why Both Python and Java?
Next Steps
After merging, contributors can:
Testing
Tested successfully:
Addresses #1494