multidoctranslator
v0.1.3
Published
Translate GitHub repository documentation into 40+ languages using Lingo.dev. Fast batch translation CLI tool for README, CONTRIBUTING, and docs.
Maintainers
Readme
MultiDocTranslator
A CLI tool to translate GitHub repository documentation into multiple languages using Lingo.dev API. Supports README, CONTRIBUTING, and docs folders.
Features
- Translate README, CONTRIBUTING, and docs to 40+ languages
- Batch translation (faster than doing one language at a time)
- Interactive mode for easy setup
- CLI mode for scripts/automation
- Works with public and private repos
- Uses Lingo.dev API for translations
Install
npm install -g multidoctranslatorQuick Start
- Get API key from lingo.dev
- Set it:
export LINGODOTDEV_API_KEY=your_key - Run:
multidoctranslator translate --repo owner/repo --languages es,fr
Usage
# Interactive mode (asks questions)
multidoctranslator
# Direct usage
multidoctranslator translate --repo owner/repo --languages es,fr,de
# More options
multidoctranslator translate --repo owner/repo --languages es,fr --include-contributing --include-docs --output ./translatedOptions
--repo/-r: Repository (owner/repo or URL)--languages/-l: Languages (es,fr,de)--output/-o: Output folder (default: ./translations)--include-contributing: Include CONTRIBUTING.md--include-docs: Include /docs folder--token/-t: GitHub token for private repos
Examples
# Basic translation
multidoctranslator translate --repo facebook/react --languages es,fr
# Include everything
multidoctranslator translate --repo owner/repo --languages es,fr,de --include-contributing --include-docs
# Private repo
multidoctranslator translate --repo owner/private-repo --token ghp_xxx --languages es,frLanguages
Supports 40+ languages including Spanish, French, German, Japanese, Chinese, Arabic, Hindi, and many more.
Use language codes like: es,fr,de,ja,zh,ar,hi
Output Structure
Translated files are saved with locale suffix:
translations/
├── README.es.md # Spanish
├── README.fr.md # French
├── README.de.md # German
├── CONTRIBUTING.es.md # If --include-contributing used
└── ...Pattern: {filename}.{locale}.md
Troubleshooting
API Key Issues
- Make sure
LINGODOTDEV_API_KEYis set - Get key from lingo.dev/auth
Repository Issues
- Use format:
owner/repoorhttps://github.com/owner/repo - For private repos, add
--token ghp_your_token
Other Errors
- Check your Lingo.dev quota if you get limit errors
- Make sure the repo has README.md or use flags for other files
How it works
- Fetches markdown files from GitHub
- Sends them to Lingo.dev for translation
- Saves translated files with language suffixes
Runs locally on your machine. No server needed.
Development
git clone https://github.com/codewithevilxd/MultiDocTranslator.git
cd MultiDocTranslator
npm install
npm run cli:build
npm run cli:run translate -- --repo owner/repoContributing
PRs welcome! Fork, make changes, send PR.
License
GPL-3.0
Thanks
- Lingo.dev for translations
- Commander.js & Inquirer.js for CLI
