Google translator

from googletrans import Translator

txt=‘Hola! Mi nombre es Chris Mattmann’

translator = Translator()
lang=translator.detect(txt)
print(lang)

Output
Detected(lang=en, confidence=1)

I can’t understand why the output is lang=en. My text is polish. Required output is lang=‘pl’

Are you sure the required language is Polish? It looks like Spanish to

me.

“Hola! Mi nombre es Chris Mattmann” is Spanish for "Hello! My name is

Chris Mattman".

Google translate detects it as Spanish.

https://translate.google.com/

So does Cambridge dictionary (powered by Microsoft):

PROMPT-Online also detects it as Spanish:

https://translation2.paralink.com/

DeepL wrongly detects it as German (perhaps fooled by the “mann”

suffix?) and then fails to translate it.

if it is Spanish why the output is en

Howdy Anupam,

are you sure, it was not “es” for espanol?

Cheers, Dominik