google-translate-php icon indicating copy to clipboard operation
google-translate-php copied to clipboard

Brazilian Portuguese translation error

Open guitutilo opened this issue 3 years ago • 3 comments

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.

guitutilo avatar Jan 13 '22 20:01 guitutilo

Which version of this package are you using?

Stichoza avatar Jan 13 '22 22:01 Stichoza

In my composer it has:

{
     "require": {
         "stichoza/google-translate-php": "^4.1"
     }
}

guitutilo avatar Jan 14 '22 13:01 guitutilo

Did you see this problem?

guitutilo avatar Jan 20 '22 16:01 guitutilo

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.

Stichoza avatar Nov 28 '22 21:11 Stichoza