ricktwagner / python-google-translator

Automatically exported from code.google.com/p/python-google-translator
0 stars 0 forks source link

APIError is not defined #1

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. python py-googletranslate.py
2. select translate
3. try google translate : y
4. From Language :en
5. To Language   :es
6. Enter Text fo Translate : Hi

What is the expected output? What do you see instead?
Expected translated text
Got:
[*]Enter Text fo Translate :hi how are you
Traceback (most recent call last):
  File "py-googletranslate.py", line 179, in <module>
    class_translate.main()
  File "py-googletranslate.py", line 164, in main
    self.translate_text()
  File "py-googletranslate.py", line 115, in translate_text
    Text1 = translate_language(translate_text, source_lang= from_language ,dest_lang= to_language)
  File "py-googletranslate.py", line 61, in translate_language
    raise APIError(text, response['responseStatus'])
NameError: global name 'APIError' is not defined

What version of the product are you using? On what operating system?
1.0

Please provide any additional information below.

Try google translate ? (y/n)y
[*]From Language :en
[*]To Language   :fr
[*]Enter Text fo Translate :hi how are you
Traceback (most recent call last):
  File "py-googletranslate.py", line 179, in <module>
    class_translate.main()
  File "py-googletranslate.py", line 164, in main
    self.translate_text()
  File "py-googletranslate.py", line 115, in translate_text
    Text1 = translate_language(translate_text, source_lang= from_language ,dest_lang= to_language)
  File "py-googletranslate.py", line 61, in translate_language
    raise APIError(text, response['responseStatus'])
NameError: global name 'APIError' is not defined

Original issue reported on code.google.com by abhinav....@gmail.com on 8 Aug 2012 at 8:07

GoogleCodeExporter commented 8 years ago
The API from google is no longer FREE use..must fee to use the api key from 
google.. so i'm sorry for that..maybe if i have time i will create the new 
method for this stuff..like scraping a page google translate .. ;) thanks for 
the issue reporting

Original comment by romantic...@gmail.com on 22 Aug 2012 at 3:50