MediaWiki talk:Gadget-dictionaryLookupHover.js
From Wikinews, the free news source you can write!
See WN:WiktLookup for more information.
[edit] FAQ
- I want to use this, but at the same time I want to be able to double-click things without the pop-up coming up. (aka i want to use the edit when double clicking option, or i want to select whole words by double clicking).
- hold down shift while double clicking
- Can this be translated into <some language>
- yep, this is already in several languages. See below to request a new translation, or help with translation
- Can I use this on my website or wiki
- Yes you can. See WN:WiktLookup for details on how to use on your own website. Ask user:Bawolff if you need help.
- I know javascript and want to help
- Awesome, ask user:Bawolff what you could do to help.
- I for some reason want to query wiktionary for definitions
- The script used in the backend of this project can be directly accessed at user:Bawolff/sandbox/Wiktionary query
- I want to use this as a bookmarklet
- Sure, just bookmark the following url (In firefox, highligh it and drag to toolbar)
javascript:(function%20()%20%7Bvar%20src%20=%20document.createElement('script');src.type%20=%20'text/javascript';src.src%20=%20'http://en.wikinews.org/w/index.php?title=MediaWiki:WiktionaryLookup-external-bookmarklet.js&action=raw&ctype=text/javascript&scrver=1';document.getElementsByTagName('head')%5B0%5D.appendChild(src);%7D)();void%200
[edit] Random idosynchrasis
- The count parameter will only return definitions for the word as interperted as if the word is of a specific language. However ES translation does all definitions
- Image handling kind of crap.
[edit] Open issues
- Determine if - is a valid word separator. perhaps try both. What about _.
- Better handling of compound words ( word-word ).
- Issues with xslt
- maybe bug link. (not happening right now, as i'm worried it will make things too clutered, but if people really want it, please yell at me)
- Better instructions. (preferably with pictures)
- integrate some stuff from fr wiktionary
- count parameter. push to NL
- showWord parameter. push to NL
- get permission to steal wikt:MediaWiki:langcode2name.js
- Investigate possibility of word press plugin, grease monkey script.
- Have it recognize if its out of date, and make it do a hard refresh.
- Double click on search box on mediawiki. (Scroll wheel or something)
Longer term/ stuff i'm aware but not on my immediate list of things to fix (yell at me if you think these are important and should be a priority)
- Image captions are not stripped even though image is. EX: web (A spider's web at end should not be there)
Other requests (aka stuff other people reported that i'm not planning to do in short term):
-
- Allow locutions with the shift selection, and other sites research with the CTRL + click (eg: Wikipedia, as proposed in the second Firefox module of this tutorial). JackPotte (talk) 14:02, 30 September 2009 (UTC)
- drop shadow perhaps.
- mediawiki devs need to be convinced to use mime type text/xsl for the xslt stylesheet so IE plays nice.
- How to set up in common.js/skin.js, as opposed to gadget (step-by-step) - Amgine
- Bug report: Error on Camino "Error loading stylesheet: A network error occured loading an XSLT stylesheet:http://en.wiktionary.org/w/index.php?title=MediaWiki:extractFirst.xsl&action=raw" (from Dmcdevit in #Wikisource) - Amgine
- long term: Actually hover, not double click (lupin popup style)
- Interface expansion requests found lurking on my talk page:
- I could be interested to add two link:
- One for the feedback about the script (bugs)
- Otourly 11:52, 20 October 2009 (UTC)
- I could be interested to add two link:
-
-
- I could see how that could be useful (adding a bug report page link), but i don't want to make the interface too cluttered. As for your second request. It currently says, can not find word, and has a more link which links to the page. that should probably be improved. thank you for the feedback. Bawolff ☺☻ 00:56, 21 October 2009 (UTC)
-
- This is very cool; I've been giving a spin on my blog. A few bugs and requests:
- There is no way to select compound words (either hyphenated or non-hyphenated)
- It now considers a hyphen as part of a word. However this introduces problems with hyphanated words that are really two words (example from your blog scientist-historians) . Ideally it should first check the entire thing, than try to see if just one part of the hyphanated word works. I don't know what you mean by non-hyphenated compound words.). - bawolff
- I mean words like "sans serif" or "death rattle".--ragesoss (talk) 15:38, 25 October 2009 (UTC)
- Yeah, that would be very very hard to detect, I don't see any possible way of doing that. Bawolff ☺☻ 19:32, 25 October 2009 (UTC)
- Well theoretically i could introduce some markup suchas: <span class="wiktTreatAsOneWord">sans serif</span>, but that seems kind of messy. I could also perhaps make it treat an under-score as a fake space, but thats also ugly. Bawolff ☺☻ 18:08, 26 October 2009 (UTC)
- I mean words like "sans serif" or "death rattle".--ragesoss (talk) 15:38, 25 October 2009 (UTC)
- It now considers a hyphen as part of a word. However this introduces problems with hyphanated words that are really two words (example from your blog scientist-historians) . Ideally it should first check the entire thing, than try to see if just one part of the hyphanated word works. I don't know what you mean by non-hyphenated compound words.). - bawolff
- There is no way to select compound words (either hyphenated or non-hyphenated)
[edit]
Firefox extension noscript may block scripts from en.wikinews, resulting in issues as pictured here. Solution: Have user whitelist wiktionary.org resolved this problem. - Amgine | t 21:48, 7 November 2009 (UTC)
- I wouldn't really clasify this as a problem - if someone disables javascript, they should not be suprised when the javascript does not work. (the issue above would be blocking scripts from wiktionary (with either xslt defined as a script or having css disabled as well) - as if you had either en wikinews, or fr wikinews blocked, you would not be able to get to that step) Bawolff ☺☻ 22:09, 7 November 2009 (UTC)
[edit] Clic or shortcut?
[...]Au lieu du double-clic ou triple-clic pour le gadget, on peut utiliser une combinaison de touche clavier (Ctrl+F11 par ex) que l'utilisateur peut changer.
- [...]Instead of double-clic third-clic and so one, we could use a key-combination (Ctrl+F11 by ex) that the user could change. Otourly (talk) 13:21, 14 November 2009 (UTC)
-
-
-
- I agree with this request as an aditional alternative (not instead of double-clicking). We can perform a partial selection of words or a combined selection of a phrasal verb and then use the key-combination shortcut. Gustronico (talk) 17:44, 21 November 2009 (UTC)
-
-
Done. ctrl+shift+Llooks up word. (can be configured to be ctrl+shift+anycharacter).
-
- That's good. Thank you! Gustronico (talk) 08:15, 28 November 2009 (UTC)
[edit] Japanese word margins
According to Makato, determining word boundaries may be a problem for the script in Japanese. - Amgine | t 18:27, 18 November 2009 (UTC)
Done highlight and use key combo ctrl+shift+l
[edit] Request for translations
See /how to adapt to another language. Or you could just leave the translation here, but it might take me a little while to get to it.
[edit] Languages available
| unstable xslt | example (unstable) | live xslt | enabled | |
|---|---|---|---|---|
| Deutsch | waiting on Bawolff | non-exisitant | ||
| English | good | slightly outdated | X | |
| Español | Good | [6] | slightly outdated | X |
| Français | good | [7] | up to date | X |
| Italiano | good | [8] | slightly outdated | X |
| Japanese | Good | Installed | x | |
| Latin | waiting on Bawolff | non-existant | ||
| Nederlands | outdated | [9] | good | X |
| Norsk (bokmål) | waiting on translation | non-exisitant | ||
| Polish | waiting bawolff | [10] | not ready | |
| Portuguese | done | [11] | updated | X |
| Русский | good | [12] [13] [14] | done | x |
| 中文 | To translate and fix the single word selection bug | |||
| हिन्दी | To translate |
Want this in your language? To speed up the process, consider helping me by translating the following messages ($1 is where stuff gets substituted. leave it in) (Please also specify language code, as well as an admin contact at the specific language wiktionary in question whom i can bug with with re-sync requests)
- © Wiktionary. Released under CC-BY-SA 3.0
- Don't worry about urls, i can translate those.
- Error:
- » More
- Note: bear in mind the » may not be a good arrow depending on your language.
- » Create
- Could not retrieve definition of $1.
[edit] Deutsch (DE)(left to right)
- © Wiktionary. Unter der CC-BY-SA 3.0 Lizenz verfügbar.
- Fehler:
- » Weiter
- Neuen Eintrag erstellen
- Nicht möglich, die Definition von $ 1 abzurufen
[edit] PL
- User:Herr Kriss/sb
- Could not find word: Nie można znaleźć definicji $1.
[edit] EL
Here is a translation of this points:
- © Βικιλεξικό. Διανέμεται υπό την CC-BY-SA 3.0
- Σφάλμα:
- » Περισσότερα
- » Δημιουργία
- Δεν ήταν δυνατόν να ανακτηθεί ο ορισμός του $1.
--Egmontaz♤ συζήτηση 17:55, 20 Νοεμβρίου 2009 (UTC)
[edit] LA
Latin translation, from Wiktionary's EncycloPetey:
-
- © Victionarium. exsolutus per CC-BY-SA 3.0
- Erratum:
- » Plus
- » Crea
- Non putuit reddere definitionem de $1.
More work for Bawolff! \o/ - Amgine | t 21:48, 21 November 2009 (UTC)
[edit] CA
-
- © Viccionari. Disponible sota CC-BY-SA 3.0
- Error:
- » Més
- » Crea-la
- No s'ha trobat cap coincidència per a «$1».
Pasqual (talk) 17:56, 7 December 2009 (UTC)
[edit] EO
- © Vikivortaro. Publikigita sub kopirajto CC-BY-SA 3.0
- Eraro:
- » Pli
- » Krei
- Ne povis obteni difinon de «$1».
[16]--→ Airon Ĉ 12:11, 30 December 2009 (UTC) —Preceding unsigned comment added by Otourly (talk • contribs)
[edit] Translation and Translatewiki
Why do you not transform the LookupHover javascript in a Wikimedia extensions and use the power of the translatewiki ? Crochet.david (talk) 18:32, 12 November 2009 (UTC)
- That would take it from a simple javascript to requiring it's own extension? That doesn't seem...good. --ShakataGaNai ^_^ 18:39, 12 November 2009 (UTC)
- For now, it's a simple javascript. But one never knows what the future holds.Crochet.david (talk) 18:46, 12 November 2009 (UTC)
- I think the point is that it is simple javascript and doesn't need to be anything more, since it already does it's job. Plus if you make it a mediawiki plugin then you can't propagate it out to blogs and such. --ShakataGaNai ^_^ 18:49, 12 November 2009 (UTC)
- For now, it's a simple javascript. But one never knows what the future holds.Crochet.david (talk) 18:46, 12 November 2009 (UTC)
- If it were to become an extension, it would essentially be an extension that just loaded a script. (which i geuss there is nothing wrong with, some people might find that easier to install). However the issue with translatewiki, which well very appealing, the translation doesn't just involve translating a few key phrases, it also involves modifying some rather complicated (And quite fragile) regexs that screen scrape wiktionary, since each language definition uses slightly different markup. This requires some technical knowladge, beyond simply translating words. Bawolff ☺☻ 19:51, 12 November 2009 (UTC)
[edit] Problem with French language
Accents at begin and end of words are legal in many languages. For example, on French wikibooks, when I click on "désactivé" word, I get "Could not retrieve definition of desactiv".
Also error messages should be translated. --DavidL (talk) 23:50, 14 November 2009 (UTC)
The error message is translated(I could [have] sworn that was translated. must be losing my mind. Its translated now, just needs to be posted to fr wiktionary.). When I click on the word, I get "(Français) Du verbe désactiver." [17]The issue with accents at the end of the word was fixed weeks ago. Perhaps you have an old (really old) cached version of the script. Try doing a hard refresh of the page where you clicked the word.Apperently this is a different issue with accents (Its caused by their being extra whitespace at the end of the word that was not stripped properly). If you do a hard refresh it should be fixed now. Thanks for the bug report. Bawolff ☺☻ 05:24, 15 November 2009 (UTC)
[edit] Particularity of the Wikizionario
Hi, for the wikt it, Wim_b has requested me that we should add the local project feedback:
- If I don't know the word, two links: "crea" (create it) or "richiedila" (request it)
The second link should be associated to it:wikt:Wikizionario:Feedback by adding a new section with the article link in title. Then the user will complete the body of the request. Otourly (talk) 22:30, 15 November 2009 (UTC)
- That should definitly be do-able. Should the bottom link look as follows (If it was an entry for sample word):
? Bawolff ☺☻ 22:56, 15 November 2009 (UTC)
- Wim_b have ask this it:wikt:Wikizionario:Bar#Considerazioni; It work with china writing [18]! I'm proud of you! Otourly (talk) 23:48, 15 November 2009 (UTC)
- On en wikt they also have a feedback but it seems more difficult for edit wikt:Wiktionary:Feedback (monthly self-archive) Otourly (talk) 00:00, 16 November 2009 (UTC)
[edit] Phonetic and sound
As a good seller, I've promised the moon to to convince Wikispecies:Wikispecies:Village_Pump#Wiktionary_Hover:_a_JavaScript_on_double-click: is it possible to start the development of the displaying of the wiktionaries phonetic and sound, which would ones of the most important aspect of this project, please? JackPotte (talk) 22:27, 16 November 2009 (UTC)
- Yes, but it'd take time. This would have to be implemented for each language seperately. Bawolff ☺☻ 13:25, 17 November 2009 (UTC)
[edit] Reach
Otourly is tracking the ever-expanding reach of wiktLookUp. - Amgine | t 04:01, 17 November 2009 (UTC)
[edit] Feedback from the Chinese side
As our fellow said, there's a very big problem with ideograms ;). JackPotte (talk) 14:08, 21 November 2009 (UTC)
[edit] Script conflicts with "Edit pages on double-click"
I'm using the script on Commonms and also have "Edit pages on double-click" activated in the preferences. Unfortunately, both parts can't be used together (unoess on special pages, which are localized almost anytime). It would be great if you could find another way than double-clicking. (See also User talk:Otourly on Commons where I originally asked this). --The Evil IP address (talk) 23:52, 28 November 2009 (UTC)
- There's a couple ways arround this. First of all, you can hold down shift well double clicking to edit, and not hold down shift to look up a word. Second of all, you can enable the reverseShift option (If your not sure how to do that, i can help you), and use the key combo ctrl+shift+l to look things up. Cheers. Bawolff ☺☻ 18:20, 29 November 2009 (UTC)
[edit] Unhiding too early
Displaying the window first and changing its contents second is ugly. Try doubleclicking on a word, then clicking away to hide the window, then doubleclicking another. First the previous definition will show up, then an empty window with the (C) footer, and the actual definition only after that. --Tgr (talk) 08:57, 4 December 2009 (UTC)
