A high-performance, modern language translation web application built with Streamlit. This app supports over 100+ global languages and converts translated text into speech instantly.
- Clone the repository:
https://github.com/onkar0127/Language-translator-using-python.git
- Install the required dependencies:
pip install streamlit deep-translator gTTS
- Run the application:
streamlit run translator.py
-
The application will open in your default web browser.
-
Enter the text you want to translate in the "Input" section.
-
Select the target language from the dropdown menu.
-
Click the "Translate" button to see the translated text in the "Translation" section.
-
If the translation is successful, an audio player will be displayed below the translated text, allowing you to listen to the translation.
-
You can download the audio translation by clicking the "Download Audio" button.
The application uses the following open-source libraries to interface with Google's translation and speech engines without requiring a paid API key:
Deep-Translator: Used for the core translation logic. It replaces the older googletrans library to provide better stability and compatibility with Python 3.13+. It handles over 100+ languages dynamically.
gTTS (Google Text-to-Speech): Converts the translated string into a natural-sounding voice. The audio is processed in-memory using BytesIO for faster performance and privacy.
Streamlit: Powers the web interface and handles the Session State, ensuring that text and audio stay synchronized when you switch languages.
If you would like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them.
- Push your changes to your forked repository.
- Submit a pull request to the main repository.
This project is licensed under the MIT License.