Solved

How do I keep text formatting when using Google Translate?

Posted on 2013-11-12
5
1,451 Views
Last Modified: 2013-11-12
Hi,

I am new to using Google Translate and I have found that it strips breaks <br /> when text is translated. Is there a way I can stop this from happening so that the text can retain its original formatting.

Example:
http://www.educationpages.co.nz/55-Intermediate/Murrays-Bay-Intermediate-11263/View-details.html
0
Comment
Question by:jwleys
  • 3
  • 2
5 Comments
 
LVL 82

Expert Comment

by:leakim971
Comment Utility
no, I see lot of people complaining about that and there's no solution as there's no such setting to apply :
https://translate.google.com/manager/website/settings
0
 

Author Comment

by:jwleys
Comment Utility
I wonder if anything can be applied at an API level or if anyone has any hacks that work including supplementing <br /> for <p> etc ...

Thanks for your input though it is much appreciated.
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
Comment Utility
IMHO it's normal for Google to remove linebreak before translating a text because sentence will not have the same length.

English (not the br at the end)
be or not to be be or not to be be or not to be<br />
be or not to be be or not to be be or not to be<br />
be or not to be be or not to be be or not to be<br />
be or not to be be or not to be be or not to be<br />

French :
être ou ne pas être être ou ne pas être être ou ne pas être<br />
être ou ne pas être être ou ne pas être être ou ne pas être<br />
être ou ne pas être être ou ne pas être être ou ne pas être<br />
être ou ne pas être être ou ne pas être être ou ne pas être<br />
être ou ne pas être être ou ne pas être être ou ne pas être<br />

I don't know any hack. Did you try to replace <br /> by a <div></div>
0
 

Author Comment

by:jwleys
Comment Utility
Good suggestion, seems to work and diverts the problem to being a data issue rather than a programming issue which I like :)
0
 

Author Closing Comment

by:jwleys
Comment Utility
Thanks for your help
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
date format angularjs2 16 36
DNS, website, godaddy 6 41
Change properties of a dialog box 1 19
Cross domain request in Javescript 9 26
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now