shinkansen  by jimmysu0309

AI-powered Chrome extension for seamless webpage and subtitle translation

Created 1 month ago
331 stars

Top 82.7% on SourcePulse

GitHubView on GitHub
Project Summary

Shinkansen is a Chrome extension designed for rapid and fluid web page translation into Taiwanese Traditional Chinese, primarily utilizing Google Gemini. It addresses privacy concerns by processing all data locally, avoiding third-party server transfers, and offers a seamless reading experience by translating content in-place while preserving original page layouts. The extension targets users who frequently encounter foreign language content online and require a fast, private, and customizable translation solution.

How It Works

The core of Shinkansen relies on integrating with large language models, predominantly Google Gemini, to perform translations. It employs an in-place text replacement strategy, ensuring that translated content seamlessly integrates with the existing page structure, maintaining fonts, sizes, and link interactivity. Key architectural choices include a dual-layer caching mechanism for performance and cost savings, and a privacy-first design where all settings and data reside locally, with the exception of user-provided API keys for external services.

Quick Start & Requirements

  • Installation: Recommended via the Chrome Web Store. Alternatively, load unpacked from the project's shinkansen/ directory via chrome://extensions/ with developer mode enabled.
  • Prerequisites: A Google Gemini API Key is required for the primary translation engine. Custom model integration requires an OpenAI-compatible endpoint and potentially API keys for services like OpenRouter or Ollama.
  • Setup: Configure the extension by entering the Gemini API Key in the settings.
  • Links: Chrome Web Store (URL not provided in text, but implied), Official Website (URL not provided in text, but implied).

Highlighted Details

  • Instant Translation: Near real-time page translation (within 1 second) using Gemini.
  • Dual-Language Mode: Option to display original text alongside translations.
  • Custom AI Models: Supports OpenAI-compatible endpoints, allowing integration with services like OpenRouter, Together, DeepSeek, Groq, and local Ollama instances.
  • YouTube Subtitle Translation: Real-time translation of YouTube subtitles, with options for AI-powered sentence splitting and dual-language display.
  • Privacy-Focused: All settings and data are stored locally; no user content is sent to third-party servers beyond the user-provided API calls.
  • Cost Management: Features translation caching, real-time cost tracking, and API quota management for Gemini.

Maintenance & Community

Information regarding specific contributors, community channels (e.g., Discord, Slack), or a public roadmap is not detailed in the provided README.

Licensing & Compatibility

The project is licensed under the Elastic License 2.0 (ELv2). This license permits free viewing, learning, modification, and personal use of the source code. However, it prohibits packaging Shinkansen or modified versions as a service for sale.

Limitations & Caveats

Only one custom AI model endpoint can be configured at a time. Custom model integration requires adherence to the OpenAI API specification. The Google Translate engine is an unofficial endpoint and lacks a Service Level Agreement (SLA), making it susceptible to changes by Google. Features like custom models and advanced AI sentence splitting incur costs associated with the respective API providers.

Health Check
Last Commit

13 hours ago

Responsiveness

Inactive

Pull Requests (30d)
8
Issues (30d)
33
Star History
116 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.