Jump to content

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
Link to comment
  • 1 year later...

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?

Link to comment

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.

Link to comment

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>
Link to comment

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.

Link to comment

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
Link to comment
  • 1 year later...

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