Skip to content

Repository files navigation

HermesAI Translator


AI-powered translation and reading assistant extension for Chromium-based browsers

AGPL-3.0 License TypeScript React Vite

📖 About

HermesAI Translator is an advanced browser extension powered by Hermes-4-70B and various cutting-edge Large Language Models (LLMs). It is designed to provide seamless webpage translation, text polishing, and content summarization directly within your browser, making cross-lingual communication easier than ever.

✨ Core Features

  • 🌍 Context-Aware Translation - Bidirectional translation for 55+ languages, providing accurate, native-sounding results based on text context.
  • ✍️ Text Polishing & Rewriting - Utilize AI’s robust natural language processing to fix grammatical errors, adjust tone, and elevate your writing quality.
  • 📝 Long Article Summarization - Quickly extract key insights and overviews from lengthy posts, news articles, or documents to save reading time.
  • 🎯 OCR Screenshot Translation - For text embedded in images, easily capture a screenshot to identify and translate instantly.
  • 🔊 Text-to-Speech (TTS) - High-quality voice synthesis helps you learn correct pronunciations of foreign languages.
  • 📚 Smart Vocabulary Book - Save unfamiliar words conveniently; AI automatically generates example sentences and memory aids based on the context.
  • ⚡ Real-Time Streaming - Experience immediate responses via streaming outputs. No more long waits—get results as they are generated.
  • 🎨 Highly Customizable - Personalize your experience with UI theme options, preferred AI model selection, and custom system prompts.
  • 📋 One-Click Copy - Easily grab your translation results and quickly switch target languages.
  • ⌨️ Global Keyboard Shortcuts - Instantly summon the extension using Ctrl+Shift+Y ( Windows ) or Cmd+Shift+Y ( Mac ).

🚀 Installation Guide

Method 1: Using the Pre-built Extension (Recommended)

  1. Download the latest chromium.zip from the dist/browser-extension/ directory.
  2. Extract the downloaded .zip file into a secure local folder. Do not delete this folder after installation.
  3. Open your Chromium-based browser (Chrome, Edge, Brave, Arc, etc.).
  4. Navigate to the extensions management page: chrome://extensions/ for Chrome, or edge://extensions/ for Edge.
  5. Toggle "Developer mode" on in the top-right corner.
  6. Click the "Load unpacked" button and select the folder you extracted in Step 2.
  7. Done! The extension icon will appear in your browser's toolbar. We recommend pinning it for easy access.

Method 2: Build from Source

For developers who want to compile the extension themselves.

Prerequisites

  • Node.js v16 or higher
  • pnpm v9 or higher (Install via npm install -g pnpm)
  • Git

Build Steps

# 1. Clone the repository
git clone https://github.com/wodesiku/hermesai-translator.git
cd hermesai-translator

# 2. Install dependencies
pnpm install

# 3. Build for production
pnpm build

# 4. (Optional) Pack the build into a ZIP file
pnpm build:zip

The final built files will be located in the dist/browser-extension/chromium/ directory. Follow Steps 3-7 from Method 1 to load the extension into your browser.

🔧 Initial Configuration

A quick API setup is required before first use:

  1. Click the HermesAI Translator icon in your browser toolbar to open the main popup.
  2. Navigate to the Settings page (Gear icon).
  3. Under the API Settings section, choose your preferred AI provider and input the corresponding API Key.
  4. (Optional) Customize your preferences:
    • Set your default source and target languages.
    • Select an AI model from presets or enter a custom model name.
    • Adjust default system prompts to change translation tone/style.

💡 How to Use

In-Page Text Translation

  1. Highlight any foreign word or paragraph while browsing a webpage.
  2. The translation pop-up button will appear automatically; click it to translate.
  3. Or, press the shortcut Ctrl+Shift+Y (Win) / Cmd+Shift+Y (Mac) to open the side panel for a detailed view.
  4. Alternatively, right-click the highlighted text and select "Translate with HermesAI" from the context menu.

Text Polishing & Grammar Checking

  1. Draft your text in any input box and highlight it.
  2. Open the extension's main panel.
  3. Switch to the "Polish" tab at the top.
  4. Execute to receive AI-suggested corrections and stylistic improvements for your writing.

Content Summarization

  1. Highlight a long article or text block.
  2. Open the extension’s main panel and switch to the "Summarize" mode.
  3. The AI will process the text and generate a concise bullet-point summary of the core concepts.

🛠️ Local Development

To contribute or modify the extension locally, use the following commands:

# Start the local dev server with Hot Module Replacement (HMR)
pnpm dev

# Run ESLint to catch syntax/style issues
pnpm lint

# Automatically fix linting errors
pnpm lint:fix

# Format codebase using Prettier
pnpm format

# Clean previous build artifacts
pnpm clean

Core Project Structure

hermesai-translator/
├── src/
│   ├── browser-extension/     # Entry points specific to the browser extension environment
│   │   ├── background/        # Background Service Worker logic
│   │   ├── content_script/    # Scripts injected into host pages (handling selection, UI popups)
│   │   ├── popup/             # Main React UI when clicking the extension icon
│   │   └── options/           # Standalone comprehensive settings page UI
│   └── common/                # Shared utilities, state management, and generic UI components
├── dist/                      # Output directory generated after running `pnpm build`
├── public/                    # Static assets (icons, Manifest V3 definitions)
└── vite.config.chromium.ts    # Vite build configuration tailored for Chromium extensions

🌐 Browser Compatibility

Built with the Manifest V3 standard, this extension supports virtually all modern Chromium-based browsers:

  • ✅ Google Chrome (Version 88+)
  • ✅ Microsoft Edge (Version 88+)
  • ✅ Brave Browser
  • ✅ Opera (Version 74+)
  • ✅ Vivaldi, Arc, and other Chromium derivatives

(Dedicated adaptations for Firefox and Safari specific APIs have not been fully verified yet.)

📄 License

This project is open-source and released under the AGPL-3.0 License. You are free to use, modify, and distribute it, provided that any derivative works are also open-sourced under the identical license.

🙏 Acknowledgments

  • Translation capabilities and logic inspiration rely on projects like NousResearch/Hermes-agent and other excellent closed/open source large language models.
  • The frontend stack is powered by the React ecosystem, TypeScript, and the Vite lightning-fast build tool.

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages