When I submit a node to Google Translate, it comes back with the HTML entities escaped and with spaces added in the middle of closing tags. This means that the formatting on it is broken. Here is an example.
Original node:
This is a paragraph.
This is a new paragraph with a link.
I like paragraphs, don't you?
Spanish translation:
<div class="fun-stuff">
<p> Se trata de un párrafo. </ p>
<p> Se trata de un nuevo apartado con <a href="http://www.example.com"> un link </ a>. </ p>
Me gusta <p> párrafos, ¿no? </ p>
<br />
<p> <img src="http://www.urbanminstry.org/files/img-thing.jpg" alt="" /> </ p>
</ div>
Comments
Comment #1
EvanDonovan commentedFor the most part, I was able to resolve this issue by modifying google_translation_postprocess(). See below, where I added a bunch of str_replace to strip out various things that Google Translate was changing or adding in:
The only remaining issue is that sometimes paragraphs are getting broken up into two paragraphs (with the first paragraph being very short and cut-off). I believe that this is happening where the breaks come in for the 500-character limit.
Comment #2
chaps2 commentedI had the same problem and implemented the post process filtering in a wrapper module to avoid altering the google_translation module code.
You could have as many of these as you like.
Andy
p.s. Nice module Darren - thanks.
Comment #3
darren.ferguson commentedThanks guys, have put the fixes into the Development branch for the module http://drupal.org/cvs?commit=256692 is the CVS commit message for this.