Jump to content

WordReference - A multilingual translation dictionary


Recommended Posts

Update: WordReference is no longer accepting new registrations for API keys, but those who have already registered can continue to use them. As such, new users won't be able to set this up.

 

---

 

Schermata%202013-06-04%20alle%2020.48.45

 

For the language learners among us, here's a workflow that returns results from http://wordreference.com into Alfred.

 

As you can see from the screenshot, you'll get various definitions in the original language (designated using the relevant flag), with each definition proceeded by translations in the target language (parts of speech and the gender of nouns (where applicable) are also included). Pressing enter will take you to the entry page on wordreference.com.

 

Numerous dictionaries are included (I can add additional ones carried by the WordReference website if there are any requests), with the specific dictionary called up using the first two letters of the original language followed by the first two letters of the target language. That means:

 

enfr: English to French

fren: French to English

enit: English to Italian

iten: Italian to English

enes: English to Spanish

esen: Spanish to English

 

pten: Portuguese to English

enpt: English to Portuguese

 

In addition, typing frc, itc or esc, followed by a verb (in French, Italian or Spanish respectively) and then pressing enter will call up (in your browser) the conjugation table for the verb. For example:

 

Schermata%202013-06-04%20alle%2021.32.55

 

Lastly, note that in order to use the workflow you must first register for an API with wordreference.com (this is necessary to prevent excessive calls from any given API). That can be done by using the 'getapi' keyword in Alfred, or using this link: http://www.wordreference.com/docs/APIregistration.aspx. You then set the API by using the 'setapi' keyword. 

 

And just in case you "tl:dr" that:

Schermata%202013-06-04%20alle%2021.35.00

 

 

DOWNLOAD (Version 0.6 - 07/05/13)

 

 

Updates will be released via Alleyoop 2 and posted here. Let me know if you've got any feedback. Also, thanks to everyone in the help forums who helped me overcome my near total inability to code.

Edited by avk_tp
Link to comment
  • 4 weeks later...

Hi Anthony, thanks for the workflow, it's very useful.

I'd like to add German, I had a look to the code and it repeat itself in several ways (all the {lang1}{lang2}.php files could be unificated passing the languages as a script argument from alfred, also all the loops in those files are very similar and could be done with a function), slimming it would make it easier to add languages and more maintainable.

If you'd like I'll gladly do this refactoring and add german language, tell me what you think about it.

Link to comment

Hi Anthony, thanks for the workflow, it's very useful.

I'd like to add German, I had a look to the code and it repeat itself in several ways (all the {lang1}{lang2}.php files could be unificated passing the languages as a script argument from alfred, also all the loops in those files are very similar and could be done with a function), slimming it would make it easier to add languages and more maintainable.

If you'd like I'll gladly do this refactoring and add german language, tell me what you think about it.

 

Sounds great to me!

 

I'm a real amateur, so although I could obviously add the German translations in myself I'd be hard pressed to do the refactoring. Just let me know if I can help out in some way.

Link to comment

Sounds great to me!

 

I'm a real amateur, so although I could obviously add the German translations in myself I'd be hard pressed to do the refactoring. Just let me know if I can help out in some way.

I slimmed it a bit, now there is only translate.php instead than one file per language pair and there is only one loop in the file

I also found out that german is not supported by the wordreference api...bad luck for me

Well anyway give it a look https://dl.dropboxusercontent.com/u/115338/WordReference.alfredworkflow

 

If you are open to contributions github would probably be the best way to handle them.

 

edit:

by the way I think that it would be more useful if it would copy the translation to clipboard instead than opening wordreference

the result could be compressed in one per line to show more like this:

- title: {translated term} ({pos} {sense})

- subtitle: {original term} ({pos} {sense})

what you think of these ideas?

Edited by francescolaffi
Link to comment

I slimmed it a bit, now there is only translate.php instead than one file per language pair and there is only one loop in the file

I also found out that german is not supported by the wordreference api...bad luck for me

Well anyway give it a look https://dl.dropboxusercontent.com/u/115338/WordReference.alfredworkflow

 

If you are open to contributions github would probably be the best way to handle them.

 

edit:

by the way I think that it would be more useful if it would copy the translation to clipboard instead than opening wordreference

the result could be compressed in one per line to show more like this:

- title: {translated term} ({pos} {sense})

- subtitle: {original term} ({pos} {sense})

what you think of these ideas?

 

Looks great! Definitely much more parsimonious than my version... thanks for going through it and fixing it up. 

 

As for the suggestion, I think that sounds good. We could always make it so that while enter copies the translation to clipboard, pressing control-enter could open the webpage (so that the option would still be there).

 

In the meanwhile I'll sign up for github in a few days (I'm travelling right now) and then return with a link for contribution purposes.

Link to comment

I slimmed it a bit, now there is only translate.php instead than one file per language pair and there is only one loop in the file

I also found out that german is not supported by the wordreference api...bad luck for me

Well anyway give it a look https://dl.dropboxusercontent.com/u/115338/WordReference.alfredworkflow

 

If you are open to contributions github would probably be the best way to handle them.

 

edit:

by the way I think that it would be more useful if it would copy the translation to clipboard instead than opening wordreference

the result could be compressed in one per line to show more like this:

- title: {translated term} ({pos} {sense})

- subtitle: {original term} ({pos} {sense})

what you think of these ideas?

 

Here's that link to the github page: https://github.com/mbdw/WordReference

Link to comment

Here's that link to the github page: https://github.com/mbdw/WordReference

Hi, I forked it and made a couple of pull requests, one that organize a bit the repo and the other with the copy on enter functionality + one term per line.

you can test how it works here https://raw.github.com/francescolaffi/alfred-wordreference-workflow/copy-on-enter/WordReference.alfredworkflow 

 

You can merge that code in your repo with the button that says accept pull request or merge it, or something like that.

I believe it is possible to use github to distribute the workflow and host the remote json, if you need help with it or github contact me.

Link to comment

Hi, I forked it and made a couple of pull requests, one that organize a bit the repo and the other with the copy on enter functionality + one term per line.

you can test how it works here https://raw.github.com/francescolaffi/alfred-wordreference-workflow/copy-on-enter/WordReference.alfredworkflow 

 

You can merge that code in your repo with the button that says accept pull request or merge it, or something like that.

I believe it is possible to use github to distribute the workflow and host the remote json, if you need help with it or github contact me.

 

Accepted the pull requests and I've updated the alleyoop update to make it all go through github. The only thing I can't figure out is how to replace the workflow file itself on github with the new one that contains the proper alleyoop reference. I feel like I'm missing something super simple...

 

Thanks again for all the help, by the way!

Link to comment

This looks like a really good workflow. Thanks for sharing. I have one problem. I am trying set the api but alfred immediately tries to search for the key instead of letting me enter it into the setapi action. See below.

 

setapi should be a keyword not a script filter, it was working fine few version ago, don't know how it got changed... astroMD77: try this version https://github.com/francescolaffi/alfred-wordreference-workflow/raw/master/WordReference.alfredworkflow it should work

 

avk_tp: I'll send a pull request with everything ready to release this fix

 

edit: fixed link, the software of this forum is not really good understanding where an url finish

Edited by francescolaffi
Link to comment

setapi should be a keyword not a script filter, it was working fine few version ago, don't know how it got changed... astroMD77: try this version https://github.com/francescolaffi/alfred-wordreference-workflow/raw/master/WordReference.alfredworkflow it should work

 

avk_tp: I'll send a pull request with everything ready to release this fix

 

edit: fixed link, the software of this forum is not really good understanding where an url finish

 

 

This looks like a really good workflow. Thanks for sharing. I have one problem. I am trying set the api but alfred immediately tries to search for the key instead of letting me enter it into the setapi action. See below.

 

Image%202013.07.11%209%3A48%3A54%20AM.pn

 

It's all merged now, so the updated version is on github. I'm not sure how setapi stopped working, either, since I confirmed that the the process looked exactly the same a few versions ago and worked fine. 

Link to comment

Any chance of adding Portuguese? Thanks

 

Done. You can download it here: http://db.tt/iVfinaFs (it's not up on github yet). Use pten for Portuguese to English and enpt for the reverse.

 

 

setapi should be a keyword not a script filter, it was working fine few version ago, don't know how it got changed... astroMD77: try this version https://github.com/francescolaffi/alfred-wordreference-workflow/raw/master/WordReference.alfredworkflow it should work

 

avk_tp: I'll send a pull request with everything ready to release this fix

 

edit: fixed link, the software of this forum is not really good understanding where an url finish

 

@francescolaffi: can you push it up onto github for me? I fiddled with it for awhile but keep getting errors in terminal (I don't think I've set it up right and need to look into it a bit more).

Edited by avk_tp
Link to comment

Hey Mahmoud,

 

The English monolingual dictionary cannot be accessed except through the wordference website, but I can add in the English thesaurus if you'd still want it on its own.

 

 

Let me know,

 

Anthony

 

Hi,

 

Any chance you could add English definition and English synonyms to the workflow? I am a translator and it can be very useful for me.

Thanks in advance.

 

Mahmoud

Link to comment

Hi Anthony,

 

Yes, please. I would really appreciate it if you could do that.

Thanks a million in advance.

 

Mahmoud

 

Hey Mahmoud, 

 

I took a look at the wordreference results for the thesaurus and I can't figure out a way to return them in Alfred without the whole thing becoming unwieldy. There are just too many different senses for words, which then have a whole slew of associated synonyms.

 

The only way I can think to do it is with a drill down menu, such that you enter a word (e.g. "cold") and then you choose among the potential meanings (e.g. "said of weather", "said of people", "absence of warmth", etc.), press enter, and then are returned a new list with synonyms for that particular sense of the word. Unfortunately I am not a real programmer so I wouldn't know where to even start to do that (and I can't say for certain whether the wordreference website makes it possible to do). 

 

So alas, you'll need to hope that an actual programmer can come to your rescue on that one. 

 

 

Sorry about that,

Anthony

Link to comment
  • 4 months later...

Thank you for sharing this workflow, it's really useful for me. Is there any chance of adding portuguese-spanish and spanish-portuguese translations?

 

Sorry for the slow reply. Unfortunately only translations that involve English are made available by the wordreference API, so it's impossible at this point in time.

Link to comment
  • 2 months later...

It seems that WR stopped the API service. Is there any other way to get the extension to work without that?

 

Sorry, I can't help if you don't already have access to an API key. My only suggestion would be to email them to gently express your disappointment and your desire to be notified if they should ever change their new policy.

Link to comment

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