Task 1 — Language Translation Tool | CodeAlpha Artificial Intelligence Internship
A web-based translation tool that translates text between 29 languages (including 11 Indian languages) using the Google Translate engine via the free deep-translator library — no API key required.
- Source & target language selection, with automatic language detection
- Real-time translation through the Google Translate engine (
deep-translator) - Copy to clipboard button
- Text-to-speech for the translated output (browser SpeechSynthesis API — free and offline)
- Language swap button (also swaps translated text back into the input)
- Character counter with a 5000-character limit and input validation
- Graceful error handling (empty input, network failures, same-language requests)
- Keyboard shortcut:
Ctrl + Enterto translate - Fully responsive UI (works on mobile)
| Layer | Technology |
|---|---|
| Backend | Python, Flask |
| Translation | deep-translator (Google Translate engine) |
| Frontend | HTML, CSS, vanilla JavaScript |
| TTS | Web SpeechSynthesis API |
git clone https://github.com/Alexy-ak06/CodeAlpha_LanguageTranslator.git
cd CodeAlpha_LanguageTranslator
pip install -r requirements.txt
python app.pyOpen http://127.0.0.1:5000 in your browser.
Note: translation requires an internet connection (requests go to the Google Translate web engine).
- The user enters text and picks source/target languages.
- The frontend sends a JSON
POST /translaterequest to the Flask backend. - Flask calls
GoogleTranslator(source, target).translate(text)fromdeep-translator. - The translated text is returned as JSON and rendered instantly — with copy and listen actions.
Built by Ayush for the CodeAlpha AI Internship — July 2026.