2025-08-24 22:51:43 +08:00
2025-08-23 11:01:54 +08:00
2025-08-19 10:11:40 +08:00
2025-08-19 10:11:40 +08:00
2025-08-24 22:51:43 +08:00
2025-08-19 10:11:40 +08:00
2025-08-22 21:50:35 +08:00
2025-08-22 21:50:35 +08:00

KISS Translator

English | 简体中文

A simple, open source bilingual translation extension & Greasemonkey script.

kiss-translator.webm

Features

  • Keep it simple, smart
  • Open source
  • Adapt to common browsers
    • Chrome/Edge
    • Firefox
    • Kiwi (Android)
    • Orion (iOS)
    • Safari
      • Safari (Mac)
    • Thunderbird
  • Supports multiple translation services
    • Google/Microsoft
    • Baidu/Tencent/Volcengine
    • OpenAI/Gemini/Claude/Ollama/DeepSeek/CloudflareAI
    • DeepL/DeepLX/NiuTrans
    • Custom translation interface
  • Covers common translation scenarios
    • Web bilingual translation
    • Input box translation
    • Seletction translation
      • Favorite Words
    • Mouseover translation
    • YouTube subtitle translation
  • Cross-client data synchronization
    • KISS-Workercloudflare/docker
    • WebDAV
  • Custom translation rules
    • Rule subscription/rule sharing
    • Customized terminology
  • Custom translation style
  • Custom shortcut keys
    • Alt+Q Toggle Translation
    • Alt+C Toggle Styles
    • Alt+K Open Setting Popup
    • Alt+S Open Translate Popup / Translate Selected Text
    • Alt+O Open Options Page
    • Alt+I Input Box Translation

Install

Note: For the following reasons, it is recommended to use browser extensions first

  • Browser extensions have more complete functions (local language recognition, context menu, etc.)
  • Grease Monkey script will encounter more usage problems (cross domain issues, script conflicts, etc.)

Associated Projects

  • Data synchronization service: https://github.com/fishjar/kiss-worker
    • Data synchronization service available for this project.
    • Can also be used to share personal private rule lists.
    • Deploy by yourself, manage by yourself, data is private.
  • Community subscription rules: https://github.com/fishjar/kiss-rules
    • Provides the latest and most complete list of subscription rules maintained by the community.
    • Help with rules-related issues.
  • Translation interface agent: https://github.com/fishjar/kiss-proxy
    • If you encounter network problems when accessing a certain translation interface, this proxy service may help you.
    • Deploy and manage by yourself.

Frequently Asked Questions

How to Turn Off Automatic Translation

You can achieve this through Rules Setting with the following methods:

  • Personal Rules: RULES-> Global Rule -> Translate Switch -> Disaabled
  • Subscription Rules: SUBSCRIBE -> Select the third option kiss-rules-off.json
  • Override Subscription Rules: OVERWRITE -> Translate Switch -> Disaabled
  • Add a Personal Rule for a Specific Website: Translate Switch -> Disaabled

How to Set Keyboard Shortcuts

Set this in the extension management page, for example:

How to Turn Off Selection Translation

Set this in the Rules Setting: RULES -> Global Rule -> If translate selected -> Disable

How to Set it to Show Only the Translation

Set this in the Rules Setting: RULES -> Global Rule -> Show Only Translations -> Enable

How to Set Mouse Hover Translation

Set this in the Rules Setting: RULES -> Global Rule -> TTrigger Mode

Why are some web pages not fully translated?

This extension's webpage translation is based on CSS selectors. Generic rules cannot adapt to all websites, and sometimes you need to manually add site-specific rules. If you don't know how to write rules, you can seek help here:
https://github.com/fishjar/kiss-rules/issues

What is the priority order of rule settings?

Personal Rules > Override Subscription Rules > Subscription Rules > Global Rules

Among these, Global Rules have the lowest priority but are very important as they serve as the default rules.

Why are YouTube subtitles translated in broken sentences?

This extension has no special development for video content. Support for YouTube is also treated as regular webpage translation. Auto-generated subtitles are streamed and output progressively, resulting in poorer support.

To disable this extension's subtitle translation, add a rule. Reference: https://github.com/fishjar/kiss-translator/issues/62

Local Ollama interface cannot be used

If encountering a 403 error, refer to: https://github.com/fishjar/kiss-translator/issues/174

Custom API doesn't work in Tampermonkey scripts

Tampermonkey scripts require adding domains to the whitelist; otherwise, requests cannot be sent.

How to Set Up Hook Functions for Custom Interfaces

The custom interface feature is highly flexible and can theoretically integrate with any translation interface.

Example of a Request Hook function:

/**
 * Request Hook
 * @param {string} text Text to be translated
 * @param {string} from Source language
 * @param {string} to   Target language
 * @param {string} url  Translation interface URL
 * @param {string} key  Translation interface API key
 * @returns {Array[string, object]} [Interface URL, request object]
 */
(text, from, to, url, key) => [url, {
  headers: {
    "Content-type": "application/json",
    "Authorization": `Bearer ${key}`
  },
  method: "POST",
  body: { text, to },
}]

Example of a Response Hook function:

 * Response Hook
 * @param {string} res  JSON data returned by the interface
 * @param {string} text Text to be translated
 * @param {string} from Source language
 * @param {string} to   Target language
 * @returns {Array[string, boolean]} [Translated text, whether target language is same as source]
 * Note: If the second return value is true (target language same as source), 
 *       the translation will not be displayed on the page,
 *       If the parameters are incomplete, it is recommended to return false directly
 */
(res, text, from, to) => [res.text, to === res.src]

For more custom interface examples, refer to: custom-api.md

Future Plans

This is a side project with no strict timeline. Community contributions are welcome. The following are preliminary feature directions:

  • Batch Text Requests: Optimize request strategy to reduce translation API calls and improve performance.
  • Enhanced Rich Text Translation: Support accurate translation of complex page structures and rich text content.
  • Advanced Custom/AI Interfaces: Add support for context memory, multi-turn conversations, and other advanced AI features.
  • Fallback English Dictionary: When translation services fail, fall back to a local dictionary lookup.
  • Improved YouTube Subtitle Support: Enhance merging and translation experience for streaming subtitles, reducing sentence fragmentation.
  • Upgraded Rule Collaboration System: Introduce more flexible rule sharing, version management, and community review processes.

If you're interested in any of these directions, feel free to discuss in Issues or submit a PR!

Development Guidelines

git clone https://github.com/fishjar/kiss-translator.git
cd kiss-translator
git checkout dev # Submit a PR suggestion to push to the dev branch
pnpm install
pnpm build

Discussion

Appreciate

appreciate

Description
A simple, open source bilingual translation extension & Greasemonkey script (一个简约、开源的 双语对照翻译扩展 & 油猴脚本)
Readme GPL-3.0 20 MiB
Languages
JavaScript 99.8%
HTML 0.2%