Skip to content

Repository files navigation

🌐 LinguaLens — Read Any Website in Your Language

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.

Browser: Chrome Manifest Version License Languages Tests


✨ Features

  • 🔍 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 MutationObserver plus 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.

🚀 Quick start

From source (developer mode)

  1. Clone the repo:
    git clone https://github.com/CodexNexor/LinguaLens.git
    cd LinguaLens
  2. Open your browser's extension page:
    • Chrome / Brave / Opera: chrome://extensions
    • Edge: edge://extensions
  3. Turn on Developer mode (top-right).
  4. Click Load unpacked and select the LinguaLens folder.
  5. Open any foreign-language website, click the LinguaLens icon, and hit Translate now — or enable the master switch for auto-translate.

Keyboard shortcut

Press Ctrl + Shift + L to toggle translation on the current page (customizable in chrome://extensions/shortcuts).

🧭 Usage

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

How detection works

  1. The <html lang> attribute is used when present.
  2. Otherwise a fast Unicode-script heuristic samples the page (Han → Chinese, Kana → Japanese, Devanagari → Hindi, Gurmukhi → Punjabi, and so on).
  3. 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.

🌍 Supported languages

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.

🧱 How it works (for developers)

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.

🧪 Testing

# 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.js

The 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.

🛡️ Privacy

  • No analytics, no tracking pixels, no account, no telemetry.
  • The extension only contacts translation endpoints (translate.googleapis.com and, as a fallback, api.mymemory.translated.net) and only with the text that needs translating.
  • All settings live in your browser's chrome.storage.

🤝 Contributing

Contributions are welcome! Open an issue or a pull request. See CONTRIBUTING.md for guidelines.

📄 License

MIT © LinguaLens.


Made with 💜 · LinguaLens website

About

Free browser extension that auto-detects non-English websites (Chinese, Japanese, Hindi, Punjabi, Korean & 70+ more) and replaces the whole page with your language - full replacement or side-by-side. Manifest V3.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages