1

The googletrans module in Python is unstable and closes connections for large texts (ie: above 1000 lines). I want to translate large amounts of texts stored in multiple files. The speed doesn't matter much for me. I already tried google-API-translate, it also can't manage bulk requests Can anyone suggest an alternative module?

1

if you write python script to translate each file one by one (or divide large file into smaller files). If you can't do it in one go, do it in multiple smaller, and the bulk request....... Just translate small file then close connection then open a new one, as you have said earlier, you don't mind the speed.....

Let's say you set a limit of 750 lines if the total lines of what you need to translate surpass this, you put the exceed in another file, then verify the same condition and so on until you got nothing but files with less or equal to 750 lines.

Then you write a script which automate all: the basic idea is that you open a connection, you translate the first file, then you save the translation, afterward you close the connection. you open a new connection with a new identity and repeat until everything is translate. you just have to write something to do this automatically, so you don't need another program nor api to manage bulk request

Since I havn't yet try the module nor the api, I apologize in advance if you think I make no sense, hope that it helps

  • 1
    Congrats....I just did that...and it worked perfectly...I divided the files into smaller parts and loaded them separately like 30 lines per request and it WORKED...I'm so happy....thanks for the simple logic for my dumb brain...and amazingly the speed was like 10,000 lines some 20seconds approx...hell faster than I expected...thanks buddy – THE EPIC GUY Jun 5 at 17:17
  • You’re very welcome, and congrats to you for solving the problem, glad to be of help :) – New1997 Jun 5 at 17:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.