Stichoza / google-translate-php

🔤 Free Google Translate API PHP Package. Translates totally free of charge.
MIT License
1.79k stars 380 forks source link

Brazilian Portuguese translation error #179

Closed guitutilo closed 1 year ago

guitutilo commented 2 years ago

There is a difference in the Brazilian translation. I'm using the following encoding:

$tr = new GoogleTranslate(); $tr->setSource('en'); $tr->setTarget('pt-BR'); echo $tr->translate('Like a platypus. Only you mumbled in your sleep.');

Wrong result: 'Como um ornitorrinco. Só você murmurou em seu sono.' Correct result: 'Como um ornitorrinco. Só você murmurou enquanto dormia.'

Image from Google translator: https://i.ibb.co/hcPb06T/Capturar.png

I believe that I am not picking up Brazilian Portuguese, but from Portugal.

Stichoza commented 2 years ago

Which version of this package are you using?

guitutilo commented 2 years ago

In my composer it has:

{
     "require": {
         "stichoza/google-translate-php": "^4.1"
     }
}
guitutilo commented 2 years ago

Did you see this problem?

Stichoza commented 1 year ago

pt-BR is not in the list of supported languages. You can see in your screenshot that browsers address bar has pt instead of pt-BR.

I don't know what has changed on Google's side but the text you provided is translated with "em seu sono" on Google Translate web app too:

image

I'll reopen this issue if you can replicate this problem. Let me know if the translation by this package will be different from Google Translate web app.