Saravananslb / py-googletranslation

pygoogletranslation: Free and Unlimited Google translate API for Python. Translates totally free of charge.
https://saravananslb.github.io/py-googletranslation/
MIT License
156 stars 40 forks source link

language detection doesn't work if the language is english #18

Open PasaOpasen opened 3 years ago

PasaOpasen commented 3 years ago
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)
philf5550 commented 3 years ago

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)
ArtanisTheOne commented 3 years ago

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

PasaOpasen commented 3 years ago

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