soimort / translate-shell

:speech_balloon: Command-line translator using Google Translate, Bing Translator, Yandex.Translate, etc.
https://www.soimort.org/translate-shell
The Unlicense
6.85k stars 388 forks source link

Wrong source language parsed #432

Closed afonsocraposo closed 2 years ago

afonsocraposo commented 2 years ago

The output of the command trans -s pt-PT -t english olá shows:

olá

Hello

Definitions of olá
[ Português Brasileiro -> English ]

interjection
    Hello!
        Olá!, Oi!, Alô!
    Hi!
        Oi!, Olá!
    Hoy!
        Olá!

olá
    Hello, Hi, Hello, hi, Helo

The language parsed is "Português Brasileiro" when it should be "Português Europeu".


$ trans --version
Translate Shell       0.9.6.12-git:d3e0836

platform              Linux
terminal type         screen-256color
bi-di emulator        [N/A]
gawk (GNU Awk)        5.1.0
fribidi (GNU FriBidi) 1.0.10
audio player          [NOT INSTALLED]
terminal pager        less
web browser           xdg-open
user locale           en_US.UTF-8 (English)
home language         en
source language       auto
target language       en
translation engine    google
proxy                 [NONE]
user-agent            Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36
ip version            [DEFAULT]
theme                 default
init file             [NONE]

Report bugs to:       https://github.com/soimort/translate-shell/issues
``
soimort commented 2 years ago

Thanks for reporting. I believe trans ignore the region code of the source language since most translators do not even distinguish them (e.g. translating from European Portuguese or translating from Brazilian Portuguese).

But in any case I'm not a Portuguese speaker myself at all. Just wondering if Google Translate's "Portuguese" sounds European or Brazilian?

afonsocraposo commented 2 years ago

You are correct. I tested Google Translate with the following example (English > Portuguese): bus > ônibus In European Portuguese it would be: bus > autocarro Thank you for your help. Obrigado!

soimort commented 2 years ago

De nada: )

gusbemacbe commented 1 year ago

Hello @soimort

There is still a bug:

trans -e bing -b :pt-BR+pt-PT "File and folder"
Arquivo e pasta
Arquivo e pasta

trans -e bing -b :pt-BR+pt-PT "Bus"
Autocarro
Autocarro

Google Translate and Yandex Translate do not support the regional translation, but Bing and DeepL support the regional translation.

soimort commented 1 year ago

Hello @soimort

There is still a bug:

trans -e bing -b :pt-BR+pt-PT "File and folder"
Arquivo e pasta
Arquivo e pasta

trans -e bing -b :pt-BR+pt-PT "Bus"
Autocarro
Autocarro
  • In European Portuguese, it should be "ficheiro e pasta".
  • In Brazilian Portuguese, it should be "ônibus".

Google Translate and Yandex Translate do not support the regional translation, but Bing and DeepL support the regional translation.

Note that https://www.bing.com/translator simply translates "Bus" to "Autocarro" in both Portuguese (Portugal) and Portuguese (Brazil). So this needs to be fixed on Microsoft's side and there's nothing we can do here. Consider submitting a suggestion on Bing's website.

Screenshot from 2022-11-01 00-40-49