google-translation-api

Use google cloud translation api using api key

Use google cloud translation api using api key Question: I made myself a free account so I can experiment a little bit with Google Cloud Translation API. I generated myself a key from Service account, stored it into a json file, loaded it and everything seems to be working fine. Snippet from my code: import …

Total answers: 1

Error using googletrans api in python translate() missing 1 required positional argument: 'self'

Error using googletrans api in python translate() missing 1 required positional argument: 'self' Question: I want to translate some text using googletrans. This is my code: inputtext = "Ich mag Schokolade" srclang = "de" dstlang = "en" translation = Translator.translate(text=inputtext, src=srclang, dest=dstlang) But when I run it, this Error comes up: translate() missing 1 required …

Total answers: 1

Python googletrans module not translating

Python googletrans module not translating Question: I am using the googletrans module to try and translate between languages as per the below. import time from googletrans import Translator translator = Translator() translate_channel = translator.translate(‘Canal La Tele Perú’, src=’es’, dest=’en’) However, this doesn’t seem to be attempting any translation at all. It just returns this: Translated(src=en, …

Total answers: 2

Python google-trans-new translate raises error: JSONDecodeError: Extra data:

Python google-trans-new translate raises error: JSONDecodeError: Extra data: Question: While working on Google translate API, I found out some times google can’t translate anything, while it keeps raising the same exception: Extra data. I have searched on the internet, I found a theory saying I have been blocked by Google translate somehow, or can be …

Total answers: 2

Googletrans Error- The handshake operation timed out

Googletrans Error- The handshake operation timed out Question: When I try to translate text using the googletrans module, I get an error: httpcore._exceptions.ConnectTimeout: _ssl.c:1106: The handshake operation timed out Here’s my code: from tkinter import * from googletrans import Translator , LANGUAGES root = Tk() root.geometry("500×500") def translate(): translator = Translator() translated_text = translator.translate(text=entry.get(), dest=languages_listbox.get(languages_listbox.curselection())) …

Total answers: 1

googletrans stopped working with detecting all languages as English

googletrans stopped working with detecting all languages as English Question: The problem I have here is googletrans API suddenly stopped working, just like this: result = translator.translate(‘祝您新年快乐’, src=’zh-cn’, dest=’en’) result.text Output: ‘祝您新年快乐’ It should return English but just printed the original text. Then I checked what goes wrong. I found that googletrans detect all languages …

Total answers: 1

Free API similar to google translate for python?

Free API similar to google translate for python? Question: I am looking for a free API similar to google translate that can work with my python bot. Is there any similar API available or is there a way to use the google API for free? Asked By: shardul08 || Source Answers: First of all, you …

Total answers: 1

How to tell Googletrans to ignore certain parts?

How to tell Googletrans to ignore certain parts? Question: I would like to use googletrans to make use of the Google translate API. However, there are strings where are variable names in it: User “%(first_name)s %(last_name)s (%(email)s)” has been deleted. If I use this via googletrans I get from googletrans import Translator translator = Translator() …

Total answers: 2

JSONDecodeError: using googletrans module

JSONDecodeError: using googletrans module Question: I’m trying to translate 100,000 English words to Korean by using ‘googletrans’ module. But after some iteration, it raises ‘JSONDecodeError: Expecting value: line 1 column 1 (char 0)’. I tried to figure it out, but solutions on the web didn’t work for me. What I’ve tried is Re-initializing Translator() every …

Total answers: 2

Why is my Python App Engine app using the Translate API getting an error of ImportError: No module named apiclient.discovery?

Why is my Python App Engine app using the Translate API getting an error of ImportError: No module named apiclient.discovery? Question: I got this error in Google App Engine’s Python have used Google Translate API, But I don’t know how to fix, <module> from apiclient.discovery import build ImportError: No module named apiclient.discovery I’ll try to …

Total answers: 20