Hi, first of all I would like to thank you for such wonderful project! It makes my translations really quick and allows me to return to reading straightaway without being distracted by overloaded translation services in the web browser.
In this issue I would like to resolve a little problem I ran into. For convenient reading of hieroglyphs, I increased the font size in my terminal and now it fits a slightly smaller number of lines than before and pretty often translate-shell output doesn't fit in one page, so I have to scroll terminal buffer within my tmux session which is quite tedious.
Let's take a look at output of trans -s zh-CN -t en 量:
As you can see this content takes a lot of terminal lines. It could be a significantly more compact if dictionary would place translation on one line with the definitions, e. g.:
amount - 量, 额, 数量, 多少, 数目, 数字
instead of
amount
量, 额, 数量, 多少, 数目, 数字
So I decided to dig into the codebase of translate-shell and found a solution:
--- a/include/Translators/GoogleTranslate.awk
+++ b/include/Translators/GoogleTranslate.awk
@@ -430,9 +430,9 @@ function googleTranslate(text, sl, tl, hl,
r = r RS prettify("dictionary-word", ins(1, (article ? "(" article ") " : "") word, tl))
if (isRTL(il))
- r = r RS prettify("dictionary-explanation-item", ins(2, explanation, il))
+ r = r " - " prettify("dictionary-explanation-item", ins(0, explanation, il))
else
- r = r RS ins(2, explanation)
+ r = r " - " ins(0, explanation)
}
}
}
I tried to put this functionality into a command-line option to avoid disturbing users who are accustomed to the current broad output. I'm pretty sure I didn't do it 100% right, so I'll be happy to correct the patch of this MR to match the requirements of the project :)
Hi, first of all I would like to thank you for such wonderful project! It makes my translations really quick and allows me to return to reading straightaway without being distracted by overloaded translation services in the web browser.
In this issue I would like to resolve a little problem I ran into. For convenient reading of hieroglyphs, I increased the font size in my terminal and now it fits a slightly smaller number of lines than before and pretty often translate-shell output doesn't fit in one page, so I have to scroll terminal buffer within my tmux session which is quite tedious.
Let's take a look at output of
trans -s zh-CN -t en 量
:As you can see this content takes a lot of terminal lines. It could be a significantly more compact if dictionary would place translation on one line with the definitions, e. g.:
instead of
So I decided to dig into the codebase of translate-shell and found a solution:
I tried to put this functionality into a command-line option to avoid disturbing users who are accustomed to the current broad output. I'm pretty sure I didn't do it 100% right, so I'll be happy to correct the patch of this MR to match the requirements of the project :)