translate-shell icon indicating copy to clipboard operation
translate-shell copied to clipboard

output not fully showing in termux

Open seisdr opened this issue 3 years ago • 17 comments

when translate a bunch of words it happen

Screenshot_2021-03-20-16-44-42

seisdr avatar Mar 20 '21 13:03 seisdr

  1. You need to put quotes around the text to be translated.
  2. Please post the output of trans -V.

soimort avatar Mar 20 '21 14:03 soimort

``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``

seisdr avatar Mar 20 '21 14:03 seisdr

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

soimort avatar Mar 20 '21 14:03 soimort

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

seisdr avatar Mar 20 '21 14:03 seisdr

yeah only with Arabic

seisdr avatar Mar 20 '21 14:03 seisdr

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٪ من الماء. نظرًا لأن الماء أثقل ، فإنه يزيح الجليد الخفيف ، مما يتسبب في تطفو الجليد إلى الأعلى.'

soimort avatar Mar 20 '21 14:03 soimort

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

seisdr avatar Mar 20 '21 14:03 seisdr

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

seisdr avatar Mar 20 '21 14:03 seisdr

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.

soimort avatar Mar 20 '21 14:03 soimort

fribidi probably?

seisdr avatar Mar 20 '21 14:03 seisdr

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

pankaj4u4m avatar May 06 '21 20:05 pankaj4u4m

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.

soimort avatar May 06 '21 21:05 soimort

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 avatar Apr 24 '23 01:04 jmgomezpoveda

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 avatar Apr 24 '23 15:04 jmgomezpoveda

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

jmgomezpoveda avatar Apr 24 '23 15:04 jmgomezpoveda

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

spiral009 avatar Apr 24 '23 15:04 spiral009

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

jmgomezpoveda avatar Apr 24 '23 16:04 jmgomezpoveda