GUI for “Translate Shell”

I am working on it

Hi Tom,
I installed Translate Shell and Bash 4.
I added ENV_PATH to my KBM variables.

When I gave ENV_PATH a value of /usr/local/bin/trans as per your message, the macro output did not contain useful translation info.

When I gave ENV-PATH the value /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin which I found in the link 'appropriately' (Make sure your “ENV_PATH” KM variable is set appropriately ) in your reply, the output contains the translation (which reads The russian displeasure at the meat counter) as per below but also extra lines of error messages.

thanks !

image

and here is another translation

image

When I gave ENV-PATH the value /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin which I found in the link 'appropriately'

Yep, this is the right direction. Personally I would make it:

/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin

Just for the sake of completeness; yours should work also.


The output from the screenshots you posted makes me think that this is the output as intended for the Terminal. (The output for the Terminal contains coloring informations and such.) My macro attempts to avoid the Terminal-specific output by using the -brief switch in the shell script actions.

Please make sure that that switch is still there in your shell script actions. Or just re-download the macro in case of doubt.


Well, basically it works now! Just some minor hurdles!

1 Like

yes, thanks very much for your patience.
I will check -brief
The new path you suggested did not change anything

Funny thing: it is quite slow. A few seconds at least for each translation which is usually immediate

thanks again very much

Something that occurs to me now: maybe it needs gawk (GNU-awk).

However, in that case it shouldn’t have returned you any translation at all. I’m confused, but to be sure, install it with:

brew install gawk

This depends on the engine you choose. Google usually is faster than DeepL.

You can choose the engine by holding down ⌘ while selecting the macro from the palette.

1 Like

In any case: any speed issue is not an issue we can resolve on our side. The deciding factor is the time the engine needs to deliver the results (including connection speeds). The time consumed by the shell script or by the macro is negligible.

1 Like

thank you !

Thanks for the GUI wrapper and the hints, I made it work in a version for me, but DeepL shortens the text to a paragraph, is that happening for everyone, or is there something missing/wrong?

Yes, it seems to stop at line breaks.

I noticed that Linguee (DeepL) is now offering a “DeepL Pro” (€20/month). In the comparison table it says that the API access is only available to DeepL Pro users. So I’m wondering why it is working at all…

Unless Translate Shell is circumventing the “regular” API, which then could explain the issues like limitation to one paragraph. Just thoughts.

1 Like

Thank you. If I go to the free Web-Translator at DeepL you get some more words and paragraphs. I hoped, it would be the same.

Yes, when pasting a multi-paragraph text into the webform it works (up to the limit of 5000 chars). So, maybe a bug with Translate Shell? (I didn’t find anything related in the Issues on GitHub.)

PS:

I just opened a ticket for that.

2 Likes

Good point about Deepl free vs pro.
I think that deepl is overpriced, and hopefully the prices will drop. I use it when straightforward alternatives don't give the answer, in which case I use the Translate Shell which you so kindly helped me to implement.
My first step is to try the translate actions of Popclip.
For short texts like sentences, the 'translate' action is superb: very fast; translation appears under the cursor and disappears when the cursor moves.
For longer texts like paragraphs, the 'translate tab' action is very nice.

@Tom @rho
Sometimes I wonder if knowing less about programming (speaking of myself) can paradoxically be an advantage.
Take the translate shell: there are all kinds of prerequisites (install honeydew, bash etc), it requires programming by very talented people and the end product has limitations as discussed above.
I tried an extremely simple alternative and it works very nicely (at least go up to 5,000 words).

  • Use Fluid to create a floating window Deepl app
  • create an extremely simple macro copy text → open deepl app → clear window (Cmd-A → del) → paste text

That being said, I am still greatly appreciative of Tom's help.

1 Like

I read the ticket and understand: The case is complicated!
(Ich las das Ticket und verstehe: Der Fall ist kompliziert!)

1 Like

Yes, it seems so. I don’t understand it.

Can you reproduce the issue with the sample text I provided in the ticket?

1 Like

I suspect this is currently the fastest (working) option for DeepL.

1 Like

Yes, I tried and it is exactly the same in all three cases.

1 Like