py-googletranslation icon indicating copy to clipboard operation
py-googletranslation copied to clipboard

language detection doesn't work if the language is english

Open PasaOpasen opened this issue 4 years ago • 3 comments

trans = Translator()
print(trans.detect('Hello boy'))

answer:

Detected(lang=, confidence=0.0)

but it works for Russian (with zero confidence):

print(trans.detect('Привет'))
# Detected(lang=ru, confidence=0.0)

PasaOpasen avatar Feb 18 '21 09:02 PasaOpasen

Found same issue running the example from help page.

>>> from pygoogletranslation import Translator
>>> translator = Translator()
>>> print(translator.detect('காலை வணக்கம்,'))
Detected(lang=ta, confidence=0.0)
>>> print (translator.detect('この文章は日本語で書かれました。'))
Detected(lang=, confidence=0.0)
>>> print(translator.detect('This sentence is written in English.'))
Detected(lang=, confidence=0.0)
>>> print(translator.detect('Tiu frazo estas skribita en Esperanto.'))
Detected(lang=, confidence=0.0)

philf5550 avatar Feb 18 '21 19:02 philf5550

I'm having the same issue as well, any way to fix? @Saravananslb

ArtanisTheOne avatar Mar 05 '21 11:03 ArtanisTheOne

Guuuuuuuuys, let's solve this problem, I've been waiting for a month

PasaOpasen avatar Mar 24 '21 11:03 PasaOpasen