Google language translator stopped working

Hi All,

I’m using google translator but it stopped working all of a sudden, the error stack I get is:

AnvilWrappedError: ‘NoneType’ object has no attribute ‘group’
at /usr/local/lib/python3.7/site-packages/googletransx/gtoken.py, line 65
called from /usr/local/lib/python3.7/site-packages/googletransx/gtoken.py, line 200
called from /usr/local/lib/python3.7/site-packages/googletransx/client.py, line 76
called from /usr/local/lib/python3.7/site-packages/googletransx/client.py, line 180

the code I use is :

def translate(self):
text = “Ainsi, les salons se parent de bougies et de sapins”
anvil.server.call(‘Translate’,text, ‘fr’)

@anvil.server.callable
def Translate (Text,SourceLanguage):
from googletransx import Translator
translator = Translator()
print( translator.translate(Text, src= SourceLanguage, dest=‘en’))

Many thanks

Soadad

Hi @soadadfarhan,

We’ve updated googletrans to the latest version. If it’s still not working for you, this error is most likely a problem with that library and not with Anvil.

A quick google search turned up a lot of results for this error. This particular github issue may be helpful. There are a few suggestions in that post, which seem to have worked well for others. Good luck!

Many thanks, Brooke, for looking into this issue. It does look like the issue is in the library