How to make a google translater(Noob Friendly!)
Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
4 posts
Page 1 of 1
NOTE: THIS IS NOT MY CODE NOTHING HERE IS MINE! BUT WOULD LIKE TO GIVE IT OUT TO SHOW YOU!
+REP WOULD BE APRRECIATED!
FIrst you will have to download the .dll on the bottom, dont worry it is free!
What you will need-
- 2 listboxes
- 2 buttons
- 2 textboxes
-listbox1 will be displaying the language you will be converting
-listbox2 will be displaying the language you will be having the text converted to
-button1 will be the translater button to start the translation process
-button2 will be switch the listboxes languages, like from spanish to english is the original, but when you hit this button it will be english to spanish
-textbox1 will be the place for you typing the language you want to be converted
-textbox2 will be the outcome of your conversion
Now lets get to the coding!
This is for when the form loads!
:mrgreen: :mrgreen: :mrgreen: :mrgreen:
+REP WOULD BE APRRECIATED!
FIrst you will have to download the .dll on the bottom, dont worry it is free!
What you will need-
- 2 listboxes
- 2 buttons
- 2 textboxes
-listbox1 will be displaying the language you will be converting
-listbox2 will be displaying the language you will be having the text converted to
-button1 will be the translater button to start the translation process
-button2 will be switch the listboxes languages, like from spanish to english is the original, but when you hit this button it will be english to spanish
-textbox1 will be the place for you typing the language you want to be converted
-textbox2 will be the outcome of your conversion
Now lets get to the coding!
This is for when the form loads!
Code: Select all
This is for the translater button
Try
For i As Integer = 0 To Google.API.Translate.LanguageUtility.LanguageCollection.Count - 1
Me.ListBox1.Items.Add(Google.API.Translate.LanguageUtility.LanguageCollection(i))
Me.ListBox2.Items.Add(Google.API.Translate.LanguageUtility.LanguageCollection(i))
Next
Me.ListBox1.Items.RemoveAt(0)
Me.ListBox2.Items.RemoveAt(0)
Catch ex As Exception
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Code: Select all
Now finally for the switch button(if you want!)
Try
Me.TextBox2.Text = Google.API.Translate.Translator.Translate(Me.TextBox1.Text, Me.ListBox1.SelectedIndex + 1, Me.ListBox2.SelectedIndex + 1)
Catch ex As Exception
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
Code: Select all
Thanks For Reading Give +REP, For me sharing! Try
Dim X1 As Int16
Dim X2 As Int16
X1 = Me.ListBox1.SelectedIndex
X2 = Me.ListBox2.SelectedIndex
Me.ListBox1.SelectedIndex = X2
Me.ListBox2.SelectedIndex = X1
Catch ex As Exception
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
:mrgreen: :mrgreen: :mrgreen: :mrgreen:
You do not have the required permissions to view the files attached to this post.
Last edited by Proprogrammer on Sat Oct 23, 2010 1:22 pm, edited 1 time in total.
------------------------------------------------------------------------------
Proprogrammer, not just a Programmer.
Proprogrammer, not just a Programmer.
can you give the source cuz its not working for me
source code/project file has been added!
------------------------------------------------------------------------------
Proprogrammer, not just a Programmer.
Proprogrammer, not just a Programmer.
thanks and i already made it b4 project added xD
i think it looks better with combo box
i think it looks better with combo box
4 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023