A beautiful and responsive web application built with Python and Flask that translates text between multiple languages, with a special focus on 11 Indian languages. It uses the
deep-translatorlibrary to interface with the Google Translate API. Key features include a modern UI, specialized fonts for Indic scripts, and client-side text-to-speech functionality using the Web Speech API.
- ๐ Multi-language Support: 11 Indian languages supported
- ๐ Text-to-Speech: Listen to translated text in the correct accent
- ๐จ Beautiful UI: Modern responsive design with animations and gradients
- ๐๏ธ Optimized Fonts: Noto Sans for crisp Indic script rendering
- โก Real-time Translation: Powered by Google Translate via deep-translator
- ๐งญ Interactive Controls: Swap, copy, clear, and listen functionalities
- ๐ Font Testing: Built-in Kannada font rendering tester
- ๐ฑ Responsive Design: Works great on mobile and desktop
- ๐ง Error Handling: Friendly user messages and validations
| Layer | Technology |
|---|---|
| Backend | Python, Flask |
| Frontend | HTML5, CSS3, JavaScript (ES6+) |
| Fonts | Google Fonts (Noto Sans) |
| Translation | deep-translator, Google Translate API |
| TTS | Web Speech API (client-side) |
Gen AI/
โโโ app.py
โโโ requirement.txt
โโโ templates/
โโโ index.html
- Python 3.7+
pippackage manager
# Clone the repo
git clone <repo-url>
cd Gen\ AI/
# Install dependencies
pip install -r requirement.txtpython app.pyVisit: http://localhost:5000
| Method | Endpoint | Description |
|---|---|---|
| GET | / |
Renders the translator interface |
| POST | /translate |
Handles translation request |
| GET | /test_kannada |
Returns sample Kannada text |
{
"text": "Hello",
"source_lang": "English",
"target_lang": "Hindi"
}{
"success": true,
"translated_text": "เคจเคฎเคธเฅเคคเฅ",
"target_lang_speech_code": "hi-IN"
}| Language | Code | Speech Code |
|---|---|---|
| English | en | en-US |
| Hindi | hi | hi-IN |
| Kannada | kn | kn-IN |
| Tamil | ta | ta-IN |
| Telugu | te | te-IN |
| Bengali | bn | bn-IN |
| Marathi | mr | mr-IN |
| Gujarati | gu | gu-IN |
| Malayalam | ml | ml-IN |
| Punjabi | pa | pa-IN |
| Urdu | ur | ur-IN |
| Browser | Logo | Version |
|---|---|---|
| Chrome | 70+ | |
| Firefox | 65+ | |
| Safari | 12+ | |
| Edge | 79+ |
๐ Note: Text-to-speech support depends on each browser's Web Speech API implementation.
python app.pypip install gunicorn
gunicorn -w 4 -b 0.0.0.0:5000 app:app- Fork this repository
- Create a new feature branch (
git checkout -b feature-name) - Make your changes and commit (
git commit -am 'Add new feature') - Push to the branch (
git push origin feature-name) - Open a Pull Request
This project is licensed under the MIT License.
- Translation accuracy depends on Google Translate API.
- Font rendering may vary across operating systems.
- TTS voices depend on the browser's capabilities.
- Add text-to-speech functionality
- Add more Indian and international languages
- Translation history with export option
- File upload for document translation
- User authentication for personal preferences
- Offline translation using local models
- Confidence scores for translations
Made with โค๏ธ for multilingual communication