Skip to content

MBJinX/TinyTranslator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Realtime Translator (Windows) / 实时翻译器 (Windows)

Show

English | 中文


English

A lightweight Windows tray application that translates selected Chinese text into natural, idiomatic English using AI (Gemini or OpenAI-compatible APIs).

🚀 Features

  • Instant Translation: Select text and press Alt+T to see the translation in a floating window.
  • Dual Providers: Supports Google Gemini API and any OpenAI-compatible API (Custom).
  • Streaming Support: Real-time response display for faster feedback.
  • Two Modes:
    • Daily: Natural and idiomatic for daily communication.
    • Academic: Formal and precise for research and professional writing.
  • Customizable: Adjustable prompts, max tokens, and hotkeys.
  • Portable: Can be built into a single executable file.

🛠️ Installation & Setup

For Users (Windows)

  • Download: Go to the Releases page and download the latest RealtimeTranslator.exe.
  • Run: No installation required. Just run the .exe.

For Developers

  1. Clone this repository.
  2. Create and activate a Python environment (3.10+ recommended).
  3. Install dependencies:
    pip install -r requirements.txt
  4. Run the application:
    python app.py

📖 Usage

  1. Configuration: Right-click the tray icon and select Settings.
    • Gemini: Enter your API Key and Model (Recommended: gemini-2.5-flash).
    • Custom: Enter Base URL, API Key, and Model (OpenAI-compatible).
  2. Translate: Highlight any text in any application and press Alt+T.
  3. Hide: Press Alt+T again or click the X button on the floating window to hide it.
  4. Switch Mode: Change modes via the tray menu or Settings.

中文

一个轻量级的 Windows 托盘应用程序,利用 AI(Gemini 或兼容 OpenAI 的 API)将选中的中文文本翻译为自然、地道的英文。

🚀 功能特性

  • 即时翻译: 选中文字后按下 Alt+T,即可在悬浮窗中查看翻译结果。
  • 双驱动支持: 支持 Google Gemini API 以及任何兼容 OpenAI 接口的自定义 API。
  • 流式传输: 支持流式输出,响应更迅速,无需等待完整返回。
  • 双模式切换:
    • 日常模式: 适用于日常交流,语言自然地道。
    • 学术模式: 适用于论文和专业写作,用词准确严谨。
  • 高度可定制: 可自定义提示词 (Prompts)、最大 Token 数和快捷键。
  • 便携性: 可打包成单个可执行文件,无需安装 Python 环境即可运行。

🛠️ 安装与设置

普通用户 (Windows)

  • 下载: 前往 Releases 页面下载最新的 RealtimeTranslator.exe
  • 运行: 无需安装,直接运行 .exe 文件即可。

开发者

  1. 克隆仓库。
  2. 创建并激活 Python 环境(推荐 3.10+)。
  3. 安装依赖:
    pip install -r requirements.txt
  4. 运行程序:
    python app.py

📖 使用说明

  1. 配置: 右键点击托盘图标,选择 Settings (设置)
    • Gemini: 输入 API Key 和模型名称 (推荐使用 gemini-2.5-flash)。
    • Custom: 输入 Base URL、API Key 和模型名称(兼容 OpenAI 的接口)。
  2. 开始翻译: 在任何程序中选中文字,按下 Alt+T
  3. 隐藏窗口: 再次按下 Alt+T 或点击悬浮窗上的 X 按钮即可隐藏。
  4. 切换模式: 通过托盘右键菜单或设置窗口切换“日常”或“学术”模式。

📄 许可证

本项目采用 MIT 许可证。

About

一个小玩具

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors