This project provides two scripts for translating English subtitles to Persian using different APIs.
- translate_google_api.js: Uses Google Translate API to translate English subtitles to Persian.
- translate_other_api.js: Uses an alternative API for translation.
- Node.js installed
- API keys for the translation services
-
Clone the repository:
git clone https://github.com/latifii/translate-fa.git cd translate-fa
-
Install the dependencies:
npm install
-
Set up your Google API key in the environment variable:
export GOOGLE_API_KEY='your_google_api_key'
-
Run the script:
node translate_google_api.js input.srt output_google.srt
-
Set up your API key in the environment variable:
export OTHER_API_KEY='your_other_api_key'
-
Run the script:
node translate_other_api.js input.srt output_other.srt
Feel free to submit issues and pull requests for new features and improvements.
This project is licensed under the MIT License.