Skip to content

Same results for pt and pt-PT #215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
tamslinn opened this issue Feb 4, 2025 · 2 comments
Open

Same results for pt and pt-PT #215

tamslinn opened this issue Feb 4, 2025 · 2 comments

Comments

@tamslinn
Copy link

tamslinn commented Feb 4, 2025

Hi, I am trying to generate translations for both Portuguese (Brazil) and Portuguese (Portugal).

I checked the output of the supported languages command and it lists pt and pt-PT.

However both targets seem to produce the same output. Example below:

> $tr->setTarget('pt');
> echo $tr->translate('The photo that you recently uploaded');
A foto que você enviou recentemente⏎
> $tr->setTarget('pt-PT');
> echo $tr->translate('The photo that you recently uploaded');
A foto que você enviou recentemente⏎

The direct output from the google translate web interface for pt-PT is different to pt - it looks like using pt-PT in this library is just using reverting to pt

As pt-PT is listed in the supported languages, is this correct or is there something I need to do to enable it? Thanks

@Stichoza
Copy link
Owner

Stichoza commented Feb 5, 2025

pt-PT is an alias of pt, both are Portuguese. What you're looking for is pt-BR

@Stichoza Stichoza closed this as completed Feb 5, 2025
@tamslinn
Copy link
Author

tamslinn commented Feb 6, 2025

Hi,

Sorry but pt-BR gives exactly the same output too. I should have said that originally.

> $tr->setTarget('pt');
> echo $tr->translate('The photo that you recently uploaded');
A foto que você enviou recentemente⏎
> $tr->setTarget('pt-BR');
> echo $tr->translate('The photo that you recently uploaded');
A foto que você enviou recentemente⏎
> $tr->setTarget('pt-PT');
> echo $tr->translate('The photo that you recently uploaded');
A foto que você enviou recentemente⏎

(When I checked the translations at https://translate.google.com, it was showing the code pt in the url when you choose 'Portueguese (Brazil)' as the target so I assumed google was using pt as an alias for pt-BR rather than pt-PT)

Also the output of all the commands above is what translate.google.com returns for Portuguese (Brazil), not Portuguese (Portugal)

@Stichoza Stichoza reopened this Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants