A Python-based GUI application for language translation and text-to-speech functionality, developed using Tkinter. This app allows users to input text, translate it into a chosen language, and hear the translated text using a text-to-speech feature.
- Text Translation: Supports translation between multiple languages including English, Hindi, Spanish, German, and French.
- Text-to-Speech: Converts the translated text into speech, played directly within the application.
- Responsive GUI: Fullscreen application with equal-sized input and output text boxes.
- Scrollbars: Input and output boxes are equipped with scrollbars for handling large text inputs and outputs.
-
Clone the repository:
git clone https://github.com/your-username/language-translator.git cd language-translator -
Install dependencies: Ensure you have Python installed. Install the required libraries using
pip:pip install pygame pillow googletrans==4.0.0-rc1 gtts
-
Run the application:
python Translator.py
The following libraries are required to run this application:
- Tkinter: Built-in GUI toolkit for Python.
- Googletrans: For language translation.
- gTTS: For text-to-speech conversion.
- Pillow: For image processing.
- Pygame: For playing audio.
-
Input Text:
- Type or paste text into the Input Box on the left side of the screen.
-
Select Language:
- Use the dropdown menu at the top of the screen to select the target language for translation.
-
Translate:
- Click the "Translate" button to translate the text into the selected language. The translated text will appear in the Output Box on the right side.
-
Text-to-Speech:
- Click the speaker icon in the Input or Output Box to hear the respective text.
language-translator/
│
├── Translator.py # Main application script
├── speaker_icon.png # Icon for the speaker button
├── README.md # Project README file
- Translation Errors: Sometimes the
googletranslibrary may encounter API issues. Use the correct library version specified in the installation section. - Audio Playback: Ensure that
pygameis properly configured for audio playback on your system.
Contributions are welcome! Please open an issue or create a pull request with your changes.
This project is licensed under the MIT License. See the LICENSE file for details.
- Googletrans for providing the translation API.
- gTTS for the text-to-speech functionality.
- Pygame and Pillow for enhancing the GUI experience.