SRTMagic is a project designed to translate subtitle (SRT) files from English to Arabic. It consists of a frontend interface and a backend server that work together to handle file uploads, process translations, and provide feedback on translation progress.
- backend: Contains the server code for handling translation requests. It uses the
google-translate-api-x
library for translation andmulter
for file handling. - frontend: Contains the React application that allows users to upload files, track translation progress, and receive the translated file.
- Node.js (recommended version: >= 14.x)
- npm (comes with Node.js)
-
Clone the repository:
git clone https://github.com/yourusername/SRTMagic.git cd SRTMagic
-
Install dependencies:
- For the backend:
cd backend npm install
- For the frontend:
cd ../frontend npm install
- For the backend:
-
Start the backend server:
cd backend node index.js
The backend server will start at
http://localhost:3001
. -
Start the frontend server:
cd ../frontend npm start
The frontend application will be available at
http://localhost:3000
.
- Open the frontend application in your browser at
http://localhost:3000
. - Upload an SRT file for translation.
- The application will display real-time translation progress.
- Once complete, you’ll receive a message with the location of the translated file.
- File Upload: Allows users to upload SRT files for translation.
- Real-Time Progress: Uses Server-Sent Events (SSE) to show translation progress.
- Retry Logic: Retries translation up to 5 times in case of network errors.
- Duplicate Check: Ensures that a file is not re-translated if an Arabic version already exists.
If the translation fails, the application will display an error message. Check that the backend server is running and reachable from the frontend.
- Node.js and Express (backend)
- React (frontend)
- multer for file uploads
- google-translate-api-x for translation
- Server-Sent Events (SSE) for real-time progress updates
This project is open-source and available under the MIT License.