devdocs-global
v2.0.0
Published
π AI-powered multilingual documentation with Lingo integration
Maintainers
Readme
DevDocs Global π
AI-powered multilingual documentation translation system with web dashboard, CLI tool, and GitHub Actions automation.
Translate your documentation into 6+ languages automatically using Lingo.dev SDK powered by GPT-4.
β¨ Features
- π Full-Stack Application - Web dashboard + CLI tool + GitHub Actions automation
- π€ AI-Powered Translation - Uses Lingo.dev SDK with GPT-4 precision
- π Markdown Support - Preserves formatting, code blocks, and links
- π Multi-Language - Translates to Spanish, French, German, Japanese, Hindi, Chinese
- β‘ Smart Caching - Incremental translations save time and API costs
- π GitHub Actions - Auto-translate on every push
- πΎ Quality Metrics - 95-99% translation accuracy
- π Dashboard UI - Beautiful React interface for translations
- π₯οΈ CLI Tool - Use from command line or CI/CD pipelines
- π Secure - Your API key stays local, never exposed
π Quick Start
Installation
Global CLI (Recommended)
npm install -g devdocs-globalLocal Project
npm install devdocs-globalSetup
1. Get API Key
- Visit lingo.dev
- Sign up for free
- Get your API key from dashboard
2. Initialize
devdocs-global initCreates devdocs.config.json with default settings.
3. Set API Key
export LINGODOTDEV_API_KEY=your_api_key_hereOr add to .env.local:
LINGODOTDEV_API_KEY=your_api_key_here4. Organize Your Docs
docs/
βββ en/
βββ getting-started.md
βββ installation.md
βββ features.md5. Translate
devdocs-global translateCreates:
docs/
βββ en/ (original)
βββ es/ (Spanish)
βββ fr/ (French)
βββ de/ (German)
βββ ja/ (Japanese)
βββ hi/ (Hindi)
βββ zh/ (Chinese)π Commands
devdocs-global init
Initialize DevDocs Global in your project.
devdocs-global initCreates devdocs.config.json:
{
"sourceLanguage": "en",
"sourceDir": "./docs",
"targetLanguages": ["es", "fr", "de", "ja", "hi", "zh"],
"outputDir": "./docs",
"apiKey": "your-api-key",
"cacheDir": "./.lingo-cache"
}devdocs-global translate [options]
Translate documentation to multiple languages.
devdocs-global translateOptions:
-s, --source <language> Source language (default: auto-detect)
-t, --targets <languages> Target languages (comma-separated)
--source-dir <path> Source documentation directory
--output-dir <path> Output directory for translations
--incremental Only translate changed filesExamples:
# Translate all files to default languages
devdocs-global translate
# Translate to specific languages only
devdocs-global translate -t es,fr,de
# Use custom directories
devdocs-global translate --source-dir ./documentation --output-dir ./translated
# Only translate changed files (faster)
devdocs-global translate --incremental
# Specify source language
devdocs-global translate -s en -t es,frdevdocs-global detect <file>
Detect the language of a document.
devdocs-global detect docs/en/getting-started.mdOutput:
Detected language: endevdocs-global status
Show translation status and statistics.
devdocs-global statusOutput:
π Translation Status
Configuration:
Source Language: en
Target Languages: es, fr, de, ja, hi, zh
Source Dir: ./docs
Output Dir: ./docs
Cache Status: 5 files cachedπ Configuration
Edit devdocs.config.json:
{
"sourceLanguage": "en",
"sourceDir": "./docs",
"targetLanguages": ["es", "fr", "de", "ja", "hi", "zh"],
"outputDir": "./docs",
"apiKey": "your-lingo-api-key",
"cacheDir": "./.lingo-cache"
}Configuration Options
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| sourceLanguage | string | "en" | Source language code (or "auto" to detect) |
| sourceDir | string | "./docs" | Directory containing source documentation |
| targetLanguages | array | ["es", "fr", "de", "ja", "hi", "zh"] | Target language codes |
| outputDir | string | "./docs" | Output directory for translations |
| apiKey | string | - | Lingo.dev API key |
| cacheDir | string | "./.lingo-cache" | Cache directory for incremental updates |
π Supported Languages
| Code | Language | |------|----------| | en | English | | es | Spanish | | fr | French | | de | German | | ja | Japanese | | hi | Hindi | | zh | Chinese | | pt | Portuguese | | ru | Russian | | ar | Arabic |
π GitHub Actions Integration
Automatically translate documentation on every push!
Setup GitHub Actions
Add Secret
- Go to: Settings β Secrets and variables β Actions
- Add:
LINGODOTDEV_API_KEYwith your API key
Create Workflow
File: .github/workflows/auto-translate.yml
name: Auto-Translate Documentation
on:
push:
branches: [ main ]
paths:
- 'docs/en/**'
- 'package.json'
- '.github/workflows/auto-translate.yml'
permissions:
contents: write
jobs:
translate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- name: Clean old translations
run: rm -rf docs/es docs/fr docs/de docs/ja docs/hi docs/zh
- name: Run translations
env:
LINGODOTDEV_API_KEY: \${{ secrets.LINGODOTDEV_API_KEY }}
run: npm run translate
- name: Commit and push
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
if ! git diff --quiet; then
git add docs/
git commit -m "π chore: Auto-translate documentation"
git push origin main
fiπ» Web Dashboard
Use the web interface for easier management:
Start Dev Server
npm run devOpen Dashboard
http://localhost:3000/dashboardUpload & Translate
- Select markdown files
- Choose target languages
- Click "Translate Now"
- Download results
π οΈ Development
Prerequisites
- Node.js 18+
- npm or yarn
- Git
Setup
# Clone repository
git clone https://github.com/Patelmedhansh/DevDocs-Global.git
cd DevDocs-Global
# Install dependencies
npm install
# Create .env.local
echo "LINGODOTDEV_API_KEY=your_key_here" > .env.local
# Start development
npm run devProject Structure
DevDocs-Global/
βββ src/
β βββ cli/ # CLI tool
β β βββ index.js # Main CLI entry
β β βββ translator.js # Lingo SDK integration
β β βββ extractor.js # Text extraction
β β βββ cache.js # Caching logic
β β βββ languageDetector.js
β βββ app/ # Next.js web app
β βββ page.js # Home page
β βββ dashboard/ # Dashboard
β βββ api/ # API routes
βββ docs/
β βββ en/ # Source documentation
βββ .github/workflows/ # GitHub Actions
βββ package.json
βββ README.mdπ¦ API Reference
LingoTranslator
import { LingoTranslator } from './translator.js';
const translator = new LingoTranslator(apiKey);
// Translate text
const result = await translator.translate(text, 'en', 'es');
// Batch translate
const results = await translator.batchTranslate(texts, 'en', ['es', 'fr']);
// Detect language
const lang = await translator.detectLanguage(text);
// Get supported languages
const langs = await translator.getSupportedLanguages();π Security
- β
API keys stored locally in
.env.local(not committed) - β Never exposed in public files
- β GitHub Actions uses Secrets (encrypted)
- β No data sent to third parties except Lingo.dev
- β Uses HTTPS for all API calls
π Performance
- Translation Speed: ~2-5 seconds per file
- Caching: 50-70% faster on incremental updates
- Memory Usage: <100MB typical
- API Efficiency: Smart batching reduces API calls
π° Cost Estimation
Based on Lingo.dev pricing:
- Free Tier: ~10,000 words/month
- Small Project (100KB docs): ~$5-10/month
- Medium Project (1MB docs): ~$50-100/month
- Large Project (10MB docs): ~$500-1000/month
π Troubleshooting
"API Key not found"
# Check .env.local exists
cat .env.local
# Should show:
# LINGODOTDEV_API_KEY=your_key
# If missing, create it:
echo "LINGODOTDEV_API_KEY=your_key" > .env.local"No markdown files found"
# Verify source directory structure
find docs/en -name "*.md"
# Should show your markdown files"Translation failed - Invalid credentials"
# 1. Verify API key is correct
npm run status
# 2. Get new key from lingo.dev if expired
# 3. Update .env.local
# 4. Restart: npm run dev
# 5. Try again: npm run translate"GitHub Actions permission denied"
- Go to: Settings β Actions β General
- Select: "Read and write permissions"
- Check: "Allow GitHub Actions to create pull requests"
- Save and retry
π€ Contributing
Contributions welcome! Please:
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
π License
This project is licensed under the MIT License - see LICENSE file for details.
π¬ Support
- π Documentation
- π Issues
- π‘ Discussions
π Acknowledgments
- Lingo.dev - Translation engine
- OpenAI GPT-4 - AI model
- Next.js - Web framework
- Commander.js - CLI framework
π Roadmap
- [ ] Web UI improvements
- [ ] Support for more languages
- [ ] Glossary/terminology management
- [ ] Translation memory
- [ ] A/B testing translations
- [ ] CI/CD integration (GitLab, Gitea, etc.)
- [ ] REST API for programmatic access
- [ ] Desktop app
- [ ] Browser extension
β Show Your Support
If this project helped you, please give it a star! β
π Version History
v2.0.0 (Current)
- β¨ Full-stack application
- π¨ React dashboard
- π GitHub Actions automation
- π CLI improvements
- π¦ npm publishing ready
v1.0.0
- π― Initial release
- π CLI tool
- π Basic translation
Made with β€οΈ by Medhansh Patel
Repository: https://github.com/Patelmedhansh/DevDocs-Global
