Translation API Unable to process XLSX

141 views
Skip to first unread message

Sanket Saini

unread,
Dec 10, 2021, 10:50:06 AM12/10/21
to Google Cloud Translation API
Hello,

I've been trying to parse the file "Document.xlsx" using the Google Translation API. My file is stored on a GCP Bucket and I'm using this method to call the API. However, it keeps throwing the below attached error. 

error_screenshot.png

I further trimmed out all the new line characters and html attributes ("Document_updated.xlsx"), but still the same error keeps popping up. 

Both of these excel files however are being correctly translated by using the Web version of google translate here

Are there some extra steps that I should be following when translating file using the API? 

Thanks!
Document_updated.xlsx
Document.xlsx

Music Li

unread,
Dec 10, 2021, 12:09:03 PM12/10/21
to Google Cloud Translation API
Hi,

Thanks for reporting this issue and providing the file! This is a known issue on our side and we are working on a fix. 

Best,
Music

Sanket Saini

unread,
Dec 13, 2021, 3:54:17 AM12/13/21
to Google Cloud Translation API
Hello Music, 

Thanks for the reply! We are going to start receiving more files like these to be processed by our production jobs in coming weeks. Is there an ETA on by when this issue is fixed? 
If it's going to take a while, is there some way I can translate this file by either of the below methods: 
  1. Being able to call the google translate web API to translate the file. 
  2. If you can provide me a list of characters that are causing this to fail, I can try to trim them out and try translating again. Right now as seen in the above screenshot, the error shows issue is with \u003e character, i.e. the greater than symbol (>). However, the file Document_updated.xlsx doesn't have any greater than arrows in it. 
Please let me know if there's some other approach that can be followed here. 

Thanks,
Sanket.

Rodrigo Jara

unread,
Dec 17, 2021, 5:34:45 AM12/17/21
to Google Cloud Translation API
Hi,

I was able to translate the document successfully using this method, and calling the API from command line as below (having the request body in a `request.json` file, as explained in the method's doc):
```
curl -X POST \
-H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
```
Bear in mind that you should set authentication first, and for a guide on language codes (to fill the request body) take a look at this documentation on language support.

Sanket Saini

unread,
Dec 17, 2021, 6:18:25 AM12/17/21
to Google Cloud Translation API
Hello Rodrigo,

Yes it seems like the issue has been resolved now. 

Thanks, 
Sanket.

Reply all
Reply to author
Forward
0 new messages