This repository contains a simple Language Translator application built using the googletrans and gtts (Google Text-to-Speech) libraries in Python. The application allows users to translate text from one language to another and convert the translated text into speech.
A simple language translator application built using the Streamlit framework and the Google Translate API.
- Clone the repository:
git clone https://github.com/your-username/language-translator.git
- Install the required dependencies:
pip install -r requirements.txt
- 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 APIs:
- Google Translate API for text translation.
- Google Text-to-Speech (gTTS) API for audio conversion.
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.
To run the tests for this project, use the following command:
pytest tests/
This will run all the tests defined in the tests/ directory.