Solved

How do I keep text formatting when using Google Translate?

Posted on 2013-11-12
5
1,639 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 39643465
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
ID: 39643503
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
ID: 39643545
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
ID: 39643626
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
ID: 39643633
Thanks for your help
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
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)

734 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