Jump to content
zusatzstoff

Linguee.de German-English/English-German Dictionary Workflow

Recommended Posts

Hey guys,

 

I've created my very first workflow based on the NodeJS framework provided by @tungdang (http://www.alfredforum.com/topic/5488-alfred-workflow-nodejs/). It's a very simple german-english dictionary based on linguee.de. It features autocompletion, auto detection of the input language (german or english) and phrases.

 

Installed NodeJS is a precondition

 

Download link, description and source can be found here: https://github.com/zusatzstoff/linguee-alfred-workflow

 

Feedback for improvement is appreciated :)

Edited by zusatzstoff

Share this post


Link to post

Very nice. And so fast. I will be using this a lot!
 
I have one request: Seeing as the workflow's results all have a specific translation direction, could the results open the webpage for the right translation direction as well, instead of the generic EN <-> DE results (i.e. set source=deutsch or source=englisch instead of source=auto)?
 
For example, say I type a query with matches in both directions:
 
JxF8HNM.png
 

 

If I action the first result, which is DE -> EN, I would like to see DE -> EN results. Currently, the workflow always opens the bidirectional DE <-> EN results page, which means I get all the irrelevant EN -> DE results first and the EN -> DE examples instead of the DE -> EN ones I'm looking for.

Would that be possible?

Share this post


Link to post

I have another request!
 
Any chance to make the entered query one of the results? For example, I tried to look up "vergeigen" and "BetrVG". The workflow (and Linguee's search box) provide no suggestions, but there are results for the terms if you actually hit Search.

Share this post


Link to post

Hey,

 

for the first request I will have a look if the suggestion document gives me some kind of a language tag back. If that's the case a directional translation page will be manageable. The second one shouldn't be a problem at all :) Will try to keep you posted here what's the progress on this is. 

Share this post


Link to post

Great!
 
I've had a quick look at the HTML, and each item is tagged with the language in several places. Indeed, the URL in div.main_item[href] points to the "right" page: 

<div class='main_item' lid='DE:Lager22603' lc='DE' href='/deutsch-englisch/uebersetzung/Lager.html'>Lager</div>

and

<div class='main_item' lid='EN:lager55558' lc='EN' href='/englisch-deutsch/uebersetzung/lager.html'>lager</div>

Share this post


Link to post

Found a wee bug.
 
Alfred doesn't have an "Escape Single Quotes" option, so you can't use single quotes around {query} in the Script Box in the line below or the workflow dies in flames on a query with a single quote in it, like "can't". 

./linguee "$(iconv -f UTF8-MAC <<<'{query}' )"

You have to use double quotes instead:

./linguee "$(iconv -f UTF8-MAC <<<"{query}" )"

with Escaping Options Backquotes, Double Quotes, Backslashes and Dollars.

 

Sorry I'm piling all these requests and stuff on you. I just know I'm going to use the ever-loving shit out of this workflow.

Share this post


Link to post

Wonderbra! Works perfectly.

 

I noticed another small issue when upgrading: You should probably assign a Bundle ID in the main workflow configuration screen. Without a Bundle ID, Alfred can't tell the version I just downloaded is an update of an already installed workflow, so it installed a second version alongside the first instead.

 

FWIW, technically you need to select Backslashes and Backquotes for the Escaping to be correct, but I don't imagine anyone will enter either of those as a query for this workflow.

Edited by deanishe

Share this post


Link to post

I also have the problem after I upgraded to High Sierra. This is unfortunate at Leo also doesn't work anymore. No good dictionary makes work difficult. 

 

[ERROR: input.scriptfilter] Code 11: Exited with error code but no message

Edited by Easytiger

Share this post


Link to post
7 hours ago, Acidham said:

Seems its related to High Sierra ...

 

That would explain why it still works for me.

 

It's possible that the workflow just needs recompiling.

Share this post


Link to post
8 hours ago, Acidham said:

Seems its related to High Sierra ... There is an issue open on git...

 

That would be great. After Leo.org is no longer working this is urgently needed. 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...