Swift Lingua is a simple Python utility that allows users to translate selected text from the clipboard using a keyboard shortcut. It utilizes the mtranslate library for translation and the keyboard library for handling hotkeys.
- Copy the text you want to translate.
- Press
Ctrl+Alt+Tto initiate the translation.
By default, the translation is from the clipboard text language to English. If you want to change the target language, modify the following line in the code:
translated_text = mt.translate(selected_text, 'en')Replace 'en' with the desired language code (e.g., 'ru' for Russian).
To change the keyboard shortcut, update the following line in the code:
keyboard.add_hotkey('ctrl+alt+t', SwiftLingua)Replace 'ctrl+alt+t' with your preferred keyboard shortcut combination.
-
Make sure you have Python installed (recommended version 3.6 and above).
-
Clone the repository:
git clone https://github.com/Tsimbalist/Swift-Lingua.git
-
Navigate to the project directory:
cd Swift-Lingua -
Install dependencies:
pip install -r requirements.txt
