Skip to content

HaidarIDK/AutoTranslator

Repository files navigation

InstaTranslate

Instantly translate any website UI to your preferred language!

InstaTranslate is a powerful Chrome/Edge browser extension that translates entire web pages in real-time. Simply select your target language and click translate - it's that easy!

Features

  • Instant Translation - Translate entire web pages with one click
  • 26+ Languages - Support for major world languages
  • Smart Caching - Faster translations with intelligent caching
  • Easy Restore - Restore original content anytime
  • Auto-Translate - Optional automatic translation of new pages
  • Context Menu - Right-click to translate selected text
  • Beautiful UI - Modern, intuitive interface
  • Responsive - Works on all websites

Supported Languages

English, Spanish, French, German, Italian, Portuguese, Russian, Japanese, Korean, Chinese (Simplified & Traditional), Arabic, Hindi, Turkish, Dutch, Polish, Swedish, Finnish, Norwegian, Danish, Czech, Greek, Hebrew, Indonesian, Thai, Vietnamese, and more!

Quick Installation

Just 3 Steps - No Extra Downloads Needed!

  1. Download this repository

    • Click the green "Code" button → "Download ZIP"
    • Extract the ZIP file to any folder
  2. Load in Chrome/Edge

    • Open Chrome → Go to chrome://extensions/
    • Enable "Developer mode" (toggle in top-right)
    • Click "Load unpacked"
    • Select the extracted folder
    • Done!
  3. Use it!

    • Visit any website
    • Click the InstaTranslate icon (it will show as a default puzzle piece)
    • Select your language
    • Click "Translate Page"

That's it! No icons to download, no complex setup!

How to Use

Basic Translation

  1. Navigate to any website you want to translate
  2. Click the InstaTranslate icon in your toolbar (extensions menu)
  3. Select your target language from the dropdown
  4. Click "Translate Page" button
  5. Wait 2-3 seconds while the page translates
  6. Enjoy the translated content!

Restore Original Content

  • Click the "Restore Original" button in the popup to revert to the original language

Auto-Translate

  1. Enable the "Auto-translate new pages" checkbox in the extension popup
  2. Select your preferred target language
  3. All new pages will automatically translate when loaded

Translate Selected Text

  1. Highlight any text on a webpage
  2. Right-click and select "Translate with InstaTranslate"
  3. The selected text will be translated

How It Works

InstaTranslate uses:

  • Content Scripts to access and modify webpage DOM elements
  • Google Translate API (unofficial endpoint) for translations
  • Smart Text Node Detection to find and translate all visible text
  • Caching System to avoid redundant API calls
  • Chrome Storage API to save your preferences

Technical Details

Files Structure

InstaTranslate/
├── manifest.json          # Extension configuration
├── popup.html            # Extension popup UI
├── popup.css             # Popup styling
├── popup.js              # Popup logic
├── content.js            # Main translation script
├── background.js         # Service worker
└── README.md             # This file

Key Features Implementation

  • DOM Traversal: Uses TreeWalker API to efficiently find all text nodes
  • Batch Translation: Translates multiple texts in batches for better performance
  • Smart Filtering: Skips scripts, styles, and non-visible elements
  • Attribute Translation: Translates placeholders, alt texts, and titles
  • Memory Management: Stores original content for accurate restoration

Configuration

The extension stores two settings:

  • Target Language: Your preferred translation language
  • Auto-Translate: Whether to automatically translate new pages

These settings are synced across your Chrome/Edge profile.

Troubleshooting

Extension doesn't appear

  • Make sure Developer mode is enabled
  • Check that all files are in the same folder
  • Reload the extension from chrome://extensions/

Translation not working

  • Check your internet connection (requires API access)
  • Try refreshing the page and translating again
  • Some websites may block content modifications

Page looks broken after translation

  • Click "Restore Original" to revert changes
  • Some websites with complex JavaScript may not translate well
  • Try refreshing the page

Tips for Best Results

  1. Use on static content: Works best on news sites, blogs, and documentation
  2. Avoid dynamic apps: Some web apps with heavy JavaScript may not translate well
  3. Refresh if needed: If translation seems incomplete, refresh and try again
  4. Clear cache: If seeing old translations, try restoring and translating again

Privacy

  • No data is collected or stored remotely
  • All translations are done through Google Translate API
  • Your browsing history is never accessed
  • Settings are stored locally in Chrome storage

Notes

  • This extension uses Google Translate's unofficial API endpoint
  • Translation quality depends on Google Translate
  • Some websites may have anti-translation measures
  • Large pages may take a few seconds to translate
  • The extension icon appears as Chrome's default extension icon

Contributing

Feel free to improve this extension! Some ideas:

  • Add more translation services (DeepL, Microsoft Translator)
  • Improve UI/UX
  • Add language detection
  • Add translation history
  • Implement better caching strategies
  • Add keyboard shortcuts

License

This project is open source and available for personal and educational use.

Enjoy!

Happy translating! Break down language barriers and explore the web in your preferred language!


About

Open-Source Auto Translator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors