Skip to content

wearescientist/Global-Translator-Pro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒ Global Translator Pro

Universal Translator for Discord and the Entire Web

Chrome Extension License

A powerful browser extension that provides seamless, real-time translation for Discord chats and any website. Translate selected text instantly or enable auto-translation for specific domains.

Screenshot

๐Ÿ‡บ๐Ÿ‡ธ English | ๐Ÿ‡จ๐Ÿ‡ณ ็ฎ€ไฝ“ไธญๆ–‡


โœจ Features

Feature Description
๐Ÿš€ Discord Live Translation Automatically translates Discord chat messages in real-time as they appear
๐ŸŽฏ Global Selection Popup Select any text on any website and get instant translation with a single click
โšก Auto-Translate Domains Automatically translate entire pages for specific websites (e.g., Twitter/X)
๐ŸŒ Multi-Language Support Translate to/from 8 languages: Chinese, English, Japanese, Korean, Spanish, French, German, Russian
๐Ÿ”„ Smart Caching Translation results are cached to improve performance and reduce API calls
๐Ÿ”’ Privacy First Uses Google's public translation API directly from your browser - no data sent to third parties
๐Ÿ“ฑ Lightweight Minimal resource usage with optimized MutationObserver for dynamic content

๐Ÿ“ฆ Installation

Method 1: Chrome Web Store (Coming Soon)

Search "Global Translator Pro" on Chrome Web Store and install directly.

Method 2: Developer Mode (Current)

  1. Download or clone this repository:

    git clone https://github.com/wearescientist/Global-Translator-Pro.git
  2. Open Chrome and navigate to chrome://extensions/

  3. Enable Developer mode (toggle in top right)

  4. Click Load unpacked and select the Global-Translator-Pro folder

  5. The extension icon will appear in your browser toolbar


๐ŸŽฎ Usage

Setting Up

  1. Click the extension icon (๐ŸŒ) in your browser toolbar
  2. Select your Target Language from the dropdown
  3. Toggle features on/off as needed:
    • โœ… Discord Live Chat - Enable real-time Discord translation
    • โœ… Global Selection Popup - Enable text selection translation
    • ๐Ÿ”„ Auto-Translate this site - Enable auto-translation for current domain
  4. Click Save Settings

Translating Selected Text

  1. Select any text on any webpage
  2. A ๐ŸŒ icon appears near your selection
  3. Click the icon to see the translation instantly

Discord Translation

  • Simply navigate to Discord - translations appear automatically below foreign messages
  • Visual indicator "๐ŸŸข Translator Active" appears when active

Auto-Translate Mode

  • Enable "Auto-Translate this site" for your frequently visited foreign websites
  • Pages will be translated automatically as you scroll
  • Perfect for Twitter/X, news sites, and blogs

โš™๏ธ Supported Languages

Language Code
๐Ÿ‡จ๐Ÿ‡ณ Chinese (Simplified) zh
๐Ÿ‡บ๐Ÿ‡ธ English en
๐Ÿ‡ฏ๐Ÿ‡ต Japanese ja
๐Ÿ‡ฐ๐Ÿ‡ท Korean ko
๐Ÿ‡ช๐Ÿ‡ธ Spanish es
๐Ÿ‡ซ๐Ÿ‡ท French fr
๐Ÿ‡ฉ๐Ÿ‡ช German de
๐Ÿ‡ท๐Ÿ‡บ Russian ru

๐Ÿ—๏ธ Project Structure

Global-Translator-Pro/
โ”œโ”€โ”€ manifest.json              # Extension manifest (v3)
โ”œโ”€โ”€ background/
โ”‚   โ””โ”€โ”€ service_worker.js      # Background service worker
โ”œโ”€โ”€ popup/
โ”‚   โ”œโ”€โ”€ index.html             # Settings popup UI
โ”‚   โ”œโ”€โ”€ style.css              # Popup styles
โ”‚   โ””โ”€โ”€ script.js              # Popup logic
โ”œโ”€โ”€ scripts/
โ”‚   โ”œโ”€โ”€ global.js              # Global webpage content script
โ”‚   โ””โ”€โ”€ discord.js             # Discord-specific content script
โ”œโ”€โ”€ utils/
โ”‚   โ””โ”€โ”€ translator.js          # Core translation engine
โ”œโ”€โ”€ assets/
โ”‚   โ”œโ”€โ”€ icon16.png             # Extension icons
โ”‚   โ”œโ”€โ”€ icon32.png
โ”‚   โ”œโ”€โ”€ icon48.png
โ”‚   โ””โ”€โ”€ icon128.png
โ”œโ”€โ”€ resize_icons.py            # Icon generation helper
โ””โ”€โ”€ README.md

๐Ÿ”ง Technical Details

Architecture

  • Manifest V3: Latest Chrome extension format
  • Content Scripts: Injected into web pages for DOM manipulation
  • Service Worker: Handles translation API calls and context menus
  • Chrome Storage API: Persists user settings

Translation Engine

  • Uses https://translate.googleapis.com/translate_a/single endpoint
  • Free, rate-limited Google Translate API
  • Supports automatic language detection (sl=auto)
  • Client identifier: gtx

Performance Optimizations

  • Translation Queue: Concurrent requests limited to 4 for optimal performance
  • MutationObserver: Efficient DOM change detection
  • Result Caching: Prevents duplicate translations
  • Same-Language Detection: Skips translation when source equals target

๐Ÿ› ๏ธ Development

Prerequisites

  • Chrome 88+ or Chromium-based browser
  • Basic knowledge of JavaScript and Chrome Extension APIs

Local Development

  1. Clone the repository
  2. Make your changes to the source files
  3. Go to chrome://extensions/ and reload the extension
  4. Test your changes

Icon Generation

Use the included Python script to generate icon sizes:

python resize_icons.py --source icon_original.png

๐Ÿ“ Permissions

The extension requires the following permissions:

Permission Purpose
storage Save user preferences
activeTab Access current tab for translation
scripting Inject translation scripts
contextMenus Add "Translate Full Page" context menu
<all_urls> Translate content on any website

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ™ Acknowledgments

  • Translation powered by Google Translate
  • Icons designed for Chrome Extension standards

๐Ÿ“ฌ Contact


Built with โค๏ธ for breaking down language barriers

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors