Problem with Google.translate

71 views
Skip to first unread message

Bernard Enjolras

unread,
Nov 29, 2012, 8:38:12 AM11/29/12
to pattern-f...@googlegroups.com
Hi, 

I tried to use pattern.web Google translate without success. 

>>> from pattern.web import Google
>> g=Google(license='[here I put my key obatined from Google api, which I tested using Google api python sample])
>>> g.translate('bonjour', input='fr', output='en')

Traceback (most recent call last):
  File "<pyshell#29>", line 1, in <module>
    g.translate('bonjour', input='fr', output='en')
  File "/Library/Python/2.7/site-packages/pattern/web/__init__.py", line 987, in translate
    raise HTTP401Authentication, "Google translate API is a paid service"
HTTP401Authentication: Google translate API is a paid service


I can't figure out what is wrong and would appreciate some help. 

Thanks a lot.

Bernard 

Tom De Smedt

unread,
Dec 7, 2012, 4:05:36 PM12/7/12
to pattern-f...@googlegroups.com
Hi Bernard,

Sorry for the late reply. 
My first guess would be: did you activate Google Translate in the API console?

The console is here:

You can click on "Services" and set the "Translate API" to "on". That should do the trick.

Best,
Tom

Tom De Smedt

unread,
Feb 26, 2013, 7:11:59 PM2/26/13
to pattern-f...@googlegroups.com
We found a bug in Google.translate(), which is why it is not working for you. I'll update the latest revision on GitHub.
T
Reply all
Reply to author
Forward
0 new messages