Jump to content

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


Recommended Posts

Posted (edited)

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
  • 1 year later...
Posted

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?

Posted

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.

Posted

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. 

Posted

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

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.

Posted (edited)

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
  • 1 year later...
Posted

Is golang required to run the workflow?  I tried it but I get no results but [ERROR: input.scriptfilter] Code 11: Exited with error code but no message

Posted (edited)

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
Posted
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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...