A beautiful, real-time translation website for seamless Chinese-English bidirectional translation.
- Real-time Translation: Get instant translations as you type with intelligent debouncing
- Bidirectional Support: Translate between Chinese (Simplified/Traditional) and English in both directions
- Modern UI: Clean, responsive design that works on desktop and mobile devices
- Quick Examples: Pre-loaded example phrases for quick testing
- Copy to Clipboard: Easily copy translations with one click
- Language Swap: Quickly swap source and target languages
- Character Counter: Track the length of your input text
- No Sign-up Required: Start translating immediately without any registration
- Frontend: Pure HTML5, CSS3, and vanilla JavaScript
- Translation APIs:
- Primary: MyMemory Translation API
- Fallback: LibreTranslate API
- Design: Modern gradient background with card-based layout
- Responsive: Mobile-first design that adapts to all screen sizes
- English
- Chinese (Simplified)
- Chinese (Traditional)
- Open the Website: Simply open
index.htmlin any modern web browser - Select Languages: Choose your source and target languages from the dropdowns
- Enter Text: Type or paste text in the source text area
- Get Translation: Translation appears automatically after you stop typing
- Copy Result: Click the "Copy" button to copy the translation to clipboard
# Simply open the file in your browser
open index.html
# or
firefox index.html
# or
chrome index.html# Using Python 3
python -m http.server 8000
# Using Node.js
npx http-server
# Then open http://localhost:8000 in your browser.
├── index.html # Main HTML structure
├── styles.css # All styling and responsive design
├── script.js # Translation logic and interactivity
└── README.md # Documentation
The app uses intelligent debouncing to translate text automatically 500ms after you stop typing, providing a smooth user experience without overwhelming the translation API.
For reliability, the application uses multiple translation services:
- MyMemory API (Primary): Free translation service with good quality
- LibreTranslate (Fallback): Open-source alternative if primary fails
The website is fully responsive and works seamlessly on:
- Desktop computers
- Tablets
- Mobile phones
Works on all modern browsers:
- Chrome/Edge (Chromium-based)
- Firefox
- Safari
- Opera
- No API key required
- Free tier available
- Good translation quality
- Rate limits apply
- Open-source translation API
- Public instance available
- Used as fallback
- May have rate limits on public instance
Edit script.js and modify the translationDelay value:
this.translationDelay = 500; // milliseconds- Add language options in
index.html:
<option value="fr">French</option>- Ensure the translation API supports the language codes
All styles are in styles.css. Customize colors by modifying CSS variables:
:root {
--primary-color: #4a90e2;
--secondary-color: #357abd;
/* ... more variables */
}- Any modern web browser
- (Optional) Local web server for better development experience
- Open
index.htmlin a browser - Try the example phrases
- Test with various Chinese and English texts
- Test on different screen sizes
- Translation quality depends on the external APIs
- Rate limits may apply on free API tiers
- Internet connection required for translation
- Very long texts may have translation delays
Potential features for future versions:
- Support for more languages
- Voice input/output
- Translation history
- Offline mode with local dictionary
- Custom API key support
- Dark mode toggle
- Export translations
This project is open-source and available for free use.
Contributions are welcome! Feel free to:
- Report bugs
- Suggest new features
- Submit pull requests
- Improve documentation
For issues or questions:
- Check the documentation
- Review browser console for errors
- Ensure internet connectivity
- Try a different browser
- Translation powered by MyMemory and LibreTranslate APIs
- Icons and design inspired by modern web standards
- Built with vanilla JavaScript for maximum compatibility
Enjoy seamless Chinese-English translation!