A lightweight Windows tray application that translates selected Chinese text into natural, idiomatic English using AI (Gemini or OpenAI-compatible APIs).
- Instant Translation: Select text and press
Alt+Tto 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.
- Download: Go to the Releases page and download the latest
RealtimeTranslator.exe. - Run: No installation required. Just run the
.exe.
- Clone this repository.
- Create and activate a Python environment (3.10+ recommended).
- Install dependencies:
pip install -r requirements.txt
- Run the application:
python app.py
- 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).
- Gemini: Enter your API Key and Model (Recommended:
- Translate: Highlight any text in any application and press
Alt+T. - Hide: Press
Alt+Tagain or click theXbutton on the floating window to hide it. - 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 环境即可运行。
- 下载: 前往 Releases 页面下载最新的
RealtimeTranslator.exe。 - 运行: 无需安装,直接运行
.exe文件即可。
- 克隆仓库。
- 创建并激活 Python 环境(推荐 3.10+)。
- 安装依赖:
pip install -r requirements.txt
- 运行程序:
python app.py
- 配置: 右键点击托盘图标,选择 Settings (设置)。
- Gemini: 输入 API Key 和模型名称 (推荐使用
gemini-2.5-flash)。 - Custom: 输入 Base URL、API Key 和模型名称(兼容 OpenAI 的接口)。
- Gemini: 输入 API Key 和模型名称 (推荐使用
- 开始翻译: 在任何程序中选中文字,按下
Alt+T。 - 隐藏窗口: 再次按下
Alt+T或点击悬浮窗上的X按钮即可隐藏。 - 切换模式: 通过托盘右键菜单或设置窗口切换“日常”或“学术”模式。
本项目采用 MIT 许可证。
