LinguaLens is a free, open-source browser extension that auto-detects non-English websites — Chinese, Japanese, Hindi, Punjabi, Korean, Arabic and 70+ languages — and instantly replaces the entire page with your chosen language.
Stuck in a Chinese Discord server? A Japanese forum? A Hindi WhatsApp Web group? Stop copy-pasting into Google Translate. One click and the whole site speaks your language.
- 🔍 Auto language detection — reads the page, figures out what language it's in, and translates only what needs translating. English pages are left untouched.
- ✅ Full replacement mode (default) — headings, chat messages, buttons, tooltips: every word is replaced, not shown next to the original. The page just reads in your language.
- ⇄ Side-by-side mode (optional) — flip one switch to keep the original text next to the translation, great for language learners.
- 💬 Built for Discord, X, Reddit & SPAs — a
MutationObserverplus Shadow DOM traversal means new messages and dynamically loaded content translate automatically as they appear. - 🎯 Translate to any of 70+ languages — not just English. Spanish, Japanese, Hindi, Russian, you name it.
- 🔒 No account, no API key, no cost — runs on free, public translation endpoints.
- 🕶️ Private — no analytics, no tracking, no data resale. Text is sent in small batches only to the translation service.
- ⚡ Blazing fast — batching, caching, and a smart queue keep API calls minimal and translations instant.
- Clone the repo:
git clone https://github.com/CodexNexor/LinguaLens.git cd LinguaLens - Open your browser's extension page:
- Chrome / Brave / Opera:
chrome://extensions - Edge:
edge://extensions
- Chrome / Brave / Opera:
- Turn on Developer mode (top-right).
- Click Load unpacked and select the
LinguaLensfolder. - Open any foreign-language website, click the LinguaLens icon, and hit Translate now — or enable the master switch for auto-translate.
Press Ctrl + Shift + L to toggle translation on the current page (customizable in chrome://extensions/shortcuts).
| What | How |
|---|---|
| Translate a page | Click the LinguaLens icon → toggle Translate this page (or press Ctrl+Shift+L) |
| Manual translate | Click Translate now in the popup |
| Switch mode | Popup → Replace (default) or Side-by-side |
| Change target language | Popup → Translate to dropdown |
| Auto-translate new content | Popup → Auto-translate checkbox (on by default) |
| Show original again | Click Show original in the popup (or toggle the master switch off) |
| Reset everything | Click Reset in the popup |
- The
<html lang>attribute is used when present. - Otherwise a fast Unicode-script heuristic samples the page (Han → Chinese, Kana → Japanese, Devanagari → Hindi, Gurmukhi → Punjabi, and so on).
- The result is refined with the translation API's built-in auto-detection.
Pure-ASCII English pages are skipped automatically, so LinguaLens never wastes calls on sites that don't need translating.
Simplified & Traditional Chinese, Japanese, Korean, Hindi, Punjabi, Bengali, Tamil, Telugu, Marathi, Gujarati, Kannada, Malayalam, Odia, Urdu, Persian, Arabic, Hebrew, Thai, Vietnamese, Indonesian, Malay, Filipino, Spanish, French, German, Italian, Portuguese, Dutch, Polish, Russian, Ukrainian, Bulgarian, Serbian, Turkish, Greek, Czech, Slovak, Hungarian, Romanian, Swedish, Norwegian, Danish, Finnish, Lithuanian, Latvian, Estonian, Catalan, Basque, Croatian, Slovenian, Swahili, Amharic, Nepali, Sinhala, Khmer, Lao, Burmese, Azerbaijani, Uzbek, Kazakh, Mongolian, Georgian, Armenian, Zulu, Afrikaans, Welsh, Gaelic, Icelandic, Maltese, Bosnian, Albanian, Macedonian, Belarusian, Esperanto, and English — 70+ languages with automatic detection between them.
LinguaLens/
├── manifest.json # MV3 manifest
├── background.js # Service worker: keyboard shortcut, state sync
├── content/
│ ├── content.js # DOM walker, detection, batching, replace/side-by-side
│ └── content.css # Scoped .ll- styles
├── lib/
│ ├── languages.js # 70+ language catalogue
│ ├── detect.js # Unicode-script detection heuristics
│ └── translate.js # Google Translate + MyMemory fallback, caching, batching
├── popup/
│ ├── popup.html/.css/.js# Settings UI with live status
├── icons/ # Generated icons (16–128px)
├── index.html # SEO-optimized landing page (GitHub Pages)
└── tests/
├── test.js # Unit + live-API integration tests
└── test-dom.js # jsdom end-to-end DOM tests
Translation pipeline: text nodes are collected (skipping scripts, inputs, code blocks and .notranslate regions) → batched by joining segments with newlines (the Google endpoint preserves them 1:1) → translated in a concurrency-limited queue → applied as full replacement or wrapped side-by-side spans. Results are cached in memory and chrome.storage.local so scrolling and revisits are instant.
# Unit + live translation-API tests (Node 18+)
node tests/test.js
# End-to-end DOM tests (jsdom)
NODE_PATH=/path/to/jsdom/node_modules node tests/test-dom.jsThe suite covers: language catalogue integrity, Unicode-script detection (Chinese, Japanese, Hindi, Punjabi…), Google batch translation with 1:1 segment mapping, auto-detection, target-language switching, MyMemory fallback, caching, dynamic content (SPA simulation), side-by-side mode, and revert-to-original.
- No analytics, no tracking pixels, no account, no telemetry.
- The extension only contacts translation endpoints (
translate.googleapis.comand, as a fallback,api.mymemory.translated.net) and only with the text that needs translating. - All settings live in your browser's
chrome.storage.
Contributions are welcome! Open an issue or a pull request. See CONTRIBUTING.md for guidelines.
MIT © LinguaLens.
Made with 💜 · LinguaLens website