shibiny p

shibiny p

  • NA
  • 24
  • 7.1k

Convertion to Malayalam

Jul 6 2015 5:54 AM
 Iwant to convert a english name to malayalam in a buttonclick event and display on textbox (using C# .net wndows Application)
//I am using the code for converting the name "Nimmi" to malayalam using this but out put is in encoding form

.How to solve this
public string TranslateTextNew(string input, string languagePair)
{
string url = String.Format("http://www.google.com/translate_t?hl=en&ie=UTF8&text={0}&langpair={1}", input, languagePair);
WebClient webClient = new WebClient();
webClient.Encoding = System.Text.Encoding.UTF8;
string result = webClient.DownloadString(url);
result = result.Substring(result.IndexOf("<span title=\"") + "<span title=\"".Length);
result = result.Substring(result.IndexOf(">") + 1);
result = result.Substring(0, result.IndexOf("</span>"));
return result.Trim();
}
private void button3_Click(object sender, EventArgs e)
{
translation obj = new translation();
string rs = obj.TranslateTextNew("nimmi", "en|ml");
textBox1.Text = rs;
}