MediaWiki talk:Gadget-TabbedLanguages.js

Page body moves when I hover over a tab
For example, if I'm at [[utrum]], and I pass the mouse/cursor over "Swedish", "Swedish" moves left and back, and the whole page-body moves with it. (The converse is not true: if I'm at [[utrum]], passing the cursor over "Latin" only moves "Latin", not the whole page-body, apparently because "Swedish" is longer than "Latin".) —Ruakh TALK 18:51, 15 October 2012 (UTC)
 * Hm. Hopefully there will be a way around that. I've reverted the change that caused this for now. --Yair rand (talk) 19:03, 15 October 2012 (UTC)

Auto-addition of hash is kind of annoying.
Maybe this is just me, but I find it kind of annoying when I visit http://en.wiktionary.org/wiki/tekem%C3%A4st%C3%A4 and the URL gets automatically changed to http://en.wiktionary.org/wiki/tekem%C3%A4st%C3%A4#Finnish. —Ruakh TALK 17:57, 29 December 2012 (UTC)
 * However, if the url doesn't contain this extra data, then it often won't reflect the correct section. If a user copies a url to send to someone else, it would be better to have it include the language section, or else the person receiving it might be directed to the wrong section and get very confused. Also, there doesn't appear to be any way to have the back button reliably go to the right section in IE9< and FF3.6 without the script adding the section to the url's hash. --Yair rand (talk) 17:27, 30 December 2012 (UTC)

Vietnamese version
I implemented this gadget at the Vietnamese Wiktionary. Since the standard entry layout and syntax is different there, I ended up writing it from scratch. It lacks all the special functionality around live preview, but it does have some additional features that might be worth exploring here:


 * The hash doesn't have to match exactly. Every language heading has Unicode characters, for example "Tiếng Việt" for Vietnamese, which MediaWiki annoyingly turns into "Ti.E1.BA.BFng_Vi.E1.BB.87t". The gadget lets you type "#Tiếng Việt" or even "#vie" (ISO 639-2 code) into the URL bar to display the same tab; the gadget rewrites the hash automatically. It would be nice if the English version did this for turning spaces into underscores or allowing case-insensitive matching.
 * When you print an entry or view the printable version of an entry, the gadget temporarily pulls apart the tabs so that you can see the entire entry (the contents of every tab) on your printed copy.
 * When you make the window too narrow, the tabs become horizontal tabs to save space.
 * It doesn't really matter here, since this wiki uses consistently, but the Vietnamese version also appends the current tab's hash to links listed under headings like "Related terms" and "Homophones".

Try it out: go [#mw-prefsection-gadgets here] and check "Organize each entry into tabs by language" (under "Navigation"). Then view an entry like "a" or "para".

Unfortunately, the gadget I wrote ended up being so different than this one that probably none of the code could be reused as is. But it would be nice to have some of these extra features here too.

– Minh Nguyễn &#x1f4ac; 20:51, 15 January 2015 (UTC)


 * The Vietnamese Wiktionary version of this gadget has been enabled by default since 2015, so you don't need to enable it manually to see it in action. I recently upgraded it to use OOUI instead of jQuery UI, which is now deprecated. The booklet layout with tabs on the side felt too heavyweight for this purpose, so I changed it to an index layout, with tabs on the top. The tab bar ends up being a bit less discoverable, but that could be solved with a modicum of CSS by applying . Minh Nguyễn  &#x1f4ac; 23:43, 21 December 2021 (UTC)

Country Flags
This doesn't work with the Country Flags gadget. Is this an insurmountable problem? TIA HAND —Phil | Talk 16:39, 23 July 2018 (UTC)
 * I'm not even sure where the flags would go. At the top of the section? In the tab? I don't think trying to fit it in would be a good idea, and it might mess things up a bit. --Yair rand (talk) 04:29, 25 July 2018 (UTC)

Suggestion: user-selected default language
When I come to wiktionary it's to look up the definition of a word in a specific language. If that language isn't english and that word has meanings in multiple languages, this adds a bit of searching/clicking to get to that language. To get around this I've added a greasemonkey script that sets the anchor to the language I want, in my case "#French". Adding this as an option I think would be quite useful, however I don't know how to propose changes other than here.

The script I'm using (pretty brute-force without any options): (function {   'use strict';    if (window.location.hash !== 'French') {        window.location.hash = 'French';    } });

Unable to access non-English languages
When I activate this via Preferences, all languages except English are hidden. I can see the language tabs, but clicking them does nothing.

Relevant JavaScript console output: "" Daask (talk) 00:58, 29 April 2022 (UTC)