hi,
In my project there is a situation that i have two textbox .if i enter 1st textbox english then dynamically in second text box it has to come in arabic
language.i already use google translator api but the translation is happening in a single textbox.i want translated text will appear in 2nd textbox.
Thanks in Advance
nirjharini pradhanPosted Feb 3, 2016, 1:52 AM
nirjharini pradhanPosted Feb 1, 2016, 9:07 AM
Thanks in Advance
Shubham KumarPosted Feb 1, 2016, 4:18 AM
{
System.Text.UTF8Encoding utf8Encoder = new UTF8Encoding();
System.Text.Decoder utf8Decoder = utf8Encoder.GetDecoder();
System.Text.StringBuilder convertedChars = new System.Text.StringBuilder();
char[] convertedChar = new char[1];
byte[] bytes = new byte[] { 217, 160 };
char[] inputCharArray = input.ToCharArray();
foreach (char c in inputCharArray)
{
if (char.IsDigit(c))
{
bytes[1] = Convert.ToByte(160 + char.GetNumericValue(c));
utf8Decoder.GetChars(bytes, 0, 2, convertedChar, 0);
convertedChars.Append(convertedChar[0]);
}
else
{
convertedChars.Append(c);
}
}
return convertedChars.ToString();
}
nirjharini pradhanPosted Feb 1, 2016, 3:56 AM
Shubham KumarPosted Feb 1, 2016, 3:48 AM
Hi,
You may want to have a look at following links: