A modern, responsive web application that provides real-time translation across multiple languages, powered by the MyMemory Translation API.
- Real-time Translation: Translate text between numerous languages with automatic translation as you type
- Text-to-Speech: Listen to both original text and translations with built-in speech synthesis
- Copy to Clipboard: Easily copy texts with visual confirmation
- Language Exchange: Quickly swap between source and target languages
- Recent Translations: Access your translation history for quick reuse
- Responsive Design: Works seamlessly across desktop, tablet, and mobile devices
- Next.js: React framework for building the application
- TypeScript: For type-safe code
- Tailwind CSS: For styling and responsive design
- Lucide React: For modern, customizable icons
- MyMemory Translation API: For powering the translation functionality
- Web Speech API: For text-to-speech capabilities
- Node.js (version 14.x or later)
- npm or yarn package manager
-
Clone the repository:
git clone https://github.com/yourusername/language-translator-app.git cd language-translator-app
-
Install dependencies:
npm install # or yarn install
-
Start the development server:
npm run dev # or yarn dev
-
Open your browser and navigate to
http://localhost:3000
-
Translation:
- Enter text in the left text area
- Select source and target languages from the dropdown menus
- View the translation in the right text area
-
Additional Features:
- Click the speaker icon to hear the text spoken
- Click the copy icon to copy text to clipboard
- Use the exchange button to swap languages
- Click on any recent translation to load it into the input field
language-translator-app/
├── app/
│ └── page.tsx # Main application component
├── components/
│ └── countries.ts # List of available languages
├── public/
│ └── ... # Static assets
└── ... # Configuration files
Edit the components/countries.ts
file to add or remove language options:
const countries = {
"en-GB": "English",
"fr-FR": "French",
// Add more languages here
};
export default countries;
The application uses Tailwind CSS for styling. You can customize the appearance by modifying the class names in the components or by updating your Tailwind configuration.
This application uses the MyMemory Translation API. The free tier has certain limitations:
- 5,000 characters per day for anonymous usage
- No API key required for basic usage
- For higher volumes, consider registering for a MyMemory API key
The application works best in modern browsers that support:
- Web Speech API for text-to-speech functionality
- Clipboard API for copy functionality
- CSS Grid and Flexbox for layout
- MyMemory Translation API for providing the translation service
- Lucide Icons for the beautiful icons
- Tailwind CSS for the utility-first CSS framework
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request