Translate List of Sentences In PythonLearning Streamlined with VGDec 25, 20200 min readUpdated: Dec 1, 2024
The program to translate in different languages is giving error. Pip installed successfuly. every char matched with sample prg.
Traceback (most recent call last):
File "E:\XII_2020\MiscPrograms\TranslateEng2Hindi.py", line 13, in <module>
translations = translator.translate(['what is your Name', 'how old are you', 'How are you'], dest='hi')
File "C:\Users\AppData\Local\Programs\Python\Python38-32\lib\site-packages\googletrans\client.py", line 177, in translate
translated = self.translate(item, dest=dest, src=src, **kwargs)
File "C:\Users\AppData\Local\Programs\Python\Python38-32\lib\site-packages\googletrans\client.py", line 182, in translate
data = self._translate(text, dest, src, kwargs)
File "C:\Users\AppData\Local\Programs\Python\Python38-32\lib\site-packages\googletrans\client.py", line 78, in _translate
token = self.token_acquirer.do(text)
File "C:\Users\AppData\Local\Programs\Python\Python38-32\lib\site-packages\googletrans\gtoken.py", line 194, in do
self._update()
File "C:\Users\AppData\Local\Programs\Python\Python38-32\lib\site-packages\googletrans\gtoken.py", line 62, in _update
code = self.RE_TKK.search(r.text).group(1).replace('var ', '')
AttributeError: 'NoneType' object has no attribute 'group'