
✨ Application for instant text translation and enhancement via Gemini API with hotkey support
- One-click translation of selected text
- Translation enhancement using Gemini AI
- Flexible configuration via config file
- Select the text you want to translate.
- Press
ctrl+shift+t
(or your configured hotkey). - The translated and enhanced text will be automatically pasted in place of the original.
Clone the repository:
git clone https://github.com/anacesh/Hotkey-translator-gemini
cd text-translator
Install dependencies:
pip install -r requirements.txt
- Go to Google AI Studio.
- Click “Get API key” in the menu.
- Create a new API key.
Copy the key to config.json:
"gemini_api_key": "YOUR_GEMINI_KEY"
❗ Important: The Gemini API is not available in all countries. Check the list of supported regions.
The config.json file contains the main settings:
{
"hotkey": "ctrl+shift+t",
"enable_alt_copy": true,
"default_target_language": "en",
"use_gemini": true,
"send_original_to_gemini": true,
"system_prompt": "...",
"gemini_extra_prompt": "...",
"languages": {
"ru": { "target": "en" },
"en": { "target": "ru" }
}
}
hotkey
: Hotkey for activation (e.g.,ctrl+shift+t
).use_gemini
: Enable translation enhancement via Gemini API (true
orfalse
).system_prompt
: System prompt for the Gemini model.languages
: Translation language settings (e.g.,{"ru": {"target": "en"}}
).
python main.py
text-translator/
├── clipboard_handler.py # Clipboard handling
├── config.py # Configuration manager
├── main.py # Entry point
├── translator.py # Translation and Gemini API logic
├── tray_icon.py # System tray icon
├── config.json # Configuration file
└── requirements.txt # Dependencies
- Administrative privileges are required for keyboard event handling.
- The Gemini API may have request limitations.
- X11/Wayland is required for Linux operation.
📄 License MIT License © 2025 [anacesh]

Leave a Reply