Google Translate API for HTML content breaks HTML code.

775 views
Skip to first unread message

Ramesh Vasudevan

unread,
May 26, 2016, 5:47:18 AM5/26/16
to Google Translate API Developer Forum
In our website which support multi languages we have translation for each of the content.  

For specific case of FAQs (which is HTML content) we want to use Google Translate API to dynamically translate HTML content based on the user language.

We created sample content from our website and tried to translate using Google Translate API.  Please find attached screenshot from reference.  Top section is original HTML content in english, but when we generation translated HTML content dynamically it breaks the HTML content as multiple links are created for single link at the bottom.  This failure happens for multiple languages like German(de),French(fr), Russian (ru) etc.

If any one has faced similar issue and able to get resolution or workaround please let us know

Thanks in advance.

Ramesh V


Google Translate API with HTML content.png

Nick

unread,
May 30, 2016, 3:29:28 PM5/30/16
to Google Translate API Developer Forum
Hey Ramesh,

I've just attempted to reproduce this behaviour and couldn't observe it in Chrome. Could you attempt to run the same page in Chrome and send along a screenshot, with the address bar included, of what happens?

Sincerely,

Nick
Cloud Platform Community Support

Ramesh Vasudevan

unread,
Jun 1, 2016, 6:22:29 AM6/1/16
to Google Translate API Developer Forum
Hi Nick,

Please find attached screenshot taken in Google chrome for two language fr and de using same content.

I have also shared the code with you in direct post.

regards,
Ramesh V
In Google Chrome -fr.png
In Google Chrome -de.png

Ramesh Vasudevan

unread,
Jun 9, 2016, 10:12:55 AM6/9/16
to Google Translate API Developer Forum
Hi Nick,

Did you get a chance to look into this issue?  Let me know if you need any additional information.

regards,
Ramesh V

Luis G Rodriguez-Rullan

unread,
Jun 10, 2016, 4:12:20 PM6/10/16
to Google Translate API Developer Forum
I was able to reproduce the issue. It certainly looks like an API issue independent of Javascript.  Some anchor tags are being split into multiple tags and some words in the tag text are being left out of the tag.

Nick

unread,
Jun 10, 2016, 4:38:42 PM6/10/16
to Google Translate API Developer Forum
Thanks Ramesh and Luis,

We've now reproduced this behaviour on our side using the specific code file sent by Ramesh. We're looking into the root cause and will update this thread to let you know anything we find.

Cheers,

Zeehad (Cloud Platform Support)

unread,
Jun 17, 2016, 1:43:27 PM6/17/16
to Google Translate API Developer Forum
Hello Ramesh,

Thank you for bringing this to our attention. Your report has been forwarded to the engineering team and any questions they have will be posted in the related issue tracker. Further status updates will be posted there as well.

I recommend you star the issue in order to receive automatic updates.

Cheers!

Sacha Krief

unread,
Mar 21, 2018, 11:16:02 AM3/21/18
to Google Cloud Translation API
I also have a same problem some html tags who are divided in few tags , and it's problematic .. there is some news about it ??

Jason de Cordoba

unread,
Apr 14, 2018, 11:57:20 AM4/14/18
to Google Cloud Translation API
translate seems to be malforming html

translation results I need to search for and replace with correct html feel free to add your own...

</ Div>
</ b>
</ Strong>
img class = "
 "src =" https
.jpg "alt =" "width ="
"height = "
Reply all
Reply to author
Forward
0 new messages