Python translation using goslate

500 Views Asked by At

i am building a translator that translates user input to french using python. I am however encountering a challenge where my goslate function does not catch user input and translate it. I will appreciate your help.

import goslate
gs = goslate.Goslate()

text = input("please input the word you would like translated:\n")
gs.translate(text,'fr')
1

There are 1 best solutions below

0
On BEST ANSWER

You have to print the output or save it to a variable. E.g.

import goslate
gs = goslate.Goslate()
text = input("please input the word you would like translated:\n")
print(gs.translate(text,'fr'))

Output:

please input the word you would like translated:
Hello
Bonjour

Check the documentation for more details.