soimort / translate-shell

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

"Voice output isn't available for English" #514

Closed vitaly-zdanevich closed 7 months ago

vitaly-zdanevich commented 8 months ago
$ trans :ru -p 'hello'
привет

Definitions of hello
[ English → Русский ]

verb
    здороваться
        greet, hello, salute, hallo, hullo, bow
    звать
        call, invite, shout, hail, hallo, hello
    окликать
        hail, holler, call, challenge, speak, hello

noun
    приветствие
        greeting, welcome, salute, salutation, hello, hail
    приветственный возглас
        hallo, halloa, hello, viva
    возглас удивления
        hallo, halloa, hello

hello
    привет, приветствовать, Здравствуйте
Voice output isn't available for English

Why do I have this orange warning? In this example, I hear both English and Russian.

soimort commented 8 months ago
  1. What is your trans -V?

  2. Does it happen with other language pairs?

vitaly-zdanevich commented 8 months ago
$ trans -V
Translate Shell       0.9.7.1

platform              Linux
terminal type         xterm-kitty
bi-di emulator        [N/A]
gawk (GNU Awk)        5.3.0
fribidi (GNU FriBidi) 1.0.13
audio player          mpv --no-config
terminal pager        less
web browser           xdg-open
user locale           C.UTF8 (English)
host language         en
source language       auto
target language       en
translation engine    auto
proxy                 [NONE]
user-agent            Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36 Edg/104.0.1293.54
ip version            [DEFAULT]
theme                 happiness.trans
init file             /home/vitaly/.config/translate-shell/init.trans
vitaly-zdanevich commented 8 months ago

2. Does it happen with other language pairs?

Looks like yes:


$ trans :de -p 'hello'
Hallo

Definitions of hello
[ English → Deutsch ]

interjection
    Hallo!
        Hello!, Hi!, Hey!, Howdy!, Yoo-Hoo!
    Hallo?
        Hello!
    Guten Tag!
        Hello!, Good day!, Good afternoon!, How do you do?
    Servus!
        Hello!, Goodbye!, Cheerio!, So long!

hello
    Hallo, hallo!
Voice output isn't available for English
soimort commented 8 months ago

user locale C.UTF8 (English)

Which OS / distro are you running?

trans could be problematic under the locale C, as it sometimes gets confused when assuming the default language (which is English in this case). You can try changing the locale to en_US.UTF8 or ru_RU.UTF-8. Or explicitly specify the source language (en) and see if the warning persists:

$ trans en:de -p 'hello'
vitaly-zdanevich commented 7 months ago

Which OS / distro are you running?

Gentoo Linux, installed from the system package manager.

soimort commented 7 months ago

Which OS / distro are you running?

Gentoo Linux, installed from the system package manager.

Thanks for the info! Now I see that C.UTF-8 is indeed the default locale on Gentoo, and probably other more baremetal systems. Will fix that warning for C.UTF-8 later, but still, setting a language/region based locale is recommended.