Rachit95 / google-api-for-dotnet

Automatically exported from code.google.com/p/google-api-for-dotnet
0 stars 0 forks source link

Translate API removes NewLines from the results #29

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

TranslateClient client = new TranslateClient("new-line-bug");
string source = string.Format("{1}{0}{2}{0}{3}{0}{4}", Environment.NewLine, 
"en", "es");
string result = client.Translate(source, "en", "es");
Console.WriteLine("source={0}", source);
Console.WriteLine("result={1}", result);

What is the expected output? What do you see instead?

I expected to see the output to keep the newlines like the 
http://translate.google.com/translate_t?js=y&prev=_t&hl=en&ie=UTF-8&text=this+is
+a+test&sl=zh-
CN&tl=en&history_state0=submit#en|fr|One%0ATwo%0AThree%0A

The result shown is "Uno Dos Tres" where the newlines have been removed

What version of the product are you using? On what operating system?
I am using 0.3.  Vista 64 bit.

Please provide any additional information below.

Original issue reported on code.google.com by JosephPl...@gmail.com on 27 Oct 2009 at 11:05

GoogleCodeExporter commented 8 years ago
Yes, Google do it that way. Maybe they will change one day.
One solution is replace new line by "<br>" and translate it as html format, than
replace back.

Original comment by iron9li...@gmail.com on 28 Oct 2009 at 2:44