A simple and clean language translation web app built with Python and Streamlit, powered by the MyMemory Translation API.
- Translate text between 20+ languages
- Text-to-speech playback of translated text
- Download translation as a
.txtfile - Built-in copy button on translated output
- Input sanitization and rate limiting for security
- Clean and minimal UI powered by Streamlit
English, Hindi, French, Spanish, German, Japanese, Chinese, Arabic, Portuguese, Russian, Korean, Italian, Telugu, Tamil, Bengali, Dutch, Polish, Swedish, Turkish, Ukrainian
language-translator/
├── app.py # Main Streamlit application
├── requirements.txt # Python dependencies
├── .gitignore # Files excluded from Git
└── README.md # Project documentation
- Python 3.8 or above
- pip
- VS Code (recommended)
- Internet connection (for translation API and text-to-speech)
git clone https://github.com/your-username/language-translator.git
cd language-translatorWindows:
python -m venv venv
venv\Scripts\activateMac/Linux:
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txtstreamlit run app.pyThe app will open automatically in your browser at http://localhost:8501
- Select the source language (language you are translating from)
- Select the target language (language you want to translate to)
- Type or paste your text in the input box
- Click the Translate button
- View the translated text — use the copy icon to copy it
- Optionally download the translation or listen to it using the audio player
| Package | Purpose |
|---|---|
streamlit |
Web UI framework |
requests |
Calling the MyMemory API |
gtts |
Text-to-speech audio generation |
Install all at once:
pip install streamlit requests gttsThis app uses the MyMemory Translation API — a free, no-key-required translation service.
- API endpoint:
https://api.mymemory.translated.net/get - Free limit: ~1000 words/day per IP address
- No API key or account needed
- Docs: mymemory.translated.net
⚠️ Text entered is sent to MyMemory's servers for translation. Do not translate sensitive or personal information.
- Input sanitization — blocks special characters like
< > { } \ - Rate limiting — enforces a 3-second cooldown between requests
- No API keys — no credentials stored or required
- Error handling — clear messages for timeouts, API failures, and invalid input
You can deploy this app for free on Streamlit Community Cloud:
- Push your project to GitHub
- Go to share.streamlit.io
- Connect your GitHub repository
- Click Deploy
Your app will be live at a public URL within minutes.
- MyMemory free tier allows approximately 1000 words/day per IP
- Text-to-speech may not be available for all languages
- Translation quality depends on the MyMemory API
This project was built as part of a student internship task at CodeAlpha.