A real-time multilingual translation web application powered by Hugging Face's Transformers.js and React. This project brings machine learning capabilities directly to your browser without requiring a backend server.
- Real-time Translation: Instant translation as you type
- 200+ Languages Support: Comprehensive coverage of world languages
- Browser-based ML: Runs entirely in the browser using WebAssembly
- Streaming Output: Progressive translation display
- Responsive Design: Works seamlessly on desktop and mobile devices
- No Backend Required: Complete client-side implementation
This project uses the Xenova/nllb-200-distilled-600M
model, which is:
- A distilled version of Meta's No Language Left Behind (NLLB) model
- Capable of translating between 200+ languages
- Optimized for browser-based execution
- Provides high-quality translations with reduced model size
- Frontend: React
- ML Framework: Transformers.js
- UI Components: Lucide React for icons
- Styling: Tailwind CSS
- Build Tool: Vite
- Worker: Web Workers for non-blocking ML operations
1- Clone the repository:
git clone https://github.com/KhaledSaeed18/multilingual-translation-Transformers.js.git
2- Install dependencies:
npm install
3- Start the development server:
npm run dev
4- Open your browser and navigate to http://localhost:5173
- The application loads the ML model in a Web Worker to prevent UI blocking
- First-time usage downloads and caches the model (~300MB)
- Subsequent uses retrieve the model from cache
- Translations are processed entirely client-side
- Results stream back to the UI in real-time
The application supports 200+ languages including:
- Major languages (English, Spanish, French, etc.)
- Regional dialects
- Low-resource languages
- Various script variations (Latin, Cyrillic, etc.)