Closed (fixed)
Project:
i18n auto translate
Version:
6.x-2.0
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
14 Jan 2010 at 09:18 UTC
Updated:
13 Apr 2011 at 11:38 UTC
At the moment no filter is being applied to body text, so it is losing things like line breaks when it comes back from Google translated. We need to apply the same filter as the source node used to text returning from Google so it is formatted using the same rules.
Comments
Comment #1
greg.harveyOk, I had a look at this. Problem is twofold:
1. Google strips line breaks. We can get around this by converting the string to HTML before we send it - this is around line 160:
Now the
$tbodyvariable has properly formed *mark-up* in the correct language coming back (so line breaks are there, but in the form of HTML<p>tags. But:2. node.module then filters out the mark-up from Google again on node_save() and we're back to square one, no line breaks in translations. I've written this, which is a nasty but effective workaround for now:
But I hope someone who's a better coder than I can come up with a better way of doing this. The way I see it, we can either:
1. Make it so node_save() does not strip the mark-up from Google (I think this is safest).
2. Make a smarter way of converting the line breaks back than those ugly str_replace repeats.
Comment #2
greg.harveyMoving to new issue queue.
Comment #3
cyberwolf commentedSubscribing.
Comment #4
greg.harveyMarking this as a feature request. The initial bug report has been dealt with. If someone wants to tidy this up, feel free. Otherwise it will stay how it is.
Comment #5
greg.harveyAbout to commit a fix for this today.