googletrans

AttributeError: 'str' object has no attribute 'request' – googletrans

AttributeError: 'str' object has no attribute 'request' – googletrans Question: I am trying to use this google translate python library googletrans 3.0.0, which I installed from pypi. I used this code to start with: from googletrans import Translator proxies = {‘http’: ‘http://myproxy.com:8080’, ‘https’: ‘http://myproxy.com:8080’} translator = Translator(proxies=proxies) translator.translate("colour") When I call the translator in the …

Total answers: 2

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

Googletrans not detecting language

Googletrans not detecting language Question: Good morning everyone, I am using googleTrans in my code to translate a list of sentence. It worked perfectly until today. Now when I run it, it perceive everything as English and then not making any translation. One classical code I tried to do a test: from googletrans import Translator …

Total answers: 1

Python – Googletrans for multiple txt files in loop

Python – Googletrans for multiple txt files in loop Question: I’m seeking to run googletrans to translate a series of 300 .txt files in a single folder. I’m struggling to construct a loop that will allow me to run a translation of each file and write the output in new .txt files. Googletrans has a …

Total answers: 1

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

Python (googletrans) – AttributeError: 'NoneType' object has no attribute 'group'

Python (googletrans) – AttributeError: 'NoneType' object has no attribute 'group' Question: Trying to detect language code in Python using googletrans. But it generating ERROR (Refer error block for info). Require solution for the same Code : import googletrans from googletrans import Translator translator = Translator() result = translator.translate(‘Mitä sinä teet’) print(result.src) print(result.dest) print(result.origin) print(result.text) print(result.pronunciation) …

Total answers: 2

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

Googletrans API AttributeError

Googletrans API AttributeError Question: I keep getting "AttributeError: ‘NoneType’ object has no attribute ‘group’ " error even after changing gtoken on googletrans stopped working with error 'NoneType' object has no attribute 'group' but I got __init__() got an unexpected keyword argument ‘client’ error instead here my main.py from fastapi import FastAPI, Request from fastapi.templating import …

Total answers: 3

googletrans doesn't translate the numbers

googletrans doesn't translate the numbers Question: The translator works fine for the phrases and word but doesn’t convert the English numbers into other languages if I did this nep= translator.translate(’12’, dest=’nepali’) print(nep.text) the output will be : 12 but it should be: १२ Asked By: javaNoob || Source Answers: The Hindu-Arabic counting system (google this) …

Total answers: 1

Python googletrans encoding weird chars

Python googletrans encoding weird chars Question: I have an ui which takes german language among other things and translate these in english sentences. # -*- coding: utf-8 -*- from googletrans import Translator def tr(s) translator = Translator() return translator.translate(wordDE,src=’de’,dest=’en’).text Sometimes I get weird characters from the translator. For example: DE: Pascal und PHP sind Programmiersprachen …

Total answers: 1