Google Translate breaks page HTML

1,586 views
Skip to first unread message

Joe Savage

unread,
May 4, 2014, 4:35:37 AM5/4/14
to google-tra...@googlegroups.com
Hey,

So this isn't related to the Translate API, just plain ol' Google Translate, but there's no other place to voice this issue - so here it goes.
Pretty much, when running my site through Google Translate, the HTML is modified such that it breaks pretty much the entirety of my website.
This includes removing block level anchor elements (in this case, those which contain heading elements) which destroys a large number of important layout and navigation elements, merging multiple span elements into one huge span, and breaking SVGs.

Example:


Does anyone know why this might be occurring or how I might go about fixing this? Google Translate working properly is really important for my site as I get a large portion of visitors who can't read English very well.

Thanks,

Joe

Ramesh Vasudevan

unread,
May 24, 2016, 2:05:50 PM5/24/16
to Google Translate API Developer Forum
Hi Joe,

I am facing similar issue when translating HTML content using Google translate API.  When we translate for few languages it works fine but when we translate HTML content for french, german, russian etc it breaks the HTML content.

Did you get any resolution for this issue.   

Any help is appreciated.

Thanks in advance.
regards,
Ramesh V

Dean

unread,
Jul 30, 2019, 1:43:12 PM7/30/19
to Google Cloud Translation API
I've been looking into this as well. It seems as though if you have anything besides text inside an anchor, the anchor ceases to be an anchor and becomes something else.

You may be able to change your front end anchors to avoid this, but it breaking up everything makes it incredibly difficult to meet ADA requirements (Because you can't have two elements with the same link next to one another) by breaking up the image and text into separate anchors.

I'd love to hear if this is being worked on and if there is a resolution in site.

Kan Qiao

unread,
Aug 1, 2019, 2:03:57 PM8/1/19
to Google Cloud Translation API
Hi, Joe:
   Preserving HTML format isn't an easy task. We removed HTML tags for translation, and we need to insert HTML tags back to the translated sentences. Therefore, if the alignment isn't accurate, we do mess up with the format. We will raise the priority and work on improving alignment quality.
Reply all
Reply to author
Forward
0 new messages