OT: How to translate a large document

Paul Mulroney pmulroney at logicaldevelopments.com.au
Wed Jun 23 00:41:28 UTC 2021

Hi Das,

Google translate has an API: see https://cloud.google.com/translate <https://cloud.google.com/translate>

Google says that up to 500,000 characters per month is free.  Over that it's $20 USD per million characters.

It's done as a simple http post command.  Omnis can do these pretty easily - see https://cloud.google.com/translate/docs/basic/quickstart <https://cloud.google.com/translate/docs/basic/quickstart> for the details.  You could create a row with these columns: q,source,target,format, use the JSON object to convert to JSON format and include this in the post command.

If you're feeling game you could use the jsWorker objects in Studio 10 and above to create a node module to do the heavy lifting.  They have sample code for that so you could create the jsWorker, some node.js code and then your Omnis interface could be as simple as "Do myTranslateObject.$translate(text) returns translatedResult".  


> On 23 Jun 2021, at 4:26 am, Das Goravani <goravanis at gmail.com> wrote:
> Hello $all, 
> I have a 2 MB text file full of English that I want to auto translate into other languages.
> I want to use Google Translate if possible, otherwise I may not be interested.
> This is because I have found other auto translators to be second class in output.. really actually unacceptable. 
> But Google does well. 
> I tried today to use their document translator on translate.google.com <http://translate.google.com/> but it only translates a very short section at the beginning of the document and then leaves the English thereafter.  Their FAQ states that the limit is a 1 MB file but they translate way less than 1 MB.  I fed it a 750KB document, less than a MB, and it only translated the first 5% of the document and left the English thereafter. 
> I’m wondering if anybody knows how to translate larger files with Google Translate. Perhaps there is a way that I can’t see because of my lack of education in things such as API’s and the like. I am a mere power computer user.. not very powerful.. and I know Omnis.. but I don’t know any other language at all. 
> If it will only do a little at a time.. I could output my English original in many files 
> Then I would need a way to automate this as it would be hundreds of files based on how little they translated for me today.. or it would be 100 files.. 
> So I would need to automate this:
> Go to translation website address on browser
> Click two buttons one after the other
> Select the right file in the file picker, the next file to be done
> Click the translate button
> Web page appears with translation
> Select all
> Copy
> Switch to TextEdit (we’re on Mac)
> Do a new file
> Paste
> Save as
> Name and save it with correct “next file” name
> Repeat the above until all files are done
> If only there was a good online document translator that was good quality translation and affordable
> Any ideas.. ?
> It seems like Google doesn’t mind doing small amounts.. Omnis is certainly capable of slicing up my original.. yes my original is a bunch of records in Omnis.. text.. astrological readings to be exact.. if only I could communicate with Google right from Omnis and get the return back.. 
> Is there a way to do that.. to send data to Google and have them respond and accept it back into Omnis.. ???  I’m not able to understand the advanced communication abilities that Omnis has. You’d have to tell it to me so that I can understand it. 
> I have the equivalent of an average book.. I have a 2 MB English file that I want to translate into most other main languages or like:
> German, Spanish, Portuguese, Hindi, French, other European languages and if possible Japanese 
> I have a small budget for this project if somebody could help me and needs to be paid for it that’s possible
> Das Goravani
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 

  <https://www.logicaldevelopments.com.au/>	Paul W Mulroney
Logical Developments
Customised Software Solutions
Ph: 08 9458 3889
 	We Don't Do Simple Pty Ltd
trading as
Logical Developments
ACN 161 009 374
 	  <https://www.facebook.com/logicaldevelopmentswa/>   <https://twitter.com/WeDontDoSimple>   <https://www.linkedin.com/company/logicaldevelopments/>   <https://www.youtube.com/channel/UCPldVVgWR05WX3cVrR5WUQw>

More information about the omnisdev-en mailing list