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.9k stars 390 forks source link

output not fully showing in termux #394

Open seisdr opened 3 years ago

seisdr commented 3 years ago

when translate a bunch of words it happen

Screenshot_2021-03-20-16-44-42

soimort commented 3 years ago
  1. You need to put quotes around the text to be translated.
  2. Please post the output of trans -V.
seisdr commented 3 years ago

``u0_a96@localhost:~$ trans -V Translate Shell 0.9.6.12-release

platform Linux terminal type xterm-256color bi-di emulator [N/A] gawk (GNU Awk) 5.0.1 fribidi (GNU FriBidi) 1.0.7 audio player mpv --no-config 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 3 years ago

Does it happen only for Arabic (right-to-left), or for other languages (left-to-right) on Termux as well?

seisdr commented 3 years ago

IMG_٢٠٢١٠٣٢٠_١٧٠٥٤٥

seisdr commented 3 years ago

yeah only with Arabic

soimort commented 3 years ago

Interesting. I guess this has something to do with Termux's RTL language support.

Could you execute the following echo command to see if it shows the full output in termux?

$ echo 'ا الذي يميز الجليد الذي يجعله يطفو؟ صدق أو لا تصدق ، الجليد أقل كثافة بنسبة 9٪ من الماء. نظرًا لأن الماء أثقل ، فإنه يزيح الجليد الخفيف ، مما يتسبب في تطفو الجليد إلى الأعلى.'
seisdr commented 3 years ago

yeah Screenshot_2021-03-20-17-27-39

seisdr commented 3 years ago
lhost:~$ echo 'ا الذي يميز الجليد الذي يجعله يطفو؟ صدق أو لا تصدق ، الجليد أقل كثافة بنسبة 9٪ من الماء. نظرًا لأن الماء أثقل ، فإنه يزيح الجليد الخفيف ، مما يتسبب في تطفو الجليد إلى الأعلى.'
ا الذي يميز الجليد الذي يجعله يطفو؟ صدق أو لا تصدق ، الجليد أقل كثافة بنسبة 9٪ من الماء. نظرًا لأن الماء أثقل ، فإنه يزيح الجليد الخفيف ، مما يتسبب في تطفو الجليد إلى الأعلى.
u0_a96@localhost:~$
soimort commented 3 years ago

Thank you for reporting this. It seems that the same issue can be observed from a regular Linux terminal, not just termux -- I'll look into it.

seisdr commented 3 years ago

fribidi probably?

pankaj4u4m commented 3 years ago

It is same in gnome terminal. It was working for few words and then suddenly blank.

for engine in google bing yandex apertium aspell spell hunspell; do echo "$engine"; trans -f en -t ja -e $engine -no-init -verbose "just testing"; done google

bing just testing

テストだけ (test dake)

[ English -> 日本語 ]

yandex [ERROR] Oops! Something went wrong and I can't translate it for you :( apertium just testing

[ English -> 日本語 ] aspell just testing spell just testing hunspell [ERROR] Spell checker (hunspell) not found.

trans -V Translate Shell 0.9.6.12

platform Linux terminal type xterm-256color bi-di emulator [N/A] gawk (GNU Awk) 5.1.0 fribidi (GNU FriBidi) 1.0.8 audio player mplayer terminal pager less web browser xdg-open user locale de_DE.UTF-8 (German) home language de source language auto target language de 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 3 years ago

It is same in gnome terminal. It was working for few words and then suddenly blank.

@pankaj4u4m This issue is particularly about the right-to-left language support of translate-shell. Your problem with Yandex involves another known issue #359, and that your IP is probably banned by Google/Bing's server due to frequent requests.

jmgomezpoveda commented 1 year ago

Same issue here: the output gets truncated when translating to Arabic. If I select a bigger width with the command-line parameter, I can get additional output. But I still get almost half the text that Google Translate produces.

jmgomezpoveda commented 1 year ago

It seems translation is correct if before translating the file I replace all "." in the file with ".\n". It seems it is multi-line paragraphs what is getting truncated.

jmgomezpoveda commented 1 year ago

Update: just using "-no-bidi" fixes all the issues. No need to split paragraphs.

spiral009 commented 1 year ago

You need bidi to correct the Arabic text in termux without it text will appear like Screenshot_٢٠٢٣٠٤٢٤-١٨٥٤٥١_Termux

jmgomezpoveda commented 1 year ago

Apologies, I am testing only the file output, with the -b option.