nidhaloff / deep-translator

A flexible free and unlimited python tool to translate between different languages in a simple way using multiple translators.
https://deep-translator.readthedocs.io/en/latest/?badge=latest
Apache License 2.0
1.61k stars 186 forks source link

get_supported_languages only working for GoogleTranslator #254

Open Khyretos opened 10 months ago

Khyretos commented 10 months ago

Description

I want to know which languages are supported in each service, i expect every service to return the languages they support.

What I Did

from deep_translator import (GoogleTranslator,
                             ChatGptTranslator,
                             MicrosoftTranslator,
                             PonsTranslator,
                             LingueeTranslator,
                             MyMemoryTranslator,
                             YandexTranslator,
                             PapagoTranslator,
                             DeeplTranslator,
                             QcriTranslator,
                             single_detection,
                             batch_detection)

print("GoogleTranslator:")
google_list  = GoogleTranslator().get_supported_languages()
print(google_list)

print("ChatGptTranslator:")
google_list  = ChatGptTranslator().get_supported_languages()
print(google_list)

print("MyMemoryTranslator:")
mymemory_list  = MyMemoryTranslator().get_supported_languages()
print(mymemory_list)

print("MicrosoftTranslator:")
microsoft_list =  MicrosoftTranslator().get_supported_languages()
print(microsoft_list)

print("PonsTranslator:")
pons_list = PonsTranslator().get_supported_languages()
print(pons_list)

print("LingueeTranslator:")
linguee_list = LingueeTranslator().get_supported_languages()
print(linguee_list)

print("YandexTranslator:")
yandex_list = YandexTranslator().get_supported_languages()
print(yandex_list)

print("PapagoTranslator:")
papago_list = PapagoTranslator().get_supported_languages()
print(papago_list)

print("DeeplTranslator:")
deepl_list = DeeplTranslator().get_supported_languages()
print(deepl_list)

print("QcriTranslator:")
qcri_list = QcriTranslator().get_supported_languages()
print(qcri_list)

it crashes on everyone except google.

Did you make it general where you just need to send in the name of the language and deep_translator maps it automatically for each service?