Skip to content

A2039/PythonTranslator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Language Translator with Text-to-Speech

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.

Features

  • 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.

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/language-translator.git
    cd language-translator
  2. Install dependencies: Ensure you have Python installed. Install the required libraries using pip:

    pip install pygame pillow googletrans==4.0.0-rc1 gtts
  3. Run the application:

    python Translator.py

Dependencies

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.

How to Use

  1. Input Text:

    • Type or paste text into the Input Box on the left side of the screen.
  2. Select Language:

    • Use the dropdown menu at the top of the screen to select the target language for translation.
  3. 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.
  4. Text-to-Speech:

    • Click the speaker icon in the Input or Output Box to hear the respective text.

Folder Structure

language-translator/
│
├── Translator.py       # Main application script
├── speaker_icon.png    # Icon for the speaker button
├── README.md           # Project README file

Known Issues

  • Translation Errors: Sometimes the googletrans library may encounter API issues. Use the correct library version specified in the installation section.
  • Audio Playback: Ensure that pygame is properly configured for audio playback on your system.

Contributing

Contributions are welcome! Please open an issue or create a pull request with your changes.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgements

  • Googletrans for providing the translation API.
  • gTTS for the text-to-speech functionality.
  • Pygame and Pillow for enhancing the GUI experience.

About

PythonTranslator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages