+92 332 4229 857 99ProjectIdeas@Gmail.com

English To All Language Translator (Vb.net)


The following code shows you translating a text from english to all langauges and vice versa. For this you have to download google translate api of .net here is the link http://code.google.com/p/google-api-for-dotnet/downloads/list . Now in your project add its reference and use it. Translate function accept three parameters i.e., Translate("A text to translate", fromLanguage, toLanguage)



Imports Google.API.Translate

Private Sub btnTranslate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTranslate.Click


Dim trans As New TranslateClient("")

 
toTextBox.Text = trans.Translate(fromTextBox.Text, "en", "ar") 'english to arabic

toTextBox.Text = trans.Translate(fromTextBox.Text, "en", "ur") 'english to urdu

toTextBox.Text = trans.Translate(fromTextBox.Text, "en", "fa") 'english to persian

End Sub


0 comments: