Съобщения: 12
Език: English
falintstelo (Покажи профила) 24 юли 2012, 16:24:17
Lernu.net has a very helpful dictionary on the right hand side of every page. The dictionary also automatically looks up words that you click on within Lernnu pages. I think this could be converted into a bookmarklet with some pretty simple Javascript to enable it on all websites, not just Lernu.net. For those who don't know, a bookmarklet is a piece of Javascript that is contained inside a bookmark within the browser. These are typically in the toolbar above the page, and clicking on one will activate it for the page.
Alternatively, a GreaseMonkey script could be written to look up the highlighted word in a dictionary as well. This could be made to be active at all times, rather than bookmarklet. GreaseMonkey scripts are Javascript based as well. (https://addons.mozilla.org/en-US/firefox/addon/gre...).
So, I am wondering if something like this has been done already. There are plenty of other dictionaries too, so this is in no way unique to Lernu.net. A script like this would make it easier for beginners to read Esperanto on all websites and look up words just by clicking on them.
Chainy (Покажи профила) 24 юли 2012, 19:06:08
MoutOp (Покажи профила) 24 юли 2012, 19:07:10
falintstelo (Покажи профила) 24 юли 2012, 22:38:24
MoutOp:I asked almost the same question in the French forum, the answer will help me too !I took a look at that thread (thanks to Google Translate), and I saw that one user posted a link to an addon page. The link was just a blank search page, but it prompted me to find out what addons are already available for Firefox concerning Esperanto. Not surprisingly, I was not the first person to have this idea. There are a number of different translation addons, many supporting Esperanto, but FoxLingo seems to be the most fully featured. It supports translation by page, selection, or word. It also supports more than 30 translation engines (Google Translate, etc), but Lernu was not listed as one.
I tried FoxLingo briefly, and I was very dissatisfied. It worked on probably less than half the words I tried to look up, text translation didn't work at all, and simple things like getting menus to display took multiple tries sometimes. It also has a lot of bad reviews, so I'm not the only person experiencing this.
Next, I tried TransLiterator. It didn't seem to do anything at all. It was difficult to understand however, so maybe I misconfigured something. Traduku was the same way. Majstro isn't available for new versions of Firefox (yet).
Many of these addons either don't work properly, or have poor support for Esperanto. I'll keep searching for an addon that meets my needs in case something does exist. If anyone has any suggestions, please let me know.
falintstelo (Покажи профила) 24 юли 2012, 22:53:20
Chainy:This is an interesting idea, if it is indeed possible. It really would be very useful to learners. Do you know how to do this kind of thing? As far as I know, nobody has used the Lernu dictionary in this way yet.I took a look at how the dictionary works. It looks like words are looked up using a simple GET request, and the results are returned in a combination of JSON and plain text. My javascript and HTML skills are both lacking, but I'll see if I can come up with anything.
erinja (Покажи профила) 24 юли 2012, 23:49:16
Go ahead and make whatever programs you want, but if I were you, I wouldn't spend too much time on it. You don't know that your program will still work after the new site is launched, and if it's something that you put a lot of time into, it could be exceedingly frustrating.
falintstelo (Покажи профила) 25 юли 2012, 03:48:02
erinja:A friendly heads-up - lernu.net is going to undergo a drastic site redesign in about 5 months (roughly around new year's).I wasn't planning on making anything large or complex, just something small that gets the job done. I don't think it'll be too difficult actually. Thanks for taking the time to warn me ahead of time -- I'll keep that in mind.
Go ahead and make whatever programs you want, but if I were you, I wouldn't spend too much time on it. You don't know that your program will still work after the new site is launched, and if it's something that you put a lot of time into, it could be exceedingly frustrating.
MoutOp (Покажи профила) 25 юли 2012, 11:15:10
falintstelo:Many of these addons either don't work properly, or have poor support for Esperanto.It's why the answers of this topic are interesting for me ^^
Fenris_kcf (Покажи профила) 25 юли 2012, 15:24:31
falintstelo (Покажи профила) 29 юли 2012, 18:24:49
It seems that a bookmarklet is not possible for this due to the Same Origin Policy. I researched a number of workarounds for this (CORS, easyXDM, JSONP), but it seems they all require the server to be modified in some way, which I don't have access to. Luckily, Greasemonkey scripts are exempt from this restriction. The downside is that a Greasemonkey script will require the Greasemonkey addon to be installed in the browser; this requires a browser restart. Greasemonkey scripts (called userscripts), however, can be installed without restarting the browser.
I'll try to begin working on the script within the next few days. I should be able to use most of the code that I had written for the bookmarklet, so I don't think it'll take to long.
Links:
Greasemonkey addon - https://addons.mozilla.org/en-US/firefox/addon/gre...
Wikipedia - https://en.wikipedia.org/wiki/Greasemonkey
Greasemonkey scripts - https://userscripts.org/