Translatity is a powerful and user-friendly application that allows you to translate subtitle files (SRT format) using Google's Gemini AI model. It provides a graphical user interface for easy file management, translation settings, and progress tracking.
This project was born out of a desire to leverage the impressive capabilities of Google's Gemini 1.5 Pro model, particularly its expansive 2M token context window, to deliver superior, context-aware machine translations. The goal is to provide a free and accessible tool for anyone in supported regions to benefit from this cutting-edge technology.
- Translate SRT files from one language to another
- Support for multiple API keys with automatic rotation (W.I.P.)
- Drag-and-drop file addition to the translation queue
- File preview functionality
- Progress tracking for individual files and the entire queue
- Contextual translation to maintain tone and style
- Settings persistence for convenience
Here's an non-cherrypicked non-normalized example result of an entire season of subtitles translated for english to portuguese using this method:
https://github.com/ArthurCarrenho/DegrassiTngSubs/tree/pt/S01
-
Clone this repository:
git clone https://github.com/ArthurCarrenho/translatity.git cd translatity -
Install the required dependencies:
pip install PyQt6 google-generativeaiNote: The
google-generativeaipackage currently has known compatibility issues with Python 3.13. Please consider using an alternative Python version if you encounter problems. -
Set up your Google API key(s):
- Obtain API key(s) from the Google AI Studio
- You can add your API keys directly in the application
-
Run the application:
python main.py -
Add your Google API key(s) in the application interface.
-
Select SRT files for translation by clicking the "Select SRT File(s)" button or dragging and dropping files into the application window.
-
Choose the source and target languages from the dropdown menus.
-
(Optional) Provide context for the translation in the text box.
-
Click the "Translate Queue" button to start the translation process.
-
Monitor the progress in the status bar and progress indicator.
-
Access translated files in the same directory as the original files, with "output_" prefix.
main.py: Entry point of the applicationgui/main_window.py: Main application window and logicwidgets.py: Custom widget definitionsthemes.py: Theme-related functions
translation/translator.py: Core translation logic using Google's Gemini AI
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the GNU General Public License v3.0 License - see the LICENSE file for details.
- Google Gemini AI for powering the translations
- PyQt6 for the graphical user interface
This tool uses Google's Gemini AI model for translations. While it strives for accuracy, machine translations may not always be perfect. It's recommended to review and edit the translated subtitles for critical content.
